googleapis/mcp-toolbox · error
invalid source for %q tool: source %q is not a compatible ty
Error message
invalid source for %q tool: source %q is not a compatible type
What it means
ValidateSource on the looker-createviewfromtable tool asserts that the given sources.Source implements compatibleSource. A failed assertion means the source is not a Looker source, so validation fails with this error and the tool will not invoke against it.
Source
Thrown at internal/tools/looker/lookercreateviewfromtable/lookercreateviewfromtable.go:120
// validate interface
var _ tools.Tool = Tool{}
type Tool struct {
tools.BaseTool[Config]
}
func (t Tool) GetSourceName() string {
return t.Cfg.Source
}
func (t Tool) ToConfig() tools.ToolConfig {
return t.Cfg
}
func (t Tool) ValidateSource(source sources.Source) error {
_, ok := source.(compatibleSource)
if !ok {
return fmt.Errorf("invalid source for %q tool: source %q is not a compatible type", t.Cfg.Type, t.Cfg.Source)
}
return nil
}
func (t Tool) Invoke(ctx context.Context, s sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {
source, ok := s.(compatibleSource)
if !ok {
return nil, util.NewClientServerError("source used is not compatible with the tool", http.StatusInternalServerError, nil)
}
logger, err := util.LoggerFromContext(ctx)
if err != nil {
return nil, util.NewClientServerError(fmt.Sprintf("error getting logger from context: %s", err), http.StatusInternalServerError, err)
}
sdk, err := source.GetLookerSDK(ctx, string(accessToken))
if err != nil {
return nil, util.NewClientServerError(fmt.Sprintf("error getting sdk: %v", err), http.StatusInternalServerError, err)
}View on GitHub (pinned to 8cc6e09de2)
Solutions
- Point the tool's source field at a looker-kind source
- Ensure the Looker source is registered (init) and successfully initialized
- In tests/code, pass a source implementing the compatibleSource interface
Example fix
# before source: my-mysql # after source: my-looker
Defensive patterns
Strategy: type-guard
Validate before calling
if _, ok := src.(lookercreateviewfromtable.CompatibleSource); !ok {
return fmt.Errorf("looker-create-view-from-table requires a looker source")
} Type guard
func isLookerViewSource(s sources.Source) bool {
_, ok := s.(lookercreateviewfromtable.CompatibleSource)
return ok
} Try / catch
if err := tool.ValidateSource(src); err != nil {
if strings.Contains(err.Error(), "not a compatible type") {
// point the tool at the looker source
}
return err
} Prevention
- Cross-check tool source references against declared source kinds
- Validate config at boot before tools are invoked
- Use the looker source in tests for looker tools
- Avoid renaming source kinds without updating tool bindings
When it happens
Trigger: Calling ValidateSource with a non-Looker source — typically because the tool's YAML source reference points at a different kind of source, or a wrong Source is passed in code.
Common situations: Config mistake binding the tool to a database source; test harness passing a stub source without compatibleSource methods; source kind drift after version upgrades.
Related errors
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/5bc5d584fa70c9cd.
Report an issue: GitHub.