Skip to main content
Glama

opencode_session_output

Read what an opencode session did, returning the final answer or a condensed tail of recent messages with controls for message count and output size.

Instructions

READ-ONLY. Read what an opencode session did. mode "last" = the final assistant answer; "tail" (default) = the last N messages condensed (assistant text, tool calls with truncated input / result; reasoning is dropped); "full" = like tail but all fetched messages. Output is cut to max_chars from the end.

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": "opencode_session_output"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYessession id (ses_...) from opencode_sessions
modeNolast | tail | full (default tail)
messagesNohow many recent messages to fetch (default 12, max 200)
max_charsNooutput size cap (default 6000, max 60000)
tool_charsNochars kept of each tool input / result (default 220)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and delivers: it declares READ-ONLY up front and discloses exactly what is lost (tool inputs/results truncated, reasoning dropped, output cut to max_chars from the end). It doesn't cover failure behavior for an unknown session id, which is the main remaining gap.

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?

Front-loads READ-ONLY, then purpose, then mode semantics, then truncation caveat, in roughly four sentences with no filler. Every sentence carries distinct 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?

With no output schema and no annotations, the description fully substitutes for both by describing the returned structure per mode and the truncation rules. Only edge-case behavior (invalid id, empty session) is unaddressed.

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 earns above that by expanding the opaque mode enum into concrete return shapes and clarifying the truncation direction ("from the end") for max_chars. The other three parameters are left to the schema.

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?

Names a specific verb and resource ("Read what an opencode session did") and enumerates the three output modes, so the agent knows exactly what comes back. It does not explicitly differentiate itself from look-alike siblings such as opencode_result or opencode_status, which keeps it from a 5.

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?

Effectively says when to pick each mode: "last" for the final answer, "tail" (the default) for a condensed recent view, "full" for everything fetched. It never states when to use this tool instead of a sibling like opencode_result, but the mode guidance is a clear use-case map.

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