{"record":{"id":"0bfd1e39faac39cc","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-0bfd1e","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/firestore/firestoregetrules/firestoregetrules.go","lineNumber":101,"sourceCode":"// validate interface\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {\n\ttools.BaseTool[Config]\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\nfunc (t Tool) Invoke(ctx context.Context, s sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {\n\tsource, ok := s.(compatibleSource)\n\tif !ok {\n\t\treturn nil, util.NewClientServerError(\"source used is not compatible with the tool\", http.StatusInternalServerError, nil)\n\t}\n\tresp, err := source.GetRules(ctx)\n\tif err != nil {\n\t\treturn nil, util.ProcessGcpError(err)\n\t}\n\treturn resp, nil\n}\n","sourceCodeStart":83,"sourceCodeEnd":117,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/firestoregetrules/firestoregetrules.go#L83-L117","documentation":"firestore-get-rules' ValidateSource type-asserts the incoming sources.Source to compatibleSource. Any source that is not the Firestore source (e.g., a SQL database source) fails the assertion and yields this error before any rules API call.","triggerScenarios":"Invoking or validating the tool with a non-Firestore sources.Source.","commonSituations":"Misconfigured `source:` reference in YAML; reusing the same tool entry across different source kinds.","solutions":["Set the tool's `source:` to a firestore-kind source.","Confirm the referenced source's kind is firestore, not another database engine."],"exampleFix":"// before\n  get_rules:\n    kind: firestore-get-rules\n    source: my-bigquery\n// after\n  get_rules:\n    kind: firestore-get-rules\n    source: my-firestore","handlingStrategy":"type-guard","validationCode":"if err := getRulesTool.ValidateSource(fsSource); err != nil {\n\treturn fmt.Errorf(\"get-rules needs a firestore source: %w\", err)\n}","typeGuard":"func isCompatibleFirestoreSource(s sources.Source) bool {\n\t_, ok := s.(firestore.CompatibleSource)\n\treturn ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n\treturn fmt.Errorf(\"source binding mismatch: %w\", err)\n}","preventionTips":["Never reference SQL/BigQuery sources from firestore-get-rules.","Validate bindings at server startup, before the first tool call.","Name sources by engine (e.g., fs-prod) to reduce mis-binding mistakes."],"tags":["firestore","source-validation","config"],"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"}