Skip to main content
Glama

opencode_message

Read an OpenCode session's conversation history to review the agent's reasoning, tool calls, and code changes after a prompt completes, or fetch a specific message before accepting changes.

Instructions

Read the conversation history from an OpenCode session. Use 'list' AFTER a prompt completes to see what the agent did — its reasoning, tool calls, and code changes. Use 'get' for a specific message. Essential for reviewing the agent's work before accepting changes.

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": {
      "action": "<action>",
      "sessionId": "<sessionId>"
    },
    "name": "opencode_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax messages to return (list only)
actionYes
messageIdNoMessage ID (required for get)
sessionIdYesSession ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses what the output contains (reasoning, tool calls, code changes) and that 'list' only makes sense after a prompt completes, but says nothing about authorization, whether history is paginated or truncated, or what happens on a bad sessionId/messageId.

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 short sentences, front-loaded with what it does and then the action-specific instructions. The final sentence ('Essential for reviewing the agent's work...') is partly promotional but does add a legitimate motivating use case, so little is wasted.

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

Completeness3/5

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

For a simple read tool with no output schema and only four parameters, the description covers modes and output content reasonably. It omits where sessionId comes from (presumably a sibling session tool), how much history is returned by default, and any error/empty-result behavior, leaving the agent to infer the surrounding workflow.

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 already 75%, with limit and messageId documented inline, so the schema does most of the work. The description adds genuine value by explaining the semantic difference between the 'list' and 'get' action values, but nothing about messageId scoping or limit defaults beyond 'list only'.

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?

States a specific verb and resource: 'Read the conversation history from an OpenCode session', and splits the tool's two modes explicitly ('list' vs 'get'). An agent can immediately tell this is for inspecting agent transcripts rather than managing sessions or files, though it never names a sibling tool to sharpen the boundary.

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 timing and selection guidance: use 'list' AFTER a prompt completes, use 'get' for a specific message, and use it when reviewing the agent's work before accepting changes. It lacks explicit when-not guidance or a named alternative for adjacent needs (e.g. managing session state), but the positive guidance is unusually clear.

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