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
Tool.ValidateSource for mindsdb-execute-sql checks that the attached source implements compatibleSource (the MindsDB source interface). If the type assertion fails, the tool rejects the source because it cannot execute SQL against it. This is a startup/config-time compatibility check between tool and source kinds.
Source
Thrown at internal/tools/mindsdb/mindsdbexecutesql/mindsdbexecutesql.go:99
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()
sqlStr, ok := paramsMap["sql"].(string)
if !ok {
return nil, util.NewAgentError(fmt.Sprintf("unable to get cast %s", paramsMap["sql"]), nil)
}
resp, err := source.RunSQL(ctx, sqlStr, nil)
if err != nil {
return nil, util.ProcessGeneralError(err)View on GitHub (pinned to 8cc6e09de2)
Solutions
- Point the tool's `source` field at a MindsDB source (kind: mindsdb)
- Confirm the source name matches the entry under `sources:` in tools.yaml
- Restart/validate the toolbox config to confirm all bindings pass
Example fix
// before
tools:
exec:
kind: mindsdb-execute-sql
source: my-alloydb
// after
tools:
exec:
kind: mindsdb-execute-sql
source: my-mindsdb Defensive patterns
Strategy: validation
Validate before calling
if err := tool.ValidateSource(sourcesMap[toolCfg.Source]); err != nil {
log.Fatalf("config invalid: %v", err)
} Prevention
- Bind mindsdb tools only to `kind: mindsdb` sources
- Run config validation at startup before serving traffic
- Keep source names descriptive (e.g. my-mindsdb) to reduce miswiring
When it happens
Trigger: Binding the mindsdb-execute-sql tool to a source of the wrong kind (e.g. a postgres or http source); the server calls ValidateSource when wiring tools to sources.
Common situations: Wrong source name in the tool's `source` field; source renamed or replaced with a different kind; copy-pasted tool definitions pointing at another database's source.
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/f913e5f00870a338.
Report an issue: GitHub.