Skip to main content
Glama

Start container

start_container

Start a stopped container to resume its operations. Specify the container name or ID to initiate the container lifecycle process.

Instructions

Start a stopped container.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containerYesContainer name or ID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'start_container' tool. It extracts the container name from arguments, runs 'podman start' via the run_podman helper, and returns a success or error message.
    async def start_container(self, args: Dict[str, Any]) -> Dict[str, Any]:
        container = args.get("container")
        result = run_podman(["start", container])
        return {"output": f"Started container: {container}" if result["success"] else f"Error: {result['stderr']}"}
  • JSON schema definition for the 'start_container' tool input, specifying the required 'container' string parameter.
    Tool(
        name="start_container",
        description="Start a stopped container",
        inputSchema={
            "type": "object",
            "properties": {
                "container": {
                    "type": "string",
                    "description": "Container name or ID"
                }
            },
            "required": ["container"]
        }
    ),
  • main_b.py:459-472 (registration)
    Registration of tool handlers in a dictionary used in handle_tools_call to map 'start_container' 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.py:170-173 (handler)
    Alternative handler for 'start_container' using FastMCP decorator, which also serves as registration and schema via Pydantic Field.
    @mcp.tool(title="Start container", description="Start a stopped container.")
    def start_container(container: str = Field(..., description="Container name or ID")) -> str:
        result = run_podman(["start", container])
        return f"Started container: {container}" if result["success"] else f"Error: {result['stderr']}"
  • Shared helper function that executes podman subprocess commands and returns structured results, used by the start_container handler.
    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?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Start a stopped container' implies a state-changing operation, it doesn't disclose important behavioral traits: whether this requires specific permissions, what happens if the container fails to start, whether it returns status information, or any rate limits. For a mutation tool with zero annotation coverage, this is inadequate.

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 perfectly concise at 4 words, front-loading the essential action and target. Every word earns its place with zero waste. This is an excellent example of efficient communication for a simple tool.

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 moderate complexity (state-changing operation), no annotations, but with complete input schema coverage and an output schema present, the description is minimally adequate. The output schema existence means the description needn't explain return values, but for a mutation tool among many siblings, it should provide more context about usage scenarios and behavioral expectations.

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?

The input schema has 100% description coverage, with the single parameter 'container' clearly documented as 'Container name or ID'. The description adds no additional parameter information beyond what the schema provides. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in description.

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 ('Start') and target resource ('a stopped container'), making the tool's purpose immediately understandable. It distinguishes from siblings like 'restart_container' (which implies container is already running) and 'run_container' (which likely creates and starts a new container). However, it doesn't explicitly mention these distinctions, keeping it at a 4 rather than a 5.

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. It doesn't mention prerequisites (container must be stopped), exclusions (cannot start already running containers), or when to choose 'restart_container' instead. With 11 sibling tools including closely related ones like 'restart_container' and 'stop_container', this lack of differentiation is a significant gap.

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