Skip to main content
Glama

Read a command's stored output

get_command_logs
Read-onlyIdempotent

Read a command's stored stdout or stderr from a byte offset in 1 MiB chunks and continue with nextOffset until done, including while the sandbox is stopped.

Instructions

Read a command's stored output. Reads stdout or stderr from a byte offset, at most 1 MiB per call. Read on with nextOffset until done. A running detached command gains output every 30 s; a streamed one every 2 s. Works while the sandbox is stopped.

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": {
      "sandboxId": "<sandboxId>",
      "commandId": "<commandId>"
    },
    "name": "get_command_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
offsetNo
streamNostdout
encodingNobase64 returns the exact bytes. utf8 can split a character at the edge of a read.utf8
commandIdYes
sandboxIdYesPublic Sandbox id returned by create/list/get sandbox calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, and the description adds real operational detail on top: a 1 MiB per-call ceiling, refresh cadence for detached (30 s) vs streamed (2 s) commands, and availability while the sandbox is stopped. It also describes the `nextOffset`/`done` return fields, which matter since there is no output schema, but says nothing about error/empty-result behavior.

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?

Four short sentences, front-loaded with the core action, then pagination, then timing, then availability. No filler and each sentence carries distinct operational information.

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?

For a 6-parameter read tool with no output schema, the definition covers the essential call pattern (byte offsets, chunk size, continuation, cadence, availability while stopped). Minor gaps remain around error conditions and whether logs survive sandbox deletion, but an agent has enough to invoke it correctly.

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

Parameters3/5

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

Schema coverage is only 33%, so the description must carry more weight; it does add meaning for `offset` (byte offset, continue via nextOffset), `limit` (1 MiB cap), and `stream` (stdout/stderr). It leaves `encoding` and the two required ids unexplained, and the use of `nextOffset` alongside an `offset` parameter risks confusing the agent about which field drives continuation.

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 ('Read a command's stored output') and immediately narrows it to stdout/stderr byte-range reads, which separates it from get_command and get_command_status without the agent needing to open a schema.

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?

Gives concrete usage context: read on with `nextOffset` until `done`, and it works while the sandbox is stopped. It does not name when to prefer a sibling (e.g. get_command for metadata) or when reading is not appropriate, so the alternative routing is left implicit.

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