{"record":{"id":"92d36d37fac6c670","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-92d36d","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/dataplex/dataplexlookupentry/dataplexlookupentry.go","lineNumber":115,"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\tparamsMap := params.AsMap()\n\tentry, _ := paramsMap[\"entry\"].(string)\n\tview, _ := paramsMap[\"view\"].(int)\n\taspectTypeSlice, err := parameters.ConvertAnySliceToTyped(paramsMap[\"aspectTypes\"].([]any), \"string\")\n\tif err != nil {\n\t\treturn nil, util.NewAgentError(fmt.Sprintf(\"can't convert aspectTypes to array of strings: %s\", err), err)\n\t}\n\tparts := strings.Split(entry, \"/\")\n\tif len(parts) < 4 || parts[0] != \"projects\" || parts[2] != \"locations\" {","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/dataplex/dataplexlookupentry/dataplexlookupentry.go#L97-L133","documentation":"dataplex-lookup-entry requires a source implementing its compatibleSource interface (LookupEntry method). ValidateSource type-asserts the attached source and returns this error when it is not a Dataplex-compatible source. It prevents invoking the tool against an unrelated source type.","triggerScenarios":"ValidateSource (or Invoke) receives a sources.Source that lacks the LookupEntry method signature required by dataplex-lookup-entry.","commonSituations":"Misconfigured YAML binding the tool to a non-Dataplex source; copy-pasted tool definitions referencing another integration's source.","solutions":["Bind the tool to a dataplex source in the config","Confirm the referenced source is defined and of kind dataplex","Restart toolbox so startup source validation runs"],"exampleFix":"// before\nsource: bigquery\n// after\nsource: dataplex","handlingStrategy":"type-guard","validationCode":"if _, ok := src.(interface {\n\tLookupEntry(ctx context.Context, name, view string, aspectTypes []string, entry string) (*dataplex.GoogleCloudDataplexV1Entry, error)\n}); !ok {\n\treturn fmt.Errorf(\"source %T does not support LookupEntry\", src)\n}","typeGuard":"func isDataplexLookupEntrySource(s sources.Source) bool {\n\t_, ok := s.(interface {\n\t\tLookupEntry(ctx context.Context, name, view string, aspectTypes []string, entry string) (*dataplex.GoogleCloudDataplexV1Entry, error)\n\t})\n\treturn ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n\t// incompatible source: rebind tool to the dataplex source\n\treturn fmt.Errorf(\"invalid tool source: %w\", err)\n}","preventionTips":["Reference the dataplex source by its exact configured name","Run config validation at startup before accepting requests","Keep tool definitions inside the dataplex integration section"],"tags":["go","dataplex","type-mismatch","configuration"],"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"}