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

Source-compatibility check in ValidateSource: the configured source does not implement the Firestore compatibleSource interface required by the query-collection tool, so it cannot run Firestore collection queries.

Source

Thrown at internal/tools/firestore/firestorequerycollection/firestorequerycollection.go:143

			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},
			params,
		),
	}, 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
}

// createParameters creates the parameter definitions for the tool
func createParameters() parameters.Parameters {
	collectionPathParameter := parameters.NewStringParameter(
		collectionPathKey,
		"The relative path to the Firestore collection to query (e.g., 'users' or 'users/userId/posts'). Note: This is a relative path, NOT an absolute path like 'projects/{project_id}/databases/{database_id}/documents/...'",
	)

	filtersDescription := `Array of filter objects to apply to the query. Each filter is a JSON string with:
- field: The field name to filter on
- op: The operator to use ("<", "<=", ">", ">=", "==", "!=", "array-contains", "array-contains-any", "in", "not-in")
- value: The value to compare against (can be string, number, boolean, or array)
Example: {"field": "age", "op": ">", "value": 18}`

	filtersParameter := parameters.NewArrayParameter(

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool's source field at a firestore source instance
  2. Verify the source kind in tools.yaml matches the Firestore source
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at internal/tools/firestore/firestorequerycollection/firestorequerycollection.go:143 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/ab3f3bbfc6bf5f75. Report an issue: GitHub.