googleapis/mcp-toolbox · error

tool does not exist: %q

Error message

tool does not exist: %q

What it means

Error "tool does not exist: %q" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/group/group.go:72

// 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{}{}
	}

	return Group{GroupConfig: gc, toolNameSet: toolNameSet, promptNameSet: promptNameSet}, nil
}

// NewGroup builds a Group directly from its config, deriving the membership sets
// from the declared tool and prompt names. It skips the existence checks
// performed by GroupConfig.Initialize and is intended for tests and callers that

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/group/group.go:72 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/5e3895340b8f3901. Report an issue: GitHub.