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

  1. Point the tool's source at a Looker source (kind: looker) defined in the same config
  2. Fix typos in the source reference so it resolves to the Looker source
  3. Verify the referenced source initializes successfully as a *looker.Source
  4. 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

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


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/43bdfb9d03f554eb. Report an issue: GitHub.