googleapis/mcp-toolbox · error

invalid group name: %q

Error message

invalid group name: %q

What it means

Error "invalid group name: %q" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/group/group.go:66

	GroupConfig
	toolNameSet   map[string]struct{}
	promptNameSet map[string]struct{}
}

// GroupManager defines the minimal view of the primitives.PrimitiveManager
// that the Group package needs.
// This is implemented to prevent import cycles.
type GroupManager interface {
	GetSource(string) (sources.Source, bool)
	GetTool(string) (tools.Tool, bool)
}

// Initialize validates the group name and checks that every declared tool and
// prompt exists in the provided maps, building the membership sets used by
// ContainsTool and ContainsPrompt.
func (gc GroupConfig) Initialize(toolsMap map[string]tools.Tool, promptsMap map[string]prompts.Prompt) (Group, error) {
	if !tools.IsValidName(gc.Name) {
		return Group{}, fmt.Errorf("invalid group name: %q", gc.Name)
	}

	toolNameSet := make(map[string]struct{}, len(gc.ToolNames))
	for _, name := range gc.ToolNames {
		if _, ok := toolsMap[name]; !ok {
			return Group{}, fmt.Errorf("tool does not exist: %q", name)
		}
		toolNameSet[name] = struct{}{}
	}

	promptNameSet := make(map[string]struct{}, len(gc.PromptNames))
	for _, name := range gc.PromptNames {
		if _, ok := promptsMap[name]; !ok {
			return Group{}, fmt.Errorf("prompt does not exist: %q", name)
		}
		promptNameSet[name] = struct{}{}
	}

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/group/group.go:66 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/664278eb51f3dcc3. Report an issue: GitHub.