Skip to main content
Glama

OpenCode Sessions

opencode_sessions

Manage opencode AI coding sessions: list, retrieve transcripts, send messages, view diffs, search, export, rename, or delete sessions.

Instructions

Inspect and interact with opencode sessions: list, get, transcript, send, diff, grep, export, rename, or delete.

Return Format

{"success": bool, "message": str, "data": dict}

Examples

opencode_sessions(action="list", limit=50) opencode_sessions(action="messages", session_id="sess_01", limit=100) opencode_sessions(action="send", session_id="sess_01", message="continue") opencode_sessions(action="rename", session_id="sess_01", title="Refactor auth module") opencode_sessions(action="delete", session_id="sess_01", confirm=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoPage size (list/messages)
queryNoSearch query (required for grep)
titleNoNew title (required for rename)
actionYeslist: all sessions. get: one session. messages: transcript. send: message a session. diff: files changed. grep: search messages across sessions. export: render session as markdown/html. rename: set title (serve API, live UI). delete: permanently remove (confirm=True).
formatNoExport format: markdown or html (export)markdown
offsetNoPage offset (list)
confirmNoMust be True to delete (permanent)
messageNoMessage text (required for send)
session_idNoSession ID (required for get/messages/send/diff/export/rename/delete)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

The description only says 'Inspect and interact' and lists actions; it does not disclose that delete is permanent, requires confirmation, or that rename affects the live UI. The schema's action enum includes such notes, but the description itself omits these side effects. With annotations only providing readOnlyHint=false, the description leaves the agent under-equipped to understand destructive consequences, though the example does show confirm=True for delete.

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?

The description is well-structured: an opening purpose sentence, a Return Format block, and five concise examples. It front-loads the primary purpose and avoids unnecessary verbosity. The examples are tightly written, though the Return Format block is a minor extra.

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 tool with 9 actions and 9 parameters, the description provides a universal return shape and examples for common operations, but it does not elaborate on per-action edge cases or required parameter combinations beyond what the schema already specifies. The schema's action enum descriptions carry much of the detailed semantics, and the description is sufficient but not comprehensive.

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?

The input schema has 100% description coverage for all parameters, so the baseline is 3. The description's examples (e.g., action='rename' with session_id and title) illustrate parameter combinations but do not add meaning beyond the schema's per-parameter and per-action descriptions. It is helpful but not additive.

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?

The description states 'Inspect and interact with opencode sessions: list, get, transcript, send, diff, grep, export, rename, or delete' which clearly identifies the resource and enumerates specific actions. However, it does not explicitly contrast with sibling tools like opencode_list_sessions or opencode_send_message, so it lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides examples (e.g., opencode_sessions(action='send', session_id='sess_01', message='continue')) but gives no explicit guidance on when to use this multi-action tool versus the dedicated sibling tools. There is no 'use this when' or 'for single operations use the specific sibling' direction, leaving the agent to infer usage.

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