Skip to main content
Glama

Container info

container_info

Inspect container details by name or ID to view configuration, status, and runtime information for containerized applications managed through Podman.

Instructions

Inspect a container by name or ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containerYesContainer name or ID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:164-167 (handler)
    Handler function for container_info tool decorated with @mcp.tool for automatic registration and schema via Pydantic Field. Executes 'podman inspect' on the container.
    @mcp.tool(title="Container info", description="Inspect a container by name or ID.")
    def container_info(container: str = Field(..., description="Container name or ID")) -> str:
        result = run_podman(["inspect", container])
        return result["stdout"] if result["success"] else f"Error: {result['stderr']}"
  • Async class method handler for the container_info tool. Extracts container from args, runs 'podman inspect', returns result in dict format.
    async def container_info(self, args: Dict[str, Any]) -> Dict[str, Any]:
        container = args.get("container")
        result = run_podman(["inspect", container])
        return {"output": result["stdout"] if result["success"] else f"Error: {result['stderr']}"}
  • Explicit JSON schema for container_info tool input, defining required 'container' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "container": {
                "type": "string",
                "description": "Container name or ID"
            }
        },
        "required": ["container"]
    }
  • main_b.py:459-472 (registration)
    Registration dictionary mapping 'container_info' tool name to its handler 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,
    }
  • main_b.py:183-196 (registration)
    Tool object registration in the tools list including name, description, and schema for container_info.
    Tool(
        name="container_info",
        description="Inspect a container by name or ID",
        inputSchema={
            "type": "object",
            "properties": {
                "container": {
                    "type": "string",
                    "description": "Container name or ID"
                }
            },
            "required": ["container"]
        }
    ),
  • Helper function used by container_info to execute podman commands and handle output/errors.
    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. 'Inspect' implies a read-only operation, but it doesn't disclose whether this requires special permissions, what information is returned, or if there are rate limits. The description is too minimal for a mutation-heavy sibling context.

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 a single, efficient sentence with zero waste. It's appropriately sized for a simple tool and front-loaded with the core action, making it easy to parse quickly.

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 presence of an output schema (which handles return values) and high schema coverage, the description is minimally adequate. However, in a context with many sibling tools performing similar operations, it lacks differentiation and behavioral context that would help an agent choose correctly.

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%, with the parameter clearly documented as 'Container name or ID'. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, meeting the baseline for high schema coverage.

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 verb ('inspect') and resource ('container'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from siblings like 'container_stats' or 'container_logs', which also inspect containers but focus on specific aspects.

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 'container_stats' (for performance metrics) and 'container_logs' (for log output), there's no indication of what 'inspect' specifically provides or when it's preferred over other inspection tools.

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