{"record":{"id":"20c9d411cc17804d","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-20c9d4","errorCode":null,"errorMessage":"invalid source for %q tool: source %q is not a compatible type","messagePattern":"invalid source for %q tool: source %q is not a compatible type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cloudsqladmin/cloudsqladminsqlmany/cloudsqladminsqlmany.go","lineNumber":135,"sourceCode":"\n\tlogger, err := util.LoggerFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, util.NewClientServerError(\"error getting logger\", http.StatusInternalServerError, err)\n\t}\n\tlogger.DebugContext(ctx, fmt.Sprintf(\"executing `%s` tool query on %s/%s/%s\", resourceType, project, instanceId, database))\n\n\t// Execute the SQL statement on the given database.\n\tresp, err := source.ExecuteSql(ctx, project, instanceId, database, newStatement, string(accessToken))\n\tif err != nil {\n\t\treturn nil, util.ProcessGcpError(err)\n\t}\n\treturn resp, nil\n}\n\nfunc (t Tool) RequiresClientAuthorization(source sources.Source) (bool, error) {\n\ts, ok := source.(compatibleSource)\n\tif !ok {\n\t\treturn false, fmt.Errorf(\"invalid source for %q tool: source %q is not a compatible type\", t.Cfg.Type, t.Cfg.Source)\n\t}\n\treturn s.UseClientAuthorization(), nil\n}\n\nfunc (t Tool) GetSourceName() string {\n\treturn t.Cfg.Source\n}\n\nfunc (t Tool) ToConfig() tools.ToolConfig {\n\treturn t.Cfg\n}\n\nfunc (t Tool) ValidateSource(source sources.Source) error {\n\t_, ok := source.(compatibleSource)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid source for %q tool: source %q is not a compatible type\", t.Cfg.Type, t.Cfg.Source)\n\t}\n\treturn nil","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudsqladmin/cloudsqladminsqlmany/cloudsqladminsqlmany.go#L117-L153","documentation":"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.","triggerScenarios":"Thrown at internal/tools/cloudsqladmin/cloudsqladminsqlmany/cloudsqladminsqlmany.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}