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 get-instance tool's ValidateSource guard rejected the configured source because it does not implement compatibleSource — the tool is bound in tools.yaml to a source that is not an AlloyDB source.

Source

Thrown at internal/tools/alloydb/alloydbgetinstance/alloydbgetinstance.go:101

}

// Tool represents the get-instance 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
}

// Invoke executes the tool's logic.
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)
	}
	paramsMap := params.AsMap()

	project, ok := paramsMap["project"].(string)
	if !ok || project == "" {
		return nil, util.NewAgentError("invalid or missing 'project' parameter; expected a string", nil)
	}
	location, ok := paramsMap["location"].(string)
	if !ok || location == "" {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool's `source` at an AlloyDB 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/alloydb/alloydbgetinstance/alloydbgetinstance.go:101 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/f2fb08d6784215cd. Report an issue: GitHub.