Skip to main content
Glama

manage_groups

Read-only

List all groups or view packages in a specific group using unified group management actions.

Instructions

[ORGANIZATION] Unified group management tool. Actions: list_groups (all groups), list_packages_in_group (packages in specific group). Examples: manage_groups(action='list_groups'), manage_groups(action='list_packages_in_group', group_name='base-devel')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesOperation to perform
group_nameNoGroup name (required for list_packages_in_group)

Implementation Reference

  • Main handler function for the manage_groups tool. Dispatches to _list_groups() or _list_packages_in_group() based on the action argument.
    async def manage_groups(
        action: Literal["list_groups", "list_packages_in_group"],
        group_name: Optional[str] = None
    ) -> dict:
        """Unified group management tool."""
        if not IS_ARCH:
            return create_error_response("Requires Arch Linux", error_type="platform_error")
        
        if action == "list_groups":
            return await _list_groups()
        elif action == "list_packages_in_group":
            if not group_name:
                return create_error_response("group_name required", error_type="validation_error")
            return await _list_packages_in_group(group_name)
        else:
            return create_error_response(f"Unknown action: {action}")
  • MCP Tool registration with input schema defining 'action' (enum: list_groups, list_packages_in_group) and optional 'group_name'.
    # Package Groups
    Tool(
        name="manage_groups",
        description="[ORGANIZATION] Unified group management tool. Actions: list_groups (all groups), list_packages_in_group (packages in specific group). Examples: manage_groups(action='list_groups'), manage_groups(action='list_packages_in_group', group_name='base-devel')",
        inputSchema={
            "type": "object",
            "properties": {
                "action": {
                    "type": "string",
                    "enum": ["list_groups", "list_packages_in_group"],
                    "description": "Operation to perform"
                },
                "group_name": {
                    "type": "string",
                    "description": "Group name (required for list_packages_in_group)"
                }
            },
            "required": ["action"]
        },
        annotations=ToolAnnotations(readOnlyHint=True)
    ),
  • Tool call dispatcher in the MCP server that routes 'manage_groups' requests to the handler function.
    elif name == "manage_groups":
        if not IS_ARCH:
            return [TextContent(type="text", text=create_platform_error_message("manage_groups"))]
        
        action = arguments["action"]
        group_name = arguments.get("group_name", None)
        result = await manage_groups(action, group_name)
        return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Helper that runs 'pacman -Sg <group_name>' and parses output to return a list of packages in a specific group.
    async def _list_packages_in_group(group_name: str) -> dict:
        exit_code, stdout, stderr = await run_command(["pacman", "-Sg", group_name], timeout=10)
        if exit_code != 0:
            return create_error_response(f"Failed: {stderr}")
        packages = []
        for line in stdout.strip().split("\n"):
            if line.strip():
                parts = line.split()
                if len(parts) >= 2:
                    packages.append(parts[1])
        return {"action": "list_packages_in_group", "group": group_name, "total_packages": len(packages), "packages": packages}
  • Helper that runs 'pacman -Sg' and parses output to return a sorted list of all Arch Linux package groups.
    async def _list_groups() -> dict:
        exit_code, stdout, stderr = await run_command(["pacman", "-Sg"], timeout=10)
        if exit_code != 0:
            return create_error_response(f"Failed to list groups: {stderr}")
        groups = [line.strip() for line in stdout.strip().split("\n") if line.strip()]
        return {"action": "list_groups", "total_groups": len(groups), "groups": sorted(groups)}
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true, so the description does not need to repeat that. However, it also does not mention any behavioral traits such as result limits or error handling, which would add value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and includes examples, but the '[ORGANIZATION]' placeholder is distracting and reduces professionalism. Every sentence is functional, but there is room for improvement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with only two actions and one optional parameter. The description covers the basics, but does not explain return format, error behavior, or how the tool fits with siblings. Minimal viable for a list tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description repeats the enum values and provides an example, but does not add deeper meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies two clear actions (list_groups, list_packages_in_group) with concrete examples, but does not clarify that the tool is read-only despite its 'manage' title, and does not differentiate from sibling tools that also perform listing operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like search_archwiki or get_official_package_info. The examples show usage but not context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nihalxkumar/arch-linux-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server