list_group_packages
Retrieve all packages within a specified Arch Linux package group such as 'base-devel' or 'gnome' to manage system components and dependencies.
Instructions
[ORGANIZATION] List all packages in a specific group. Only works on Arch Linux.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_name | Yes | Name of the package group (e.g., 'base-devel', 'gnome') |
Implementation Reference
- src/arch_ops_server/pacman.py:987-1046 (handler)Core handler function that executes pacman -Sg command, parses the output, handles errors, and returns structured dict with group name, package count, and list of packages.async def list_group_packages(group_name: str) -> Dict[str, Any]: """ List packages in a specific group. Args: group_name: Name of the group Returns: Dict with packages in the group """ 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(f"Listing packages in group: {group_name}") try: exit_code, stdout, stderr = await run_command( ["pacman", "-Sg", group_name], timeout=10, check=False ) if exit_code != 0: return create_error_response( "NotFound", f"Group not found: {group_name}" ) # Parse output - format: "group package" packages = [] for line in stdout.strip().split('\n'): if line.strip(): parts = line.split() if len(parts) >= 2: packages.append(parts[1]) logger.info(f"Found {len(packages)} packages in {group_name}") return { "group": group_name, "package_count": len(packages), "packages": packages } except Exception as e: logger.error(f"Failed to list group packages: {e}") return create_error_response( "CommandError", f"Failed to list packages in group: {str(e)}" )
- src/arch_ops_server/server.py:840-853 (registration)MCP tool registration in list_tools(): defines tool name, description, input schema requiring 'group_name' string.Tool( name="list_group_packages", description="[ORGANIZATION] List all packages in a specific group. Only works on Arch Linux.", inputSchema={ "type": "object", "properties": { "group_name": { "type": "string", "description": "Name of the package group (e.g., 'base-devel', 'gnome')" } }, "required": ["group_name"] } ),
- src/arch_ops_server/server.py:1300-1307 (registration)Tool execution dispatcher in call_tool(): checks platform, extracts group_name argument, calls handler, returns JSON result.elif name == "list_group_packages": if not IS_ARCH: return [TextContent(type="text", text="Error: list_group_packages only available on Arch Linux systems")] group_name = arguments["group_name"] result = await list_group_packages(group_name) return [TextContent(type="text", text=json.dumps(result, indent=2))]
- Tool metadata defining category, platform requirements, permissions, workflow, and related/prerequisite tools."list_group_packages": ToolMetadata( name="list_group_packages", category="organization", platform="arch", permission="read", workflow="explore", related_tools=["list_package_groups"], prerequisite_tools=["list_package_groups"] ),
- src/arch_ops_server/__init__.py:139-139 (registration)Exported in __all__ list for import convenience."list_group_packages",