Skip to main content
Glama

opencode_run

Destructive

Send a task to OpenCode and await the outcome. Get a durable job ID; if observation times out, the job continues and can be resumed.

Instructions

Send a task and wait for its correlated response. Returns a durable job ID; an observation timeout leaves the remote job running and can be resumed with opencode_wait.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNoOpenCode agent name
titleNoTitle for a new session
formatNoResponse format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool.
promptYesTask or instruction to send to OpenCode
modelIDNoModel ID from provider discovery
variantNoModel variant
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.
sessionIdNoExisting session to continue; omit to create one
providerIDNoProvider ID from provider discovery
maxDurationSecondsNoMaximum observation duration in seconds (default 600); timeout does not abort the job

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
errorNo
jobIdNo
resultNo
statusYes
isErrorYes
directoryNo
messageIdNo
sessionIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.2/5.0
Behavior4/5

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

The description adds useful behavioral context beyond the annotations: jobs are durable, an observation timeout does not abort the remote job, and results can be resumed later. It does not detail side effects or permission requirements, but the schema and existing annotations help cover those aspects.

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 compact and front-loaded: the first sentence states the core purpose, and the second communicates the most important behavioral nuance. There is no filler or redundant repetition.

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?

Given the complex tool with 10 parameters, this description is reasonably complete because the schema covers parameters and an output schema exists. The timeout/resume behavior is included, which is essential context for correctly using the tool. It could add a little more guidance on retrieving job results, but it is not a significant gap.

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 parameters are already well documented. The tool description adds little about individual parameters, only confirming that a task is sent and a durable job ID is returned. This matches the baseline for high schema coverage.

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 a specific verb and resource: send a task and wait for its correlated response. It differentiates itself from other session/message tools by highlighting the durable job ID and the ability to resume with opencode_wait.

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?

The description clarifies the main use case and explicitly routes follow-up after an observation timeout to opencode_wait. It does not mention when to prefer alternatives like opencode_message_send_async or opencode_ask, but the provided context is clear and actionable.

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