googleapis/mcp-toolbox · error

group %q not found

Error message

group %q not found

What it means

`buildSkillContents` throws "group %q not found" when the `--group` flag passed to `skills-generate` names a group that does not exist in the initialized primitive manager. The lookup is `primitiveMgr.GetGroup(c.group)`; if no group with that exact key was built from the config, the command aborts. Group names are exact string keys from the `groupConfigMaps` in the config file.

Source

Thrown at cmd/internal/skills/command.go:299

func (c *skillsCmd) buildSkillContents(toolsMap map[string]tools.Tool, groupsMap map[string]group.Group) (map[string]skillContent, error) {
	primitiveMgr := primitives.NewPrimitiveManager(nil, nil, nil, toolsMap, nil, groupsMap)

	skillsToContents := make(map[string]skillContent)

	getToolsFromGroup := func(g group.Group) map[string]tools.Tool {
		groupTools := make(map[string]tools.Tool)
		for _, name := range g.ToolNames {
			if tool, ok := toolsMap[name]; ok {
				groupTools[name] = tool
			}
		}
		return groupTools
	}

	if c.group != "" {
		g, ok := primitiveMgr.GetGroup(c.group)
		if !ok {
			return nil, fmt.Errorf("group %q not found", c.group)
		}

		skillsToContents[c.name] = skillContent{tools: getToolsFromGroup(g), description: c.descriptionFor(g)}
		return skillsToContents, nil
	}

	if c.toolset != "" {
		g, ok := primitiveMgr.GetGroup(c.toolset)
		if !ok {
			return nil, fmt.Errorf("toolset %q not found", c.toolset)
		}

		skillsToContents[c.name] = skillContent{tools: getToolsFromGroup(g), description: c.description}
		return skillsToContents, nil
	}

	if len(groupsMap) <= 1 {
		// Default to all tools if no named group found. The default nameless

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. List groups in your config file (`groups:` section) and make sure `--group` matches a key exactly (case-sensitive)
  2. If you meant a toolset, use `--toolset` instead of `--group` (they are mutually exclusive flags)
  3. Confirm you pointed `--config-file`/`--prebuilt-config` at the file that actually defines the group
  4. Re-run initialization; if the wrapped init error (index 70) also appears, fix the group definition error first

Example fix

// before
toolbox skills-generate --group my_group --output-dir skills
// after (group key in config is "my-group")
toolbox skills-generate --group my-group --output-dir skills
Defensive patterns

Strategy: validation

Validate before calling

// Check the group exists in the config before invoking
b, _ := os.ReadFile(cfgPath)
var cfg struct { Groups map[string]yaml.Node `yaml:"groups"` }
_ = yaml.Unmarshal(b, &cfg)
if _, ok := cfg.Groups["my-group"]; !ok {
	return fmt.Errorf("group %q not defined in %s", "my-group", cfgPath)
}

Try / catch

if _, ok := primitiveMgr.GetGroup(name); !ok {
	// list available groups to aid the user
	return fmt.Errorf("group %q not found; available: %v", name, primitiveMgr.GroupNames())
}

Prevention

When it happens

Trigger: `toolbox skills-generate --group <name>` where `<name>` is not defined under the config's `groups:` section, or differs by case/typo from the defined group key; the group failed to initialize earlier so it never registered in the manager.

Common situations: Typo in the group name; passing a toolset name to `--group`; renaming a group in the config without updating scripts/CI that invoke skills-generate; the config file loaded differs from the one defining the group.

Related errors


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