list_group_packages
Display all packages within a specific Arch Linux package group such as 'base-devel' or 'gnome' to review available software components.
Instructions
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)The core handler function implementing the 'list_group_packages' tool. Executes 'pacman -Sg {group_name}' to list packages in the specified Arch Linux package group, parses the output, and returns structured results.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)}" )
- ToolMetadata definition providing schema-like information: category, platform requirements, permissions, workflow context, 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:21-38 (registration)Import statement in __init__.py that exposes list_group_packages as a top-level module function, enabling its registration and use in the MCP server.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, list_group_packages, list_explicit_packages, mark_as_explicit, mark_as_dependency, check_database_freshness )
- src/arch_ops_server/__init__.py:139-139 (registration)Inclusion in __all__ list, ensuring list_group_packages is exported when using 'from arch_ops_server import *'."list_group_packages",