{"record":{"id":"97620ca8a99c6ef2","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-97620c","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/singlestore/singlestoresql/singlestoresql.go","lineNumber":156,"sourceCode":"}\n\n// EmbedParams overrides BaseTool to apply the pgvector formatter.\nfunc (t Tool) EmbedParams(ctx context.Context, paramValues parameters.ParamValues, pMgr tools.PrimitiveManagerI) (parameters.ParamValues, error) {\n\treturn parameters.EmbedParams(ctx, t.StaticParameters, paramValues, pMgr, embeddingmodels.FormatVectorForPgvector)\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":138,"sourceCodeEnd":160,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/singlestore/singlestoresql/singlestoresql.go#L138-L160","documentation":"The singlestore-sql tool throws this in ValidateSource when its configured source fails the `compatibleSource` type assertion — the source is not a SingleStore source exposing the expected database pool. This is a startup-time guard: Toolbox validates every tool/source pairing while loading tools.yaml so incompatible combinations are rejected before serving requests.","triggerScenarios":"A `singlestore-sql` tool whose `source:` names a source of another kind (e.g. postgres, mssql), so `source.(compatibleSource)` returns false in singlestoresql.go and the formatted error is returned.","commonSituations":"Mixed-database configs where similar tool names (postgres-sql vs singlestore-sql) get swapped sources; copy-paste from another integration's docs; config merge tools rewriting source keys.","solutions":["Point the tool's `source` at a `kind: singlestore` source.","Add a properly configured singlestore source if missing, then reference it.","Validate the full tools.yaml by starting Toolbox locally and resolving all ValidateSource errors before deploying."],"exampleFix":"# before\ntools:\n  query-tool:\n    kind: singlestore-sql\n    source: pg-src\n# after\ntools:\n  query-tool:\n    kind: singlestore-sql\n    source: singlestore-src","handlingStrategy":"validation","validationCode":"sources:\n  singlestore-src:\n    kind: singlestore\ntools:\n  query-tool:\n    kind: singlestore-sql\n    source: singlestore-src","typeGuard":"func isSingleStoreSource(s sources.Source) bool {\n    _, ok := s.(singlestore.Source)\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Cross-check every singlestore-sql tool's source against the sources section after merges.","Avoid generic source names like `db` that invite cross-engine misbinding.","Validate configs by starting Toolbox locally; the error names the exact tool and source."],"tags":["configuration","go","type-mismatch","singlestore"],"backgroundTag":"incompatible-source-type","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"}