{"record":{"id":"478c28c62a543884","repo":"googleapis/mcp-toolbox","slug":"this-tool-is-read-only-and-cannot-execute-write-qu-478c28","errorCode":null,"errorMessage":"this tool is read-only and cannot execute write queries","messagePattern":"this tool is read-only and cannot execute write queries","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/neo4j/neo4j.go","lineNumber":123,"sourceCode":"}\n\nfunc (s *Source) Neo4jDriver() neo4j.Driver {\n\treturn s.Driver\n}\n\nfunc (s *Source) Neo4jDatabase() string {\n\treturn s.Database\n}\n\nfunc (s *Source) RunQuery(ctx context.Context, cypherStr string, params map[string]any, readOnly, dryRun bool) (any, error) {\n\t// validate the cypher query before executing\n\tcf := sourceClassifier.Classify(cypherStr)\n\tif cf.Error != nil {\n\t\treturn nil, cf.Error\n\t}\n\n\tif cf.Type == classifier.WriteQuery && readOnly {\n\t\treturn nil, fmt.Errorf(\"this tool is read-only and cannot execute write queries\")\n\t}\n\n\tif dryRun {\n\t\t// Add EXPLAIN to the beginning of the query to validate it without executing\n\t\tcypherStr = \"EXPLAIN \" + cypherStr\n\t}\n\n\tconfig := neo4j.ExecuteQueryWithDatabase(s.Neo4jDatabase())\n\tresults, err := neo4j.ExecuteQuery[*neo4j.EagerResult](ctx, s.Neo4jDriver(), cypherStr, params,\n\t\tneo4j.EagerResultTransformer, config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to execute query: %w\", err)\n\t}\n\n\t// If dry run, return the summary information only\n\tif dryRun {\n\t\tsummary := results.Summary\n\t\tplan := summary.Plan()","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/neo4j/neo4j.go#L105-L141","documentation":"Error \"this tool is read-only and cannot execute write queries\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/neo4j/neo4j.go:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}