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 the falkordb-cypher tool asserts the bound source implements the tool's private `compatibleSource` interface (a FalkorDB source). Any other source kind fails the assertion, so the tool reports the source is not a compatible type and will not serve Cypher execution against it.
Source
Thrown at internal/tools/falkordb/falkordbcypher/falkordbcypher.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)
}
paramsMap := params.AsMap()
resp, err := source.RunQuery(ctx, "", t.Cfg.Statement, paramsMap, false, false)
if err != nil {
return nil, util.ProcessGeneralError(err)
}
return resp, nil
}
View on GitHub (pinned to 8cc6e09de2)
Solutions
- Point the tool's `source` at a source with kind `falkordb`
- Verify the sources section: the referenced source must be the FalkorDB one
- Remove or rename duplicate source names to avoid ambiguity
- Rebuild/restart the toolbox and re-check tool loading
Example fix
// before (tools.yaml)
tools:
cypher:
kind: falkordb-cypher
source: postgres-src
// after
tools:
cypher:
kind: falkordb-cypher
source: falkordb-src Defensive patterns
Strategy: validation
Validate before calling
// falkordb-cypher requires a falkordb source:
if src.Kind != "falkordb" {
return fmt.Errorf("tool %s needs kind=falkordb, got %s", toolName, src.Kind)
} Type guard
if _, ok := src.(falkordbcypher.CompatibleSource); !ok {
return fmt.Errorf("source %T is not a FalkorDB source", src)
} Try / catch
if err := tool.ValidateSource(src); err != nil {
log.Fatalf("rebind %s to the falkordb source: %v", toolName, err)
} Prevention
- Verify the `source:` line of every graph tool points at the falkordb source
- Keep graph and relational sources in clearly separated config sections
- Test tool loading after any source rename or backend migration
- Use unique, engine-prefixed source names in shared configs
When it happens
Trigger: A `falkordb-cypher` tool bound via its `source` field to a source defined with a non-FalkorDB kind (Postgres, MySQL, Elasticsearch, etc.).
Common situations: Reusing a shared tools.yaml where the source name collides with another engine's source; switching graph backends without updating tool source bindings; typos in the source name resolving to the wrong entry.
Related errors
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/5d7d71c451511007.
Report an issue: GitHub.