googleapis/mcp-toolbox · error

unable to parse prebuilt tool configuration for '%s': %w

Error message

unable to parse prebuilt tool configuration for '%s': %w

What it means

When loading a prebuilt configuration, the toolbox fetches the embedded YAML and runs parser.ParseConfig. If parsing/unmarshaling into the Config struct fails, this error wraps the underlying parser error and startup aborts.

Source

Thrown at cmd/internal/options.go:225

							logger.ErrorContext(ctx, errMsg.Error())
							return isCustomConfigured, errMsg
						}
					}
				}
			}

			sourceName, toolsetName, _ := strings.Cut(configName, "/")

			buf, err := prebuiltconfigs.Get(sourceName)
			if err != nil {
				logger.ErrorContext(ctx, err.Error())
				return isCustomConfigured, err
			}

			// Parse into Config struct
			parsed, err := parser.ParseConfig(ctx, buf)
			if err != nil {
				errMsg := fmt.Errorf("unable to parse prebuilt tool configuration for '%s': %w", configName, err)
				logger.ErrorContext(ctx, errMsg.Error())
				return isCustomConfigured, errMsg
			}

			if toolsetName != "" {
				// Legacy toolsets are folded into groups at unmarshal, so the named
				// toolset resolves as a group.
				targetGroup, exists := parsed.Groups[toolsetName]
				if !exists {
					var available []string
					for k := range parsed.Groups {
						if k == "" {
							continue
						}
						available = append(available, k)
					}
					slices.Sort(available)
					errMsg := fmt.Errorf("toolset '%s' not found in prebuilt configuration '%s'. Available toolsets: %s", toolsetName, sourceName, strings.Join(available, ", "))

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Read the wrapped parser error after the colon for the exact YAML problem
  2. Upgrade or reinstall the toolbox binary to match the prebuilt config expectations
  3. Try a different, known-good prebuilt config (e.g. 'postgres/postgres-sql') to isolate the issue
  4. If using a custom config file, verify it with the parser before launch

Example fix

// before
--prebuilt postgres/nonexistent-toolset
// after
--prebuilt postgres/postgres-sql
Defensive patterns

Strategy: validation

Validate before calling

// sanity check: use a known-good prebuilt config before exotic ones
./toolbox --prebuilt postgres/postgres-sql --prebuilt your-experimental/one

Try / catch

parsed, err := parser.ParseConfig(ctx, buf)
if err != nil {
    return fmt.Errorf("unable to parse prebuilt tool configuration for '%s': %w", configName, err)
}

Prevention

When it happens

Trigger: parser.ParseConfig fails on the embedded prebuilt YAML for the requested configName — malformed embedded file, or a toolset/group reference inside it that cannot be resolved.

Common situations: Running a mismatched toolbox binary version against a prebuilt config name that resolves to incompatible content, or a typo in the toolset portion producing an unresolvable reference.

Understand the failure class

Related errors


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