Skip to main content
Glama

opencode_get_history

Retrieve the complete message history for a coding session, including roles, content, and timestamps, to review prior exchanges before continuing.

Instructions

Return the full message history for an opencode session (tracked in-process).

Each message has: role (user/assistant), content, timestamp. Use this to review what has been sent and received before sending the next message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesSession ID to retrieve history for.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations, the description carries the burden. It discloses the 'tracked in-process' nature and describes the message fields (role, content, timestamp). However, it does not mention behavior for invalid/missing session_id, ordering of messages, or potential errors. For a read-only tool this is acceptable but not fully transparent.

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 two concise sentences, front-loaded with the core purpose. The second sentence adds the message structure and a usage hint without unnecessary detail. Every sentence is useful.

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?

The tool is simple (one parameter), has an output schema (so return format is covered elsewhere), and the description provides the essential message structure and a practical usage cue. It does not explain the ordering of history or error cases, but this is not critical given the output schema and straightforward nature.

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?

Input schema has 100% coverage; the only parameter session_id is described as 'Session ID to retrieve history for.' The description does not add further parameter-specific semantics, but the schema is sufficient, so a baseline of 3 is appropriate.

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 clearly states 'Return the full message history for an opencode session', specifying the verb (return), resource (message history), and scope (per session). It distinguishes from siblings like opencode_list_sessions (which lists sessions) and opencode_send_message (which sends), by focusing on retrieving history.

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?

It provides clear usage context: 'Use this to review what has been sent and received before sending the next message.' This implies the tool is for reviewing prior conversation context. It does not explicitly name alternatives, but the context is clear and sufficient for an AI agent to decide when to call this versus other opencode tools.

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/h19overflow/polycode'

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