Skip to main content
Glama

exec_modal_container

Execute a command inside a running Modal container using container ID and command list. Captures output with optional timeout.

Instructions

Execute a command inside a running Modal container (`modal container exec`).

Args:
    container_id: Container ID (e.g. "ta-123456"), from list_modal_containers.
    command: The command to run as a list of arguments,
        e.g. ["python", "-c", "print('hi')"] or ["ls", "-la", "/"].
    timeout_seconds: Max seconds to wait for the command before returning. Defaults to 60.

Returns:
    A dictionary with the command's captured output. `truncated` is True if the
    command was still running at the timeout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_idYes
commandYes
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description must disclose behavior. It explains that the command is executed, output is captured, and a timeout applies with a truncated flag. However, it does not mention error handling, state side effects, or prerequisites like the container must be running.

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 concise with a clear structure: one-line summary, parameter details with examples, and return value description. No unnecessary words or repetition.

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 3 simple parameters and an output schema, the description covers the core behavior (execution, output, timeout) and return format. It is sufficiently complete for an agent to use this tool correctly.

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?

Schema coverage is 0% (no descriptions in schema), so the description fully compensates. It explains container_id's source, gives examples for command format, and states the default for timeout_seconds. This adds significant meaning beyond the schema titles.

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?

Description clearly states the action: 'Execute a command inside a running Modal container', with a reference to the underlying CLI command. It distinguishes itself from sibling tools like list_modal_containers or stop_modal_container by specifying it runs a command inside a container.

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?

Description specifies when to use (executing commands) and links container_id to list_modal_containers. It does not explicitly state when not to use or contrast with alternatives like getting logs, but the purpose is clear enough for appropriate selection.

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/george-bobby/mcp-modal'

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