Skip to main content
Glama
Dheerax

opencode-mcp-bridge

by Dheerax

opencode_start

Spawns a new OpenCode CLI session and runs an initial task, returning a session_id and events log path. Monitor the log for session events, then read results and kill the session when done.

Instructions

Spawns a new OpenCode CLI session and starts the initial task. Returns session_id and events_log_path. After starting, use a persistent background notification watcher on to receive events (running, idle, waiting_input, done, stale, contract_violated). Call opencode_read when notified, then opencode_kill when done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forkNoFork session before continuing.
taskYesInitial task prompt.
agentNoAgent mode to use.
modelNoModel to use (e.g., 'google/gemini-3.6-flash', 'opencode/deepseek-v4-flash-free', etc.).
formatNoOutput format: default or raw JSON events.
variantNoModel variant (e.g., 'high', 'max', 'minimal').
workdirNoWorking directory (defaults to process.cwd()).
contractNoOptional task contract for guardrails.
thinkingNoShow thinking/reasoning blocks.
auto_approveNoAuto-approve non-dangerous permissions.
continue_last_sessionNoContinue the previous OpenCode session.
session_id_to_continueNoSession ID to continue.
Behavior3/5

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

No annotations provided, so description carries the burden. It discloses that sessions emit events (running, idle, waiting_input, done, stale, contract_violated) and describes the notification-watcher pattern, which is good context. However, it doesn't disclose side effects (e.g., potential cost/session creation overhead, async behavior details, whether it blocks) beyond the event flow. Some behavioral detail is given but not exhaustive.

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?

Two sentences, front-loaded with purpose and key return values, then concise workflow. No wasted words. Slightly dense in sentence two (lists 7 event types inline) but efficient overall.

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?

With 12 params including a nested contract object and complex lifecycle, this is a complex tool. The description explains startup and event-driven flow but not the contract semantics, session continuation behavior, or contract_violated triggering conditions in detail. No output schema to fill gaps. Adequate but leaves room for more on the lifecycle/state machine.

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 all 12 parameters have individual descriptions already. The description adds workflow context (events_log_path usage, follow-up calls) but doesn't explain parameter relationships or the contract object semantics beyond schema. Baseline 3 is appropriate given the high schema coverage; description adds minimal param value.

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?

Description clearly states spawns a new OpenCode CLI session and starts the initial task, with specific verb (spawns/starts), resource (OpenCode CLI session), and returns session_id and events_log_path. It distinguishes from siblings like opencode_health, opencode_read, opencode_kill by its unique starting role.

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?

Provides clear workflow guidance: watch events_log_path for notifications, call opencode_read when notified, then opencode_kill when done. It names the follow-up tools by name. However, it doesn't explicitly state when NOT to use this tool or when to prefer an alternative like opencode_continue/switch, though the usage flow is well-clarified.

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/Dheerax/opencode_mcp'

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