Skip to main content
Glama

run_modal_app

Executes a Modal function or local entrypoint once and collects its output, URLs, and truncation status for testing on Modal compute before publishing.

Instructions

Run a Modal function or local entrypoint once and collect its output (`modal run`).
Use this to test on Modal compute; use deploy_modal_app to publish.

Args:
    absolute_path_to_app: Absolute path to the app file. Its directory must use `uv`
        and have `modal` installed in its virtualenv.
    function_name: Function/entrypoint name, e.g. "main". Omit if the module has
        exactly one.
    env: Modal environment to target.
    detach: Keep the run alive on Modal past this call (`--detach`) — for long jobs.
    timeout_seconds: Max seconds to collect output. Default 120.
    profile: Modal profile for this call only. Defaults to the active profile.

Returns: {output, urls, truncated (still running at the timeout), output_capped}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "absolute_path_to_app": "<absolute_path_to_app>"
    },
    "name": "run_modal_app"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
detachNo
profileNo
function_nameNo
timeout_secondsNo
absolute_path_to_appYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.1
    • addedInput schema / properties / profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Profile"
      +}
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false, so the safety profile is covered. The description adds real context beyond that: the uv/modal virtualenv prerequisite, the 120s default collection timeout, that detach keeps the run alive past the call, and that output may be truncated or capped. It stops short of describing failure modes or what happens to a detached run's logs, keeping it at a 4.

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

Conciseness4/5

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

The purpose and the sibling routing are front-loaded in the first two sentences, followed by a scannable Args block and a Returns line. The docstring-style layout is efficient, though the Args block is somewhat boilerplate and could be trimmed slightly.

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 six-parameter execution tool with an output schema present, the definition covers prerequisites, per-parameter meaning, timeout/truncation behavior, and the return shape summary. An agent has everything needed to invoke it correctly and interpret the result.

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 description coverage is 0%, so the description carries the full burden, and it does: every one of the six parameters is explained with meaning beyond its name (absolute path plus uv/modal requirement, function_name example and omission rule, env target, detach semantics, timeout default, profile defaulting to active). This fully compensates for the empty schema descriptions.

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?

States a specific verb and resource ('Run a Modal function or local entrypoint once and collect its output') and maps it to the underlying CLI command (`modal run`). It also explicitly contrasts itself with deploy_modal_app, so an agent can distinguish it from the closest sibling without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit when-to-use ('test on Modal compute') and names the alternative with its condition ('use deploy_modal_app to publish'). The detach parameter guidance ('for long jobs') further clarifies the boundary between a one-shot test and a persistent run.

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