Skip to main content
Glama

list_package_groups

Lists available package groups like base, base-devel, and gnome for Arch Linux system management and configuration.

Instructions

[ORGANIZATION] List all available package groups (e.g., base, base-devel, gnome). Only works on Arch Linux.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes `pacman -Sg` to list all package groups, parses the output to extract unique group names, sorts them, and returns a structured dictionary with count and list of groups. Handles Arch-only availability, command existence checks, and errors.
    async def list_package_groups() -> Dict[str, Any]: """ List all available package groups. Returns: Dict with list of groups """ if not IS_ARCH: return create_error_response( "NotSupported", "Package groups are only available on Arch Linux" ) if not check_command_exists("pacman"): return create_error_response( "CommandNotFound", "pacman command not found" ) logger.info("Listing package groups") try: exit_code, stdout, stderr = await run_command( ["pacman", "-Sg"], timeout=10, check=False ) if exit_code != 0: return create_error_response( "CommandError", f"Failed to list groups: {stderr}" ) # Parse output - format: "group package" groups = set() for line in stdout.strip().split('\n'): if line.strip(): parts = line.split() if parts: groups.add(parts[0]) groups_list = sorted(list(groups)) logger.info(f"Found {len(groups_list)} package groups") return { "group_count": len(groups_list), "groups": groups_list } except Exception as e: logger.error(f"Failed to list groups: {e}") return create_error_response( "CommandError", f"Failed to list package groups: {str(e)}" )
  • JSON schema definition for the tool in the MCP server registration. No input parameters required; returns package groups list.
    Tool( name="list_package_groups", description="[ORGANIZATION] List all available package groups (e.g., base, base-devel, gnome). Only works on Arch Linux.", inputSchema={ "type": "object", "properties": {} } ),
  • Tool dispatch/registration in the central @server.call_tool() handler that imports and invokes the pacman.list_package_groups function when called by MCP client.
    elif name == "list_package_groups": if not IS_ARCH: return [TextContent(type="text", text="Error: list_package_groups only available on Arch Linux systems")] result = await list_package_groups() return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Tool metadata defining category (organization), platform (arch), permission (read), workflow (explore), and relationships to other tools like list_group_packages.
    "list_package_groups": ToolMetadata( name="list_package_groups", category="organization", platform="arch", permission="read", workflow="explore", related_tools=["list_group_packages"], prerequisite_tools=[]
  • Import registration of the handler function into the arch_ops_server package namespace, making it available for server.py to use.
    from .pacman import ( get_official_package_info, check_updates_dry_run, remove_package, remove_packages_batch, list_orphan_packages, remove_orphans, find_package_owner, list_package_files, search_package_files, verify_package_integrity, list_package_groups,

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-mcp'

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