googleapis/mcp-toolbox · error

unable to parse 'items' field: %w

Error message

unable to parse 'items' field: %w

What it means

ArrayParameter's custom unmarshaling recursively parses its nested 'items' schema. If the schema of the items parameter is invalid (bad type name, malformed structure, disallowed nested auth services), the underlying parse error is wrapped with this message so you know the problem is inside the array's items definition, not the array itself.

Source

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

	CommonParameter `yaml:",inline"`
	Default         *[]any    `yaml:"default"`
	Items           Parameter `yaml:"items"`
}

func (p *ArrayParameter) UnmarshalYAML(ctx context.Context, unmarshal func(interface{}) error) error {
	var rawItem struct {
		CommonParameter `yaml:",inline"`
		Default         *[]any                  `yaml:"default"`
		Items           util.DelayedUnmarshaler `yaml:"items"`
	}
	if err := unmarshal(&rawItem); err != nil {
		return err
	}
	p.CommonParameter = rawItem.CommonParameter
	p.Default = rawItem.Default
	i, err := parseParamFromDelayedUnmarshaler(ctx, &rawItem.Items)
	if err != nil {
		return fmt.Errorf("unable to parse 'items' field: %w", err)
	}
	if i.GetAuthServices() != nil && len(i.GetAuthServices()) != 0 {
		return fmt.Errorf("nested items should not have auth services")
	}
	p.Items = i

	return nil
}

func (p *ArrayParameter) IsAllowedValues(v []any) bool {
	a := p.GetAllowedValues()
	if len(a) == 0 {
		return true
	}
	for _, av := range a {
		if reflect.DeepEqual(v, av) {
			return true
		}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Open tools.yaml at the offending array parameter and validate the 'items' block: correct 'type' string (string, integer, boolean, float, array, map), no authServices.
  2. Compare against a known-good array parameter schema and fix field names/indentation.
  3. Run the toolbox config validation (toolbox dev or --prebuilt flag loads) to see the wrapped root-cause error beneath this message.

Example fix

# before
- name: tags
  type: array
  items:
    type: str
    authServices: [myAuth]
# after
- name: tags
  type: array
  items:
    type: string
Defensive patterns

Strategy: validation

Validate before calling

# Validate tools.yaml before deploying
.toolbox check: ensure items.type in {string,integer,boolean,float,array,map} and items has no unknown fields

Prevention

When it happens

Trigger: Loading a tools.yaml where an array parameter's 'items' block fails parseParamFromDelayedUnmarshaler — e.g. items has type: 'str' (invalid), an unknown field, or nested authServices in the items.

Common situations: Typo in the items type name in tools.yaml; copying an array schema from another tool and leaving authServices inside items; hand-editing YAML and breaking indentation of the items block.

Understand the failure class

Related errors


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