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

The execute-many tool's RequiresClientAuthorization rejected the configured source because it does not implement compatibleSource — the tool is bound to a source that is not a Cloud SQL admin source.

Source

Thrown at internal/tools/cloudsqladmin/cloudsqladminexecutemany/cloudsqladminexecutemany.go:123

	logger, err := util.LoggerFromContext(ctx)
	if err != nil {
		return nil, util.NewClientServerError("error getting logger", http.StatusInternalServerError, err)
	}
	logger.DebugContext(ctx, fmt.Sprintf("executing `%s` tool query on %s/%s/%s", resourceType, project, instanceId, database))

	// Execute the SQL statement on the given database.
	resp, err := source.ExecuteSql(ctx, project, instanceId, database, sql, string(accessToken))
	if err != nil {
		return nil, util.ProcessGcpError(err)
	}
	return resp, nil
}

func (t Tool) RequiresClientAuthorization(source sources.Source) (bool, error) {
	s, ok := source.(compatibleSource)
	if !ok {
		return false, fmt.Errorf("invalid source for %q tool: source %q is not a compatible type", t.Cfg.Type, t.Cfg.Source)
	}
	return s.UseClientAuthorization(), nil
}

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

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool's `source` at a compatible Cloud SQL admin source
  2. Check the source name for typos
  3. Verify the source `type` matches what this tool requires
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/tools/cloudsqladmin/cloudsqladminexecutemany/cloudsqladminexecutemany.go:123 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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