Skip to main content
Glama

opencode_session_fork

Destructive

Fork an existing coding session, optionally at a specific message, to branch the conversation for parallel or alternative development paths.

Instructions

Fork an existing session, optionally at a specific message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSession ID to fork
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.
messageIDNoMessage ID to fork at (optional)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
textYes
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already mark this as destructive and non-read-only, but the description adds no behavioral context beyond that. It does not state whether the original session is modified, whether a new session is created, or what side effects a fork has. With destructiveHint=true, this is a notable gap.

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?

A single compact sentence that front-loads the core purpose and mentions the key optional behavior. No filler or redundant wording.

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?

The output schema and fully described parameters reduce the need for return-value explanation. However, given destructiveHint=true and idempotentHint=false, the description should clarify preservation of the original session or the meaning of the destructive flag. It is minimally adequate but not fully self-sufficient.

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 description coverage is 100%, so the schema already documents all three parameters. The description only echoes the optional messageID concept and adds no extra format, constraints, or relationships among id, directory, and messageID.

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 clearly states the action ('Fork'), the resource ('existing session'), and the optional fork point ('at a specific message'). It is understandable and distinct from session_create and session_revert, though it does not explicitly name those sibling alternatives.

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?

There is no guidance on when to use fork versus create, revert, or other session operations. The only implied context is 'existing session', which is too thin to help an agent decide between alternatives.

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

Deploy Server

Other Tools