Skip to main content
Glama

get_modal_logs

Read-onlyIdempotent

Fetch Modal app or container logs from stdout, stderr, and system streams to inspect runtime output and troubleshoot issues.

Instructions

Fetch logs for an app or container (`modal app logs` / `modal container logs`).
To find where something went wrong, prefer search_modal_logs — it returns matches
with surrounding context instead of a raw tail.

Covers the stdout/stderr/system streams ONLY. Crash events shown on the Modal
dashboard (e.g. "... exited with ...") are not log lines and never appear here.

Args:
    identifier: App name/ID ("my-app", "ap-...") or container ID ("ta-...").
    target: "auto" (default — "ta-..." is a container), "app", or "container".
    timeout_seconds: Max seconds to collect. Default 30.
    env: Modal environment. Apps only — container logs take no environment.
    since / until: Time range, ISO 8601 or relative ("2h", "30m", "1d"). Max 35 days.
        `since` without `tail` fetches EVERY entry in the range — pass `until` too
        (or a `tail`) to bound the volume on a busy app.
    tail: Only the last N entries (max 20000).
    source: "stdout", "stderr", or "system".
    timestamps: Prefix each line with its wall-clock timestamp.
    follow: Live-stream until the app/container stops or the timeout hits.
    profile: Modal profile for this call only. Defaults to the active profile.

Returns: {logs, truncated (still streaming at the timeout), output_capped (text
trimmed to fit context — narrow with tail/since/source)}.

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": {
      "identifier": "<identifier>"
    },
    "name": "get_modal_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
tailNo
sinceNo
untilNo
followNo
sourceNo
targetNoauto
profileNo
identifierYes
timestampsNo
timeout_secondsNo

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. Addedv0.2.2

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial behavior on top: the exact stream coverage (stdout/stderr/system only, excluding crash events), that `follow` streams until stop or timeout, that timeout truncation is signaled via `truncated`, and that text may be trimmed (`output_capped`). It also warns that `since` without `tail` pulls every entry in the range.

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?

Front-loaded with purpose and the sibling alternative, then a clean Args block with a Returns line; nearly every sentence carries information. It is on the long side for a log fetch, and the source-stream enumeration slightly overlaps between the intro and the `source` arg, but no line is padding.

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?

An 11-parameter tool with no schema descriptions and an output schema is fully covered: input formats, defaults, caps, cross-parameter interactions (since+tail, env+container), and the meaning of the returned flags are all present. Nothing an agent needs to call this correctly is missing.

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 does: all 11 parameters are explained with accepted formats and limits — identifier forms ('my-app', 'ap-...', 'ta-...'), `target` auto-detection rules, relative time syntax ('2h', '30m', '1d') with a 35-day cap, tail max 20000, and the constraint that `env` applies to apps only.

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?

Opens with a specific verb and resource (fetch logs) mapped to the CLI equivalents `modal app logs` / `modal container logs`, and immediately distinguishes itself from search_modal_logs. An agent can tell the two apart 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?

Explicitly routes the agent: 'To find where something went wrong, prefer search_modal_logs' because it returns matches with context rather than a raw tail. It also states a hard scope exclusion — crash/dashboard events never appear here — so the agent knows when this tool will return nothing useful.

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