Skip to main content
Glama

opencode_get_messages

Read-onlyIdempotent

Retrieve message history from an opencode session.

Instructions

Retrieve message history from an opencode session.

Returns the conversation transcript between the user and the agent.

Return Format

{"success": bool, "message": str, "data": {"messages": [{"role": str}]}}

Examples

opencode_get_messages(session_id="sess_01", limit=100)

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of messages to retrieve
session_idYesSession ID to retrieve messages from

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.11
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. First observedv0.2.3

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds genuinely new context by disclosing the response envelope shape, which matters because no output schema exists. It stops short of explaining ordering, pagination, or what happens when limit truncates history.

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?

Purpose is front-loaded in the first sentence, followed by return format and a single example — a sensible order with little waste. The return-format block is abbreviated ('{"role": str}' only) and slightly padded relative to its information content.

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 two-parameter read-only tool with full schema coverage and annotations, the description covers purpose, response envelope, and a usage example. Remaining gaps — message ordering and truncation semantics for limit — are modest but real for an agent interpreting the transcript.

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 100% and both parameters are documented in the schema, so the baseline is 3. The example adds a concrete session_id format hint ('sess_01'), but no additional semantics for limit behavior (e.g., newest-first truncation) are supplied.

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 ('Retrieve message history from an opencode session') and clarifies the payload ('conversation transcript between the user and the agent'). It does not explicitly contrast with siblings like opencode_get_session or opencode_send_message, so an agent must infer the boundary itself.

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 only implied by the phrase 'retrieve message history'; there is no statement of when to prefer this over opencode_get_session, opencode_list_sessions, or opencode_session_diff. The example shows a plausible call but not a decision rule.

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