Skip to main content
Glama

List images

list_images

Display available container images from Podman to manage your containerized applications and perform image-related operations.

Instructions

List container images.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoShow all images including intermediate

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main execution logic for the list_images tool: runs 'podman images --format json' with optional --all flag based on input args, returns stdout as JSON or error message.
    async def list_images(self, args: Dict[str, Any]) -> Dict[str, Any]:
        all_images = args.get("all", False)
        cmd_args = ["images", "--format", "json"]
        if all_images:
            cmd_args.append("--all")
        result = run_podman(cmd_args)
        return {"output": result["stdout"] if result["success"] else f"Error: {result['stderr']}"}
  • main.py:249-255 (handler)
    The tool handler decorated with @mcp.tool, including inline schema via Pydantic Field; executes 'podman images' similarly.
    @mcp.tool(title="List images", description="List container images.")
    def list_images(all: bool = Field(False, description="Show all images including intermediate")) -> str:
        args = ["images", "--format", "json"]
        if all:
            args.append("--all")
        result = run_podman(args)
        return result["stdout"] if result["success"] else f"Error: {result['stderr']}"
  • Explicit input schema registration for list_images tool in the tools list, defining optional 'all' boolean parameter.
    Tool(
        name="list_images",
        description="List container images",
        inputSchema={
            "type": "object",
            "properties": {
                "all": {
                    "type": "boolean",
                    "description": "Show all images including intermediate",
                    "default": False
                }
            }
        }
    ),
  • main_b.py:459-472 (registration)
    Registration of tool handlers mapping, linking 'list_images' string to the list_images method.
    tool_handlers = {
        "list_containers": self.list_containers,
        "container_info": self.container_info,
        "start_container": self.start_container,
        "stop_container": self.stop_container,
        "restart_container": self.restart_container,
        "container_logs": self.container_logs,
        "run_container": self.run_container,
        "remove_container": self.remove_container,
        "exec_container": self.exec_container,
        "list_images": self.list_images,
        "pull_image": self.pull_image,
        "container_stats": self.container_stats,
    }
  • Helper function used by list_images to execute podman commands and capture structured output.
    def run_podman(args: List[str]) -> Dict[str, Any]:
        """Run a podman command and capture output"""
        try:
            cmd = ["podman"] + args
            logger.info(f"Running command: {' '.join(cmd)}")
            result = subprocess.run(
                cmd,
                capture_output=True,
                text=True,
                timeout=30
            )
            return {
                "success": result.returncode == 0,
                "stdout": result.stdout.strip(),
                "stderr": result.stderr.strip(),
                "returncode": result.returncode,
            }
        except subprocess.TimeoutExpired:
            logger.error("Command timed out")
            return {"success": False, "stdout": "", "stderr": "Command timed out", "returncode": -1}
        except Exception as e:
            logger.error(f"Command error: {e}")
            return {"success": False, "stdout": "", "stderr": str(e), "returncode": -1}
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'List container images' implies a read-only operation but doesn't specify whether this requires permissions, how results are returned (e.g., pagination, format), or any rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is extremely concise with just three words, front-loading the essential purpose without any wasted text. Every word earns its place, making it efficient for quick understanding.

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?

Given the tool's low complexity (1 parameter, 100% schema coverage, output schema exists), the description is minimally adequate. However, with no annotations and multiple sibling tools, it lacks guidance on usage context and behavioral details, making it incomplete for optimal agent decision-making despite the structured support.

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 description coverage is 100%, so the schema fully documents the single parameter 'all'. The description adds no parameter information beyond what's in the schema, maintaining the baseline score of 3 since the schema does the heavy lifting for parameter documentation.

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 clearly states the action ('List') and resource ('container images'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_containers' or 'container_info', which would require specifying what makes listing images distinct from those other listing/info 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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_containers', 'container_info', and 'pull_image', there's no indication of when image listing is appropriate versus container listing or image pulling, leaving the agent without contextual usage direction.

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/kunwarmahen/podman-mcp-server'

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