googleapis/mcp-toolbox · error

unable to unmarshal group: %s

Error message

unable to unmarshal group: %s

What it means

Error "unable to unmarshal group: %s" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/config.go:570

	dec, err := util.NewStrictDecoder(justTools)
	if err != nil {
		return toolsetConfig, fmt.Errorf("error creating decoder: %s", err)
	}
	var raw map[string][]string
	if err := dec.DecodeContext(ctx, &raw); err != nil {
		return toolsetConfig, fmt.Errorf("unable to unmarshal tools: %s", err)
	}
	return tools.ToolsetConfig{Name: name, ToolNames: raw["tools"]}, nil
}

func UnmarshalYAMLGroupConfig(ctx context.Context, name string, r map[string]any) (group.GroupConfig, error) {
	dec, err := util.NewStrictDecoder(r)
	if err != nil {
		return group.GroupConfig{}, fmt.Errorf("error creating decoder: %s", err)
	}
	gc := group.GroupConfig{Name: name}
	if err := dec.DecodeContext(ctx, &gc); err != nil {
		return group.GroupConfig{}, fmt.Errorf("unable to unmarshal group: %s", err)
	}
	// The default (nameless) group always contains all configured tools and
	// prompts, so it may only set a description.
	if name == "" && (len(gc.ToolNames) > 0 || len(gc.PromptNames) > 0) {
		return group.GroupConfig{}, fmt.Errorf("the default (nameless) group cannot declare 'tools' or 'prompts'; it always contains all configured tools and prompts")
	}
	return gc, nil
}

func UnmarshalYAMLPromptConfig(ctx context.Context, name string, r map[string]any) (prompts.PromptConfig, error) {
	// Look for the 'type' field. If it's not present, typeStr will be an
	// empty string, which prompts.DecodeConfig will correctly default to "custom".
	var resourceType string
	if typeVal, ok := r["type"]; ok {
		var isString bool
		resourceType, isString = typeVal.(string)
		if !isString {
			return nil, fmt.Errorf("invalid 'type' field for prompt %q (must be a string)", name)

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/config.go:570 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/c4b5fb418a71a097. Report an issue: GitHub.