googleapis/mcp-toolbox · error

%s is an excluded value

Error message

%s is an excluded value

What it means

StringParameter.Parse rejects the runtime value supplied for a string parameter because it matches an entry in the parameter's 'excludedValues' blacklist. The guard fires at tool invocation time when the caller (or LLM) passes a forbidden value; the offending value is named in the message.

Source

Thrown at internal/util/parameters/parameters.go:703

// StringParameter is a parameter representing the "string" type.
type StringParameter struct {
	CommonParameter `yaml:",inline"`
	Default         *string `yaml:"default"`
	Escape          *string `yaml:"escape"`
}

// Parse casts the value "v" as a "string".
func (p *StringParameter) Parse(v any) (any, error) {
	newV, ok := v.(string)
	if !ok {
		return nil, &ParseTypeError{p.Name, p.Type, v}
	}
	if !p.IsAllowedValues(newV) {
		return nil, fmt.Errorf("%s is not an allowed value", newV)
	}
	if p.IsExcludedValues(newV) {
		return nil, fmt.Errorf("%s is an excluded value", newV)
	}
	if p.Escape != nil {
		return applyEscape(*p.Escape, newV)
	}
	return newV, nil
}

func applyEscape(escape, v string) (any, error) {
	switch escape {
	case escapeBackticks:
		escaped := strings.ReplaceAll(v, "`", "``")
		return fmt.Sprintf("`%s`", escaped), nil
	case escapeDoubleQuotes:
		escaped := strings.ReplaceAll(v, `"`, `""`)
		return fmt.Sprintf(`"%s"`, escaped), nil
	case escapeSingleQuotes:
		escaped := strings.ReplaceAll(v, `'`, `''`)
		return fmt.Sprintf(`'%s'`, escaped), nil

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Pass a value not listed in the parameter's excludedValues in tools.yaml
  2. Remove the value from excludedValues if it should be permitted
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/util/parameters/parameters.go:703 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/193967fd8633c539. Report an issue: GitHub.