Skip to main content
Glama

opencode_get_messages

Read-onlyIdempotent

Retrieve message history from opencode sessions to access full conversation transcripts between user and agent.

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

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/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 the return format (success/message/data wrapper) and an example call, but it does not disclose error handling, pagination behavior, or what happens if the session does not exist. This is added value but not extensive behavioral context.

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?

The description is concise and well-structured, starting with a clear purpose, then a brief return format section, and a simple example. No wasted words or redundant elaboration.

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 simple read-only tool with two parameters and an output schema, the description covers the purpose, return format, and a usage example. It lacks edge-case discussion but is otherwise complete for typical usage, making it slightly above minimum viability.

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 descriptions cover both session_id and limit (including default), with 100% schema coverage. The description includes an example using both parameters but does not add semantic details beyond what the schema already documents. Baseline 3 applies.

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 states 'Retrieve message history from an opencode session' with a specific verb and resource, and further clarifies it returns the conversation transcript. This clearly distinguishes it from sibling tools like opencode_get_session (session metadata) and opencode_send_message (sending messages).

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?

The description implies usage for retrieving conversation transcripts but does not explicitly state when to use this tool versus alternatives or mention exclusions. It's clear context but lacks direct comparison to siblings like opencode_get_session or opencode_list_sessions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sandraschi/opencode-cli-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server