Skip to main content
Glama

Delegate a task to OpenCode

opencode_task

One-shot delegation: create a session, send a prompt, wait for the run, and return ONLY the final summary. Tool calls, intermediate steps and reasoning stay inside OpenCode, so the caller's context stays clean.

Instructions

One-shot delegation: create a session, send a prompt, wait for the run, and return ONLY the final summary. Tool calls, intermediate steps and reasoning stay inside OpenCode, so the caller's context stays clean. Use background=true to get an immediate 'working' acknowledgement and collect the summary later with opencode_job. Set verbosity='full' only when a transcript is explicitly needed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "opencode_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
waitNoWait for the run (default true; ignored when background=true)
agentNoAgent id (default general; try explore for read-only research)
modelNo
titleNo
promptYesWhat the agent should do
directoryNoAbsolute workspace; defaults to the client's directory
timeoutMsNoDefault 45000 inline, 1800000 in background
verbosityNosummary (default). 'full' is admin-only and usually disabled
backgroundNoReturn immediately with a jobID instead of waiting
parentSessionIDNoAttach the task as a subagent of this session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.5.0
    • addedInput schema / properties / background
      Added value: +{
      +  "description": "Return immediately with a jobID instead of waiting",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Default 45000"New value: +"Default 45000 inline, 1800000 in background"
    • addedInput schema / properties / verbosity
      Added value: +{
      +  "description": "summary (default). 'full' is admin-only and usually disabled",
      +  "enum": [
      +    "summary",
      +    "full"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / wait / description
      Previous value: -"Default true"New value: +"Wait for the run (default true; ignored when background=true)"
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false, so the description carries most of the behavioral burden and does so well: it discloses that tool calls, intermediate steps and reasoning are suppressed from the caller's context, and that background mode returns a 'working' acknowledgement plus a job handle rather than a result. It stops short of describing timeout or failure behavior despite having a timeoutMs parameter.

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?

Three sentences, front-loaded with the core behavior and what is returned, followed by the two optional-mode caveats. Every sentence changes how an agent would call the tool; nothing is restated from the schema or title.

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?

With 10 parameters, no output schema, and a nested model object, the description does the important work of explaining what the return value is ('ONLY the final summary') and how the asynchronous variant behaves. What remains uncovered is error/timeout semantics and whether the created session persists after the call, which matter for a 10-parameter delegation tool.

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 already 80%, so the baseline is 3, but the description adds real meaning beyond the schema for two parameters: background=true is tied to a concrete follow-up workflow (opencode_job) and verbosity='full' is framed as an exception case with an availability caveat. The remaining parameters (model, directory, parentSessionID, timeoutMs) are left entirely to the schema.

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 names a specific verb chain and resource — 'create a session, send a prompt, wait for the run, and return ONLY the final summary' — which tells an agent exactly what the call does and what it will receive. It also implicitly separates itself from multi-turn siblings by labeling the operation 'one-shot delegation'.

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?

It gives explicit conditional guidance: use background=true when you want an immediate acknowledgement, then collect via opencode_job; set verbosity='full' only when a transcript is needed. What is missing is the inverse case — when to prefer opencode_session_prompt for multi-turn work instead of this one-shot path.

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