googleapis/mcp-toolbox · error

failed to count nodes: %w

Error message

failed to count nodes: %w

What it means

Task-failure wrap inside the concurrent schema extraction: the 'counts' task's node count query ('MATCH (n) RETURN count(n)') failed, aborting the whole schema extraction.

Source

Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:212

				relationships, err := t.extractRelationships(ctx, source)
				if err != nil {
					return fmt.Errorf("failed to extract relationship schema: %w", err)
				}
				mu.Lock()
				defer mu.Unlock()
				schema.Relationships = relationships
				for _, relationship := range relationships {
					schema.Statistics.RelationshipsByType[relationship.Type] = relationship.Count
				}
				return nil
			},
		},
		{
			name: "counts",
			fn: func() error {
				nodeResult, err := runReadQuery(ctx, source, "MATCH (n) RETURN count(n) AS count")
				if err != nil {
					return fmt.Errorf("failed to count nodes: %w", err)
				}
				edgeResult, err := runReadQuery(ctx, source, "MATCH ()-[r]->() RETURN count(r) AS count")
				if err != nil {
					return fmt.Errorf("failed to count relationships: %w", err)
				}
				mu.Lock()
				defer mu.Unlock()
				schema.GraphInfo.NodeCount = helpers.FirstRowInt64(nodeResult)
				schema.GraphInfo.EdgeCount = helpers.FirstRowInt64(edgeResult)
				schema.Statistics.TotalNodes = schema.GraphInfo.NodeCount
				schema.Statistics.TotalRelationships = schema.GraphInfo.EdgeCount
				return nil
			},
		},
		{
			name: "indexes",
			fn: func() error {
				result, err := runReadQuery(ctx, source, "CALL db.indexes()")

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Inspect the wrapped error for the underlying FalkorDB failure
  2. Check graph reachability and server health
  3. Retry the schema extraction once the server is healthy
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:212 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/12581fdaf8763a8e. Report an issue: GitHub.