Skip to main content
Glama
sebstaq

opencode-subagent-mcp

by sebstaq

opencode subagent

agent

Delegate a self-contained task to a subagent that runs in your project and returns only its final report. Supports worktree isolation and background execution.

Instructions

Launch a subagent that runs on an opencode model (default opencode-go/deepseek-v4.1-flash) in the current project. Mirrors the built-in Agent tool: give a self-contained task prompt; the agent starts with no conversation context and returns only its final report. subagent_type accepts Claude agent definitions from .claude/agents/ (their prompt, tools, permissionMode and maxTurns apply) or opencode agents (general, explore, plan, build). isolation 'worktree' runs it in a temporary git worktree off the default branch, removed if unchanged. The call blocks until the agent finishes (it is backgrounded automatically after a while); set run_in_background to return at once and collect the result with wait.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory (default: the project directory)
modelNoopencode model as provider/model (default: opencode-go/deepseek-v4.1-flash)
toolsNoAllowlist of tools (Claude or opencode names)
effortNoModel variant/reasoning effort, e.g. low, high, max
promptYesThe task for the agent to perform
isolationNo
max_turnsNo
descriptionYesShort (3-5 word) description of the task
output_schemaNoJSON Schema the final answer must satisfy; returned as structured output
subagent_typeNoClaude agent definition name or opencode agent name (default: general)
permission_modeNoPermission mode (default: auto)
disallowed_toolsNo
run_in_backgroundNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden, and it delivers substantial disclosure: blocking behavior ('The call blocks until the agent finishes'), automatic backgrounding, the run_in_background escape hatch, worktree isolation semantics including cleanup ('removed if unchanged'), and the no-conversation-context behavior. These are exactly the non-obvious behavioral traits an agent needs and are not derivable from the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every sentence earns its place and the content is dense with no filler, but it is a single run-on paragraph that is hard to scan. The size is arguably justified by the tool's complexity, yet the lack of structure (no bullets, no separation of behavior vs parameters) makes it harder to parse than it should be.

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?

For a 13-parameter tool with no annotations and no output schema, the description covers the most critical non-obvious behaviors (blocking, backgrounding, isolation cleanup, subagent resolution, context isolation). It could add a bit on permission_mode behavior or how the final result is returned, but given the complexity, the coverage is close to complete.

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?

At 69% schema coverage, the description meaningfully compensates for the schema on the hardest parameters: it explains what subagent_type accepts (Claude .claude/agents/ definitions vs opencode agents, with their prompt/tools/permissionMode/maxTurns applying), what isolation 'worktree' induces, and the run_in_background blocking trade-off. Some params (output_schema, max_turns, effort, tools) are left to the schema, but the description targets the most complex ones.

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?

Opens with a specific verb+resource ('Launch a subagent that runs on an opencode model'), states the scope ('in the current project') and immediately distinguishes itself from siblings by invoking the built-in Agent tool it mirrors. The sibling set (send_message, wait, stop, list) is clearly different, so there is little chance of confusing this tool with an alternative.

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 contextual guidance: instructs to 'give a self-contained task prompt' and explains that the agent 'starts with no conversation context and returns only its final report', which tells an agent when this tool is appropriate (standalone tasks) and what to expect. It references the built-in Agent tool as a mirror but stops short of explicit when-not-to-use or exclusion statements, which would push it to a 5.

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