googleapis/mcp-toolbox · error

unknown source type: %q

Error message

unknown source type: %q

What it means

DecodeConfig looked up the source's type string in the source registry and found no registered factory — the YAML declares a `type` that Toolbox does not know (typo, or a source built into a different binary).

Source

Thrown at internal/sources/sources.go:50

var sourceRegistry = make(map[string]SourceConfigFactory)

// Register registers a new source type with its factory.
// It returns false if the type is already registered.
func Register(sourceType string, factory SourceConfigFactory) bool {
	if _, exists := sourceRegistry[sourceType]; exists {
		// Source with this type already exists, do not overwrite.
		return false
	}
	sourceRegistry[sourceType] = factory
	return true
}

// DecodeConfig decodes a source configuration using the registered factory for the given type.
func DecodeConfig(ctx context.Context, sourceType string, name string, decoder *yaml.Decoder) (SourceConfig, error) {
	factory, found := sourceRegistry[sourceType]
	if !found {
		return nil, fmt.Errorf("unknown source type: %q", sourceType)
	}
	sourceConfig, err := factory(ctx, name, decoder)
	if err != nil {
		return nil, fmt.Errorf("unable to parse source %q as %q: %w", name, sourceType, err)
	}
	return sourceConfig, err
}

// SourceConfig is the interface for configuring a source.
type SourceConfig interface {
	SourceConfigType() string
	Initialize(ctx context.Context, tracer trace.Tracer) (Source, error)
}

// Source is the interface for the source itself.
type Source interface {
	SourceType() string
	ToConfig() SourceConfig

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Check the source `type` spelling in tools.yaml against the supported sources list
  2. Ensure the source kind is compiled into the running Toolbox binary
  3. Upgrade to a version that supports the source type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/sources/sources.go:50 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/e83451a608f6aa21. Report an issue: GitHub.