Skip to main content
Glama

Get agent run logs

get_agent_run_logs
Read-onlyIdempotent

Fetch a session's log content from one agent run. part=session is the agent stream-json (reasoning + tool calls); part=system is the container/runner stdout (clone, dependency install, validation gate, git, callback); part=prompt is the assembled input prompt. The role and sessionId are fields of the agent run's own record. A log longer than 40,000 characters returns its end, from a whole line, with a note.

Input Schema

NameRequiredDescriptionDefault
partNoWhich log stream to readsession
roleYesAgent role: planner | builder | reviewer | qa
sandboxIdYesAgent run id: the run's sandbox id
sessionIdYesSession id from get_agent_run's sessions list

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds genuinely non-obvious behavior beyond that: logs over 40,000 characters return the tail only, aligned to a whole line, with a note. That truncation contract is exactly the kind of operational detail an agent needs and cannot get from annotations.

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?

Four front-loaded sentences: purpose first, then stream semantics, then parameter provenance, then the truncation caveat. No filler sentences, though the parenthetical list of system-log stages is dense enough to slow reading slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates by explaining the payload of each part plus the truncation rule. What is missing is error behavior (e.g., log not yet available for a running or stopped run) and guidance on pairing with watch_agent_run, but otherwise an agent has enough to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description goes beyond the schema's one-line 'Which log stream to read' by explaining what each enum value actually contains (reasoning+tool calls vs clone/dependency-install/validation/git stdout vs assembled prompt), which is real added meaning for the only parameter that requires judgment.

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?

Specific verb+resource+scope: 'Fetch a session's log content from one agent run.' It then defines the three log streams (session=stream-json reasoning+tool calls, system=container/runner stdout, prompt=assembled input prompt), which cleanly separates it from get_agent_run (metadata), list_agent_runs, and get_sandbox_build_log. An agent can identify this tool without opening the schema.

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

Usage Guidelines3/5

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

It tells the agent that role and sessionId come from the agent run's own record, which implies a prerequisite call to get_agent_run, but it never names an alternative tool or states when to prefer this over list_agent_runs / get_agent_run / get_sandbox_build_log. Usage is implied rather than explicit, so it lands at the minimum-viable level.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.