googleapis/mcp-toolbox · error

unable to execute query: %w

Error message

unable to execute query: %w

What it means

This wraps a failure from neo4j.ExecuteQuery, the Bolt call that runs the Cypher statement on ArcadeDB. Because the driver already passed VerifyConnectivity, this error surfaces at query time: the session/query itself failed — network drop, authentication, Cypher syntax error, missing database, or timeout. The wrapped cause contains the server or transport message.

Source

Thrown at internal/sources/arcadedb/arcadedb.go:144

func (s *Source) RunCypher(ctx context.Context, cypherStr string, params map[string]any, readOnly, dryRun bool) (any, error) {
	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 {
		cypherStr = "EXPLAIN " + cypherStr
	}

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

	if dryRun {
		summary := results.Summary
		plan := summary.Plan()
		if plan == nil {
			return nil, fmt.Errorf("dry-run produced no execution plan")
		}

		node, incomplete, operatorCount := buildPlanNode(plan)
		if operatorCount == 0 {
			return nil, fmt.Errorf("dry-run produced an empty execution plan")
		}

		execPlan := map[string]any{
			"queryType":     cf.Type.String(),
			"statementType": summary.QueryType(),
		}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Read the wrapped cause after 'unable to execute query:' — it names the server/transport failure.
  2. Validate the Cypher statement directly against ArcadeDB (e.g. via the web console) to isolate syntax issues.
  3. Confirm the configured database name exists on the server.
  4. Check server logs and connectivity if the cause is a transport/timeout error, then retry.

Example fix

// before: invalid Cypher
MATCH (n:Person RETURN n
// after
MATCH (n:Person) RETURN n
Defensive patterns

Strategy: try-catch

Validate before calling

if strings.Count(cypher, "(") != strings.Count(cypher, ")") {
    return errors.New("unbalanced parentheses in Cypher query")
}

Try / catch

results, err := neo4j.ExecuteQuery[*neo4j.EagerResult](ctx, driver, cypher, params, transformer, cfg)
if err != nil {
    var neo4jErr *neo4j.Neo4jError
    if errors.As(err, &neo4jErr) && neo4jErr.Classification() == "TransientError" {
        return retry(ctx, cypher) // retry transient failures
    }
    return fmt.Errorf("query failed: %w", err)
}

Prevention

When it happens

Trigger: Calling RunCypher when the ArcadeDB server rejects or fails the query: invalid Cypher syntax, referencing a non-existent database name, connection dropped mid-query, credentials revoked, or server-side error during execution.

Common situations: Typo'd Cypher syntax; querying a database name that doesn't exist in ArcadeDB; server restarted or network flake during the call; parameter type mismatches; ArcadeDB version lacking support for certain Cypher features.

Related errors


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