googleapis/mcp-toolbox · error
failed to sample label %q: %w
Error message
failed to sample label %q: %w
What it means
Wrap inside extractNodeLabels: the sampling query that fetches a few example nodes of the named label failed, so property-shape inference for that label could not proceed.
Source
Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:300
// 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)
if !ok {
continue
}
if properties, ok := node["properties"].(map[string]any); ok {
helpers.MergeProperties(accumulator, properties)
}
}
nodeLabels = append(nodeLabels, types.NodeLabel{
Name: label,
Count: helpers.FirstRowInt64(countResult),
Properties: helpers.CollectProperties(accumulator),
})
}View on GitHub (pinned to 8cc6e09de2)
Solutions
- Retry the schema extraction if the graph is being mutated concurrently
- Check server logs for the underlying query failure
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at internal/tools/falkordb/falkordbschema/falkordbschema.go:300 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/f3c84729d1d9ab8b.
Report an issue: GitHub.