Skip to main content
Glama

OpenCode Reply

opencode-reply
Destructive

Continue an existing OpenCode session by sending a new prompt with its session ID, then block until the turn completes and return the answer.

Instructions

Use this to continue an existing OpenCode session started with opencode, after reading its previous result from structuredContent.content. Requires exactly one of sessionId, threadId or conversationId, plus a new prompt. Blocks until the turn finishes (or wait-seconds elapses, up to the turn timeout); the answer is in structuredContent.content. sandbox and approval-policy stay fixed for the life of the session. Cancelling or stopping the call that OWNS this turn (Esc, TaskStop, a client timeout) cancels the OpenCode turn; a call that only joined an existing turn as an observer (e.g. a duplicate request-id) detaches without cancelling anything. To stop waiting but keep the turn running, pass wait-seconds and poll opencode-status. Same detail/max-output-chars/request-id/output-schema options as opencode; output-schema applies only to this turn, never a stored default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNoOpenCode's primary agent for this session (e.g. 'build', 'plan', or a custom agent). Omit to use the server-configured default, or OpenCode's own default agent. Given here, it replaces the stored value for this and later turns.
modelNoModel to use, in the form 'provider/model' (e.g. 'my-gateway/coder-large'), not a bare model name. Omit to use the server-configured default, or OpenCode's own resolution if none is set. Given here, it replaces the stored value for this and later turns.
detailNo'compact' (default 'standard') drops toolCalls and filesChanged from this response (keeping toolCallCount, filesChangedCount, pendingApprovalCount, and pendingApprovals itself) to save context; the full answer and tool-call log stay retrievable with opencode-output regardless of this setting.
promptYesThe next message to send to OpenCode in this session.
threadIdNoAlias for sessionId (Codex-compatible name), same session id value. Exactly one of sessionId, threadId, conversationId is required to target a session; opencode-status may omit all three to list tracked sessions instead.
sessionIdNoId of a session tracked by this server, from a prior opencode call. Exactly one of sessionId, threadId, conversationId is required to target a session; opencode-status may omit all three to list tracked sessions instead.
request-idNoIdempotency key for this exact call (pattern: starts with a letter/digit, then up to 127 more letters/digits/'.'/'_'/':'/'-'). Retrying the same request-id after a network drop or client retry joins the original operation instead of sending a second prompt to OpenCode; a different request-id (or omitting it) always starts a new one. Shared between opencode and opencode-reply.
wait-secondsNoBounds only how long THIS call waits for a result, in seconds; it does not limit the turn itself. On expiry this call returns a 'running' (or 'waiting_for_approval') snapshot while the turn keeps executing on the server — continue observing it with opencode-status. Omit to block until the turn reaches a terminal state (subject to timeout-seconds); 0 returns immediately after admission — combine with opencode-status ids/wait-for to fan a batch of turns out in parallel and then observe them together.
output-schemaNoAsk OpenCode's final message for THIS turn to be one JSON value matching this JSON Schema (subset: object/array/string/number/integer/boolean/null; no $ref or unions; see README for the full list of supported keywords). Reported back as structuredOutput / structuredOutputStatus ('valid'/'missing'/'invalid'); still untrusted model output, and never changes status, error or retry behaviour. Turn-local: never inherited by a later reply.
conversationIdNoDeprecated alias for sessionId, same session id value. Exactly one of sessionId, threadId, conversationId is required to target a session; opencode-status may omit all three to list tracked sessions instead.
timeout-secondsNoThis turn's hard run-time limit, in seconds. When it expires, the OpenCode run is stopped and the result comes back with status 'timeout' — the work already done is not lost, but the turn itself ends. This is not a call timeout: to stop waiting for a response while letting the turn keep running, use wait-seconds instead.
max-output-charsNoCaps how many characters of the answer come back in THIS response only (0..44000; 0 returns no answer text at all). Never truncates the retained turn — read the rest with opencode-output. Omit to use the default for the chosen detail level (44000 standard, 2000 compact).
developer-instructionsNoSystem-prompt text for this session. Omitted: the stored value (if any) is re-sent; given: replaces the stored value for this and later turns.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
costNo
diffNo
hintNo
kindYes
turnNo
agentNo
errorNo
modelNo
rootsNo
totalNo
actionNo
agentsNo
finishNo
modelsNo
offsetNo
outputNo
reasonNo
serverNo
statusYes
tokensNo
turnIdNo
cleanupNo
contentYes
hasMoreNo
partialNo
requestNo
resultsNo
sectionNo
waitForNo
readyIdsNo
sessionsNo
threadIdNo
warningsNo
directoryNo
elapsedMsNo
sessionIdNo
toolCallsNo
truncatedNo
nextOffsetNo
observedAtNo
pendingIdsNo
snapshotIdNo
availabilityNo
filesChangedNo
resendSafetyNo
responseLoopNo
upstreamReadNo
omittedFieldsNo
toolCallCountNo
upstreamRetryNo
executionStateNo
opencodeVersionNo
pendingApprovalsNo
structuredOutputNo
filesChangedCountNo
abortedRunningTurnNo
pendingApprovalCountNo
structuredOutputErrorNo
structuredOutputStatusNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare openWorldHint and destructiveHint; the description goes far beyond them, disclosing blocking behavior, the wait-seconds vs timeout-seconds distinction (waiting vs. actually stopping the turn), that sandbox and approval-policy are fixed for the session's life, that retrying the same request-id joins the original operation while a duplicate request-id only observes, and that cancelling the owning call cancels the turn while an observer detaches harmlessly. This is exactly the lifecycle context the annotations cannot carry.

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?

Front-loaded with purpose first, then blocking semantics, then cancellation rules, then the reused options. Sentences are long and dense but each carries distinct operational information; a small amount of compression would help but nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter, session-mutating tool with a nested output schema, the description covers what an agent must decide before calling: which id alias to pass, how long to wait, what cancels what, and where the answer and full log land (structuredContent.content, opencode-output). Return values are delegated correctly to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds cross-parameter meaning: it names the mutually exclusive session identifiers, explains that output-schema is turn-local and never a stored default, and notes detail/max-output-chars/request-id/output-schema behave as in opencode. It does not restate per-parameter types, which the schema already handles well.

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 first sentence states a specific verb and resource — continue an existing OpenCode session started with opencode — and conditions it on having read the prior result from structuredContent.content. That cleanly separates it from the sibling opencode (which starts a session) without needing the schema.

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

Usage Guidelines5/5

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

It states the precondition (an existing session, previous result already read), the required targeting inputs (exactly one of sessionId/threadId/conversationId plus a prompt), and a concrete alternative for a related need: 'To stop waiting but keep the turn running, pass wait-seconds and poll opencode-status.' Observer-vs-owner cancellation is also distinguished as usage guidance.

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