get_modal_logs
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
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| tail | No | ||
| since | No | ||
| until | No | ||
| follow | No | ||
| source | No | ||
| target | No | auto | |
| profile | No | ||
| identifier | Yes | ||
| timestamps | No | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |