{"record":{"id":"32d5fa9d0edb2e1b","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-32d5fa","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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/postgres/postgreslistindexes/postgreslistindexes.go","lineNumber":170,"sourceCode":"\tresp, err := source.RunSQL(ctx, listIndexesStatement, sliceParams)\n\tif err != nil {\n\t\treturn nil, util.ProcessGeneralError(err)\n\t}\n\treturn resp, 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\n}\n","sourceCodeStart":152,"sourceCodeEnd":174,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/postgres/postgreslistindexes/postgreslistindexes.go#L152-L174","documentation":"ValidateSource type-asserts the resolved source against the tool's compatibleSource interface (RunSQL over pgx). The error fires when the tool is bound to a source that is not a Postgres-compatible source, i.e. the tool kind and source kind in the YAML configuration are incompatible.","triggerScenarios":"Thrown at internal/tools/postgres/postgreslistindexes/postgreslistindexes.go:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the tool's 'source' field at a Postgres-compatible source (e.g. postgres, cloudsql-postgres, alloydb-postgres) defined in tools.yaml","Ensure the source kind implements RunSQL over pgx/v5","Correct any typo in the source name that resolved to the wrong source"],"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"}