googleapis/mcp-toolbox · error

failed to list labels: %w

Error message

failed to list labels: %w

What it means

Wrap inside extractNodeLabels: the 'CALL db.labels()' procedure failed, so the node-label inventory that drives per-label counts and sampling could not even be listed.

Source

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

				errs <- err
			}
		}(task.fn)
	}
	wg.Wait()
	close(errs)
	for err := range errs {
		return nil, err
	}

	return schema, nil
}

// extractNodeLabels lists the node labels and derives each label's count and
// property shapes from a sample of nodes.
func (t Tool) extractNodeLabels(ctx context.Context, source compatibleSource) ([]types.NodeLabel, error) {
	labelsResult, err := runReadQuery(ctx, source, "CALL db.labels()")
	if err != nil {
		return nil, fmt.Errorf("failed to list labels: %w", err)
	}

	var nodeLabels []types.NodeLabel
	for _, label := range helpers.FirstColumnStrings(labelsResult) {
		escaped := escapeIdentifier(label)

		countResult, err := runReadQuery(ctx, source, fmt.Sprintf("MATCH (n:`%s`) RETURN count(n) AS count", escaped))
		if err != nil {
			return nil, fmt.Errorf("failed to count label %q: %w", label, err)
		}

		sampleResult, err := runReadQuery(ctx, source, fmt.Sprintf("MATCH (n:`%s`) RETURN n LIMIT %d", escaped, t.Cfg.SampleSize))
		if err != nil {
			return nil, fmt.Errorf("failed to sample label %q: %w", label, err)
		}
		accumulator := make(map[string]map[string]bool)
		for _, row := range helpers.Rows(sampleResult) {
			node, ok := row["n"].(map[string]any)

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Inspect the wrapped error for the underlying FalkorDB failure
  2. Verify the connection and database 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:286 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/7eb9675c7ea756de. Report an issue: GitHub.