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-sql rejects any source that does not implement the MindsDB compatibleSource interface. The tool cannot obtain a DB connection from an incompatible source, so the mismatch is surfaced as this error during tool/source validation.
Source
Thrown at internal/tools/mindsdb/mindsdbsql/mindsdbsql.go:104
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()
newStatement, err := parameters.ResolveTemplateParams(t.Cfg.TemplateParameters, t.Cfg.Statement, paramsMap)
if err != nil {
return nil, util.NewAgentError("unable to extract template params", err)
}
newParams, err := parameters.GetParams(t.Cfg.Parameters, paramsMap)
if err != nil {
return nil, util.NewAgentError("unable to extract standard params", err)View on GitHub (pinned to 8cc6e09de2)
Solutions
- Set the tool's `source` to a source of kind `mindsdb`
- Cross-check `sources:` names against the tool's `source` field
- Run a local toolbox start to validate every binding
Example fix
// before source: my-bigquery // after source: my-mindsdb
Defensive patterns
Strategy: validation
Validate before calling
if err := mindsdbSQLTool.ValidateSource(src); err != nil {
return fmt.Errorf("mindsdb-sql %q: %w", name, err)
} Prevention
- Only attach mindsdb-sql to MindsDB sources
- Validate tool/source pairs at load time
- Review diffs of tools.yaml for source field changes
When it happens
Trigger: Attaching a mindsdb-sql tool to a non-MindsDB source in tools.yaml; server startup calls ValidateSource for each tool/source pair.
Common situations: Wrong source reference in the tool config; source swapped to a different database kind; duplicated tool blocks where one kept an old source name.
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/3a65ab87edf162bc.
Report an issue: GitHub.