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
The execute-sql-many tool's RequiresClientAuthorization rejected the configured source because it does not implement compatibleSource — the tool is bound to a source that is not a Cloud SQL admin source.
Source
Thrown at internal/tools/cloudsqladmin/cloudsqladminsqlmany/cloudsqladminsqlmany.go:135
logger, err := util.LoggerFromContext(ctx)
if err != nil {
return nil, util.NewClientServerError("error getting logger", http.StatusInternalServerError, err)
}
logger.DebugContext(ctx, fmt.Sprintf("executing `%s` tool query on %s/%s/%s", resourceType, project, instanceId, database))
// Execute the SQL statement on the given database.
resp, err := source.ExecuteSql(ctx, project, instanceId, database, newStatement, string(accessToken))
if err != nil {
return nil, util.ProcessGcpError(err)
}
return resp, nil
}
func (t Tool) RequiresClientAuthorization(source sources.Source) (bool, error) {
s, ok := source.(compatibleSource)
if !ok {
return false, fmt.Errorf("invalid source for %q tool: source %q is not a compatible type", t.Cfg.Type, t.Cfg.Source)
}
return s.UseClientAuthorization(), nil
}
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 nilView on GitHub (pinned to 8cc6e09de2)
Solutions
- Point the tool's `source` at a compatible Cloud SQL admin source
- Check the source name for typos
- Verify the source `type` matches what this tool requires
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/cloudsqladmin/cloudsqladminsqlmany/cloudsqladminsqlmany.go:135 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/20c9d411cc17804d.
Report an issue: GitHub.