Skip to main content
Glama

List the command and process history

list_command_history
Read-onlyIdempotent

Retrieve a sandbox's command and process history—recent commands plus processes that wrote output—to audit activity or debug failures, even while the sandbox is stopped.

Instructions

List the command and process history. Every command run through POST /sandboxes/{sandboxId}/commands in the last 7 days, and every other process that wrote to its stdout/stderr in the last 72 hours (mode process), newest first. 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>"
    },
    "name": "list_command_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoOnly commands whose command line contains this text, in any case.
modeNoOnly these modes, comma-separated: sync, stream, detached, process, or `commands` for the first three. Default: all.
limitNo
cursorNoThe `nextCursor` of the previous page.
sandboxIdYesPublic Sandbox id returned by create/list/get sandbox calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the description's value is in the operational details it adds: two distinct retention windows (7 days for API-launched commands, 72 hours for other processes), newest-first ordering, and the fact that it remains callable while the sandbox is stopped. It does not describe pagination behavior, though the cursor parameter implies it.

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?

Three sentences, each carrying distinct information: purpose, the two retention windows with their qualifying conditions, and the stopped-sandbox capability. The core scope is front-loaded and there is no filler or repetition of the title.

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?

With no output schema and a well-documented 5-parameter schema, the description covers what an agent needs to select and call the tool correctly, including the retention asymmetry that affects interpretation of results. The only gap is that nothing signals paginated results beyond the bare cursor parameter.

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 80%, which puts the baseline at 3. The description does add real meaning for mode `process` — spelling out that it means non-API processes that wrote to stdout/stderr within 72 hours — which the schema only gestures at via an example value. The remaining parameters (q, limit, cursor) are already well documented in the schema, so no further lift is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('List the command and process history') and immediately narrows scope: commands from the last 7 days via POST /sandboxes/{sandboxId}/commands, plus other processes that wrote to stdout/stderr in the last 72 hours. This is enough to separate it from point-lookup siblings like get_command or get_command_logs. It stops short of naming an explicit alternative, so a 5 is not warranted.

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?

Usage is implied rather than stated: the historical, time-bounded framing suggests 'use this to survey past activity, not fetch one command.' There is no explicit when-not guidance or named alternative (e.g. use get_command_logs for a single command's output). The note 'Works while the sandbox is stopped' is a useful eligibility condition but not a use-case rule.

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