Skip to main content
Glama

get_modal_app_logs

Fetch logs for a Modal app by name or ID. Supports filtering by time range, source, search text, and live-streaming with follow mode.

Instructions

Fetch logs for a Modal app by name or app ID (`modal app logs`).

By default the CLI fetches recent entries and exits. Pass `follow=True` to live-stream
(collected for up to `timeout_seconds`, then cut off as a snapshot). Use list_modal_apps
to discover the app name/ID.

Args:
    app_identifier: App name (e.g. "my-app") or app ID (e.g. "ap-123456").
    timeout_seconds: Max seconds to collect logs before returning. Defaults to 30.
    env: Optional Modal environment to target.
    since: Start of time range — ISO 8601 datetime or relative time like "2h", "30m", "1d".
    until: End of time range (same formats as `since`).
    tail: Show only the last N log entries.
    search: Only include log lines matching this search text.
    source: Filter by source: "stdout", "stderr", or "system".
    follow: If True, live-stream logs until the app stops or the timeout is reached.

Returns:
    A dictionary with the collected logs. `truncated` is True when the stream was still
    active at the timeout (i.e. logs are a partial snapshot).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_identifierYes
timeout_secondsNo
envNo
sinceNo
untilNo
tailNo
searchNo
sourceNo
followNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description bears full responsibility. It describes the follow behavior, timeout snapshot, and return value truncated flag. However, it could be more explicit about read-only nature and potential rate limits.

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 well-structured with a concise summary followed by a clear parameter list and return explanation. Every sentence is informative and earns its place.

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?

Given 9 parameters, no annotations, and an output schema present, the description covers all aspects: parameter usage, default behavior, live-streaming, time range formatting, filtering, and return format with truncated flag. It is complete for the task.

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?

Despite 0% schema description coverage, the description's docstring explains every parameter in detail (format, defaults, examples). This adds substantial meaning beyond the schema's property names.

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 clearly states 'Fetch logs for a Modal app by name or app ID' and references the CLI command. It distinguishes itself from siblings (e.g., get_modal_container_logs) by focusing on app logs.

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?

The description explains default behavior (recent entries and exits), when to use follow=True (live-stream), and suggests list_modal_apps to discover names. It does not explicitly state when not to use this tool or mention alternatives like search_modal_logs, but the context is clear enough.

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