Skip to main content
Glama

mark_as_explicit

Prevent package removal as an orphan on Arch Linux by marking it as explicitly installed.

Instructions

[MAINTENANCE] Mark a package as explicitly installed. Prevents it from being removed as an orphan. Only works on Arch Linux.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
package_nameYesName of the package to mark as explicit

Implementation Reference

  • The core handler function that executes `sudo pacman -D --asexplicit` to mark the specified package as explicitly installed, with error handling and status response.
    async def mark_as_explicit(package_name: str) -> Dict[str, Any]: """ Mark a package as explicitly installed. Args: package_name: Name of package to mark Returns: Dict with operation status """ if not IS_ARCH: return create_error_response( "NotSupported", "Package marking is only available on Arch Linux" ) if not check_command_exists("pacman"): return create_error_response( "CommandNotFound", "pacman command not found" ) logger.info(f"Marking {package_name} as explicitly installed") try: exit_code, stdout, stderr = await run_command( ["sudo", "pacman", "-D", "--asexplicit", package_name], timeout=10, check=False, skip_sudo_check=True ) if exit_code != 0: return create_error_response( "CommandError", f"Failed to mark package as explicit: {stderr}" ) logger.info(f"Successfully marked {package_name} as explicit") return { "success": True, "package": package_name, "marked_as": "explicit" } except Exception as e: logger.error(f"Failed to mark package: {e}") return create_error_response( "CommandError", f"Failed to mark package as explicit: {str(e)}" )
  • MCP tool schema definition in list_tools(), specifying input validation: requires 'package_name' string.
    Tool( name="mark_as_explicit", description="[MAINTENANCE] Mark a package as explicitly installed. Prevents it from being removed as an orphan. Only works on Arch Linux.", inputSchema={ "type": "object", "properties": { "package_name": { "type": "string", "description": "Name of the package to mark as explicit" } }, "required": ["package_name"] } ),
  • Tool dispatcher in call_tool() that invokes the mark_as_explicit handler with arguments and formats response.
    elif name == "mark_as_explicit": if not IS_ARCH: return [TextContent(type="text", text="Error: mark_as_explicit only available on Arch Linux systems")] package_name = arguments["package_name"] result = await mark_as_explicit(package_name) return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Tool metadata defining category, platform, permissions, related tools, and workflow for mark_as_explicit.
    "mark_as_explicit": ToolMetadata( name="mark_as_explicit", category="maintenance", platform="arch", permission="write", workflow="organize", related_tools=["list_explicit_packages", "list_orphan_packages"], prerequisite_tools=[] ),
  • Import registration of mark_as_explicit from pacman.py for re-export to server.py.
    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

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