googleapis/mcp-toolbox · error

prebuilt source tool for '%s' not found. %s

Error message

prebuilt source tool for '%s' not found. %s

What it means

Get looks up the embedded YAML for a prebuilt source configuration (e.g. "postgres") in the map populated at init time. It throws this error when the requested prebuilt source key does not exist; the message helpfully appends the list of available sources, or notes that none were found.

Source

Thrown at internal/prebuiltconfigs/prebuiltconfigs.go:55

	if err != nil {
		panic(fmt.Sprintf("Unexpected Error: %v\n", err))
	}
}

// Getter for the prebuiltToolsSources
func GetPrebuiltSources() []string {
	return prebuiltToolsSources
}

// Get prebuilt tools for a source
func Get(prebuiltSourceConfig string) ([]byte, error) {
	content, ok := prebuiltToolYAMLs[prebuiltSourceConfig]
	if !ok {
		prebuiltHelpSuffix := "no prebuilt configurations found."
		if len(prebuiltToolsSources) > 0 {
			prebuiltHelpSuffix = fmt.Sprintf("available: %s", strings.Join(prebuiltToolsSources, ", "))
		}
		errMsg := fmt.Errorf("prebuilt source tool for '%s' not found. %s", prebuiltSourceConfig, prebuiltHelpSuffix)
		return nil, errMsg
	}
	return content, nil
}

// Load all available pre built tools
func loadPrebuiltToolYAMLs() (map[string][]byte, []string, error) {
	toolYAMLs := make(map[string][]byte)
	var sourceTypes []string
	entries, err := prebuiltConfigsFS.ReadDir("tools")
	if err != nil {
		errMsg := fmt.Errorf("failed to read prebuilt tools %w", err)
		return nil, nil, errMsg
	}

	for _, entry := range entries {
		lowerName := strings.ToLower(entry.Name())
		if !entry.IsDir() && (strings.HasSuffix(lowerName, ".yaml")) {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Check the 'available: ...' suffix in the error and use an exact source name from that list.
  2. Verify the prebuilt config name in your tools YAML or --prebuilt-configs flag matches a YAML filename under internal/prebuiltconfigs/tools/ (filename minus .yaml is the key).
  3. Rebuild the binary from the current source so init() embeds the latest prebuilt YAMLs.
  4. If adding a new source, add its tools/<name>.yaml so it registers.

Example fix

// before
# tools.yaml
kind: postgress
toolsets: {}...
// after
kind: postgres
toolsets: {}...
Defensive patterns

Strategy: validation

Validate before calling

sources, _ := prebuiltconfigs.PrebuiltToolsSources() // or parse the 'available:' suffix
if !slices.Contains(sources, requestedKind) {
	return fmt.Errorf("kind %q is not a prebuilt config; available: %v", requestedKind, sources)
}

Try / catch

yaml, err := prebuiltconfigs.Get(kind)
if err != nil {
	var available string
	if i := strings.Index(err.Error(), "available:"); i >= 0 {
		available = err.Error()[i:]
	}
	return fmt.Errorf("unknown prebuilt kind %q (%s)", kind, available)
}

Prevention

When it happens

Trigger: Calling prebuiltconfigs.Get with a source name that has no embedded YAML — e.g. --prebuilt-configs misspelled on the CLI, a source removed/renamed in a newer version, or Get called before init populated the map (empty registry).

Common situations: Typo in a tool's prebuilt config name in tools.yaml (e.g. "postgress" instead of "postgres"); using a prebuilt config from documentation that targets a version where the source was renamed; embedding a new source without adding its YAML under internal/prebuiltconfigs/tools/.

Related errors


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