googleapis/mcp-toolbox · error

invalid source for %q tool: source %q is not a compatible ty

Error message

invalid source for %q tool: source %q is not a compatible type

What it means

ValidateSource for falkordb-listgraphs asserts the provided sources.Source implements `compatibleSource` (FalkorDB). A source of another type fails the assertion and the tool returns this error, refusing to list graphs from an incompatible backend.

Source

Thrown at internal/tools/falkordb/falkordblistgraphs/falkordblistgraphs.go:100

// validate interface
var _ tools.Tool = Tool{}

type Tool struct {
	tools.BaseTool[Config]
}

func (t Tool) GetSourceName() string {
	return t.Cfg.Source
}

func (t Tool) ToConfig() tools.ToolConfig {
	return t.Cfg
}

func (t Tool) ValidateSource(source sources.Source) error {
	_, ok := source.(compatibleSource)
	if !ok {
		return fmt.Errorf("invalid source for %q tool: source %q is not a compatible type", t.Cfg.Type, t.Cfg.Source)
	}
	return nil
}

func (t Tool) Invoke(ctx context.Context, s sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {
	source, ok := s.(compatibleSource)
	if !ok {
		return nil, util.NewClientServerError("source used is not compatible with the tool", http.StatusInternalServerError, nil)
	}

	graphs, err := source.FalkorDBClient().ListGraphs()
	if err != nil {
		return nil, util.ProcessGeneralError(err)
	}
	return map[string]any{"graphs": graphs}, nil
}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Set the tool's `source` to the FalkorDB source defined in the same file
  2. Cross-check every tool's source reference against the sources map
  3. Use distinct source names per engine to prevent accidental rebinding
  4. Restart the toolbox and verify the tool validates cleanly

Example fix

// before (tools.yaml)
tools:
  list-graphs:
    kind: falkordb-listgraphs
    source: redis-src
// after
tools:
  list-graphs:
    kind: falkordb-listgraphs
    source: falkordb-src
Defensive patterns

Strategy: validation

Validate before calling

if src.Kind != "falkordb" {
    return fmt.Errorf("listgraphs tool requires falkordb source, got kind=%s", src.Kind)
}

Type guard

if _, ok := src.(falkordblistgraphs.CompatibleSource); !ok {
    return fmt.Errorf("%T is not usable by falkordb-listgraphs", src)
}

Try / catch

if err := tool.ValidateSource(src); err != nil {
    return fmt.Errorf("rebind %s to falkordb source: %w", toolName, err)
}

Prevention

When it happens

Trigger: Binding a `falkordb-listgraphs` tool to a source entry whose kind is not `falkordb` in tools.yaml.

Common situations: Multi-source configs where the listgraphs tool was copied from another engine's section; environment-specific overrides swapping the source to a different database; typo'd source names falling through to a similarly named source.

Related errors


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