Skip to main content
Glama

craftos_trace

Read-only

Returns runtime events, printed output, errors, screen update counts, stderr, and running status accumulated since the previous call for a session, helping diagnose unexpected program behavior.

Instructions

What happened since the last call, without screenshots: events the program was handed (keys, touches, chat, ...), everything it printed, errors (uncaught Lua errors and printError), how many screen updates occurred, engine stderr, and whether it is still running. Call it right after something unexpected to see why. Output is capped to the newest lines.

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": {
      "id": "<id>"
    },
    "name": "craftos_trace"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId returned by craftos_session_create.
resetNoDiscard what has accumulated and return nothing.
maxLinesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond readOnlyHint=true, the description discloses the non-obvious incremental-read semantics ('what happened since the last call'), that it is a snapshot of a moving buffer, that output is capped to the newest lines, and that reset discards accumulated state. These are behavioral traits an agent could not infer from schema or annotations and materially affect how the tool is called and re-called.

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?

The content list is long but each item is a distinct, useful category of diagnostic data, and the trailing 'Output is capped to the newest lines' earns its place by warning about truncation. Slightly dense as a single run-on enumeration, but front-loaded with the core action.

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, so the description must carry the return-value burden, and it does so comprehensively by listing every category of trace content plus the truncation rule. The remaining gap is that it does not describe the output's organization (grouped sections, line formats), which would help an agent parse results.

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?

The schema documents id and reset but leaves maxLines without a description; the description compensates by stating output is 'capped to the newest lines', which explains both the counting direction and the truncation behavior. 'Since the last call' also clarifies the stateful semantics of id/repeated calls better than the schema does.

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 names a specific resource and enumerates its exact contents: events handed to the program, printed output, uncaught Lua errors and printError, screen update count, engine stderr, and liveness. The phrase 'without screenshots' explicitly contrasts it with the screenshot sibling, so an agent can pick it without opening any 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?

'Call it right after something unexpected to see why' gives a concrete trigger condition for invocation. It stops short of naming explicit alternatives or exclusions beyond the implicit contrast with craftos_screenshot, so it is strong context but not a full when/when-not routing rule.

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