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
Tool.ValidateSource asserts that the attached source implements the compatibleSource interface (the Looker source). If the source configured for this conversational-analytics tool is any other type, the tool cannot use it and returns this error naming the configured type and source name.
Source
Thrown at internal/tools/looker/lookerconversationalanalytics/lookerconversationalanalytics.go:195
// 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
}
// parseExploreReferences converts the raw explore_references parameter into typed
// references. The parameter is declared as an array of free-form maps, so the values
// the model supplies are not schema-validated; guard every field access instead of
// letting an unexpected shape (a missing key, a non-string value, or a non-object
// element) panic the tool. Mirrors the validation in datalineagesearchlineage.
func parseExploreReferences(raw []any, lookerInstanceURI string) ([]LookerExploreReference, util.ToolboxError) {
refs := make([]LookerExploreReference, 0, len(raw))
for i, er := range raw {
m, ok := er.(map[string]any)
if !ok {
return nil, util.NewAgentError(fmt.Sprintf("invalid explore reference at index %d in 'explore_references': expected object, got %T", i, er), nil)
}
model, ok := m["model"].(string)
if !ok {View on GitHub (pinned to 8cc6e09de2)
Solutions
- Point the tool's source at a Looker source (kind: looker) defined in the same config
- Fix typos in the source reference so it resolves to the Looker source
- Verify the referenced source initializes successfully as a *looker.Source
- Move the tool under a config section where only Looker sources are defined
Example fix
// before
sources:
db:
kind: postgres
...
tools:
ask:
kind: looker-conversational-analytics
source: db
// after
sources:
looker:
kind: looker
...
tools:
ask:
kind: looker-conversational-analytics
source: looker Defensive patterns
Strategy: validation
Validate before calling
// at startup, after building tools
for _, t := range tools {
if err := t.ValidateSource(sources[t.Source()]); err != nil {
log.Fatalf("invalid tool/source binding: %v", err)
}
} Type guard
if _, ok := src.(lookercompatibleSourcesCompatible); !ok { /* not a looker source */ } Prevention
- Only pair looker-conversational-analytics tools with kind: looker sources
- Cross-check tool kind vs source kind in CI config linting
- Avoid renaming sources without updating tool references
When it happens
Trigger: Binding a looker-conversational-analytics tool to a non-Looker source (e.g. a postgres or http source) in the toolbox config, or referencing a source name that resolves to an incompatible source.
Common situations: Copy-pasting a tool block across configs and leaving the wrong source name; typos in source names resolving to the wrong source; combining tools from different integrations in one config.
Related errors
- unable to parse Timeout string as time.Duration: %s
- client_id and client_secret need to be specified
- client id or client secret not valid
- empty web_server_url in versions payload
- invalid web_server_url format: %q
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/43bdfb9d03f554eb.
Report an issue: GitHub.