googleapis/mcp-toolbox · error

this tool is read-only and cannot execute write queries

Error message

this tool is read-only and cannot execute write queries

What it means

Error "this tool is read-only and cannot execute write queries" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/sources/neo4j/neo4j.go:123

}

func (s *Source) Neo4jDriver() neo4j.Driver {
	return s.Driver
}

func (s *Source) Neo4jDatabase() string {
	return s.Database
}

func (s *Source) RunQuery(ctx context.Context, cypherStr string, params map[string]any, readOnly, dryRun bool) (any, error) {
	// validate the cypher query before executing
	cf := sourceClassifier.Classify(cypherStr)
	if cf.Error != nil {
		return nil, cf.Error
	}

	if cf.Type == classifier.WriteQuery && readOnly {
		return nil, fmt.Errorf("this tool is read-only and cannot execute write queries")
	}

	if dryRun {
		// Add EXPLAIN to the beginning of the query to validate it without executing
		cypherStr = "EXPLAIN " + cypherStr
	}

	config := neo4j.ExecuteQueryWithDatabase(s.Neo4jDatabase())
	results, err := neo4j.ExecuteQuery[*neo4j.EagerResult](ctx, s.Neo4jDriver(), cypherStr, params,
		neo4j.EagerResultTransformer, config)
	if err != nil {
		return nil, fmt.Errorf("unable to execute query: %w", err)
	}

	// If dry run, return the summary information only
	if dryRun {
		summary := results.Summary
		plan := summary.Plan()

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/sources/neo4j/neo4j.go:123 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/478c28c62a543884. Report an issue: GitHub.