Skip to main content
Glama

manage_modal_container

Destructive

Run commands inside or stop a running Modal container by providing its ID. Use 'exec' for remote command execution or 'stop' to terminate it.

Instructions

Act on one running container. Find IDs with
list_modal_resources(resource="containers").

Args:
    action: "exec" — run a command inside the container (`modal container exec`).
        This is arbitrary remote code execution: treat it like SSH, not a lookup.
        "stop" — terminate it (`modal container stop`); in-flight inputs are
        cancelled and rescheduled elsewhere.
    container_id: Container ID ("ta-..."). Unique across environments, so no `env`
        argument is needed (the CLI accepts none for these subcommands).
    command: For "exec": argv list, e.g. ["python", "-c", "print('hi')"] or
        ["ls", "-la", "/"].
    timeout_seconds: For "exec": max seconds to wait. Default 60.

Returns: exec → {output, returncode, truncated, output_capped}; stop → {message}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
commandNo
container_idYes
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.2

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, it discloses that stop cancels and reschedules in-flight inputs, that exec is equivalent to SSH, and that container IDs are environment-unique so no env arg is needed. This meaningfully surfaces risk and runtime behavior the agent could not infer from annotations alone.

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 front-loaded with what the tool does, then organized as Args/Returns. Every sentence adds value, including examples, defaults, and the SSH warning, with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two modes, four parameters, and meaningful destructive/execution risk, the description covers inputs, behavior, risks, ID discovery, and return shapes. The output schema is also available, but the description already explains exec and stop return structures.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description carries full parameter documentation: action values, container_id format ('ta-...'), command shape for exec, and timeout_seconds semantics with default. It fully compensates for the schema's bare property definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Act on one running container' and immediately enumerates the two concrete actions, 'exec' and 'stop', with exact CLI commands. This clearly distinguishes the tool from sibling app/volume/log tools by resource type and operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It tells the agent to discover container IDs via list_modal_resources(resource="containers"), and warns that exec is 'arbitrary remote code execution... not a lookup.' This is clear, practical guidance, though it doesn't explicitly contrast every sibling tool such as manage_modal_app or get_modal_logs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.