Skip to main content
Glama

Delegate task to OpenCode agent

delegate_task

Delegate software-engineering tasks to an OpenCode agent that explores your repository and returns a summary with findings, while controlling edit and shell permissions per call.

Instructions

Delegate a software-engineering task to an OpenCode agent (DeepSeek by default) that runs in the same workspace. The agent explores the repository itself and returns a concise summary plus structured findings. Every agent can be granted or denied edits and shell access per call with allow_edits / allow_bash; grants still enforce the bridge security policy (sensitive-file protection for edits, no git history changes for shell). Returns { status, session_id, summary, findings, files_changed }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorkspace directory. Defaults to CLAUDE_PROJECT_DIR / the server working directory.
taskYesThe task to delegate, written as a clear instruction.
agentNoAgent to use (default: deepseek-researcher). See list_agents.
modelNoOverride the model, e.g. "deepseek/deepseek-v4-pro".
pathsNoStarting path hints relative to the workspace. Hints only, not a restriction.
timeoutNoExecution timeout in milliseconds (default from bridge config).
allow_bashNoGrant (true) or revoke (false) shell commands for this call. Omit to use the agent's default.
allow_editsNoGrant (true) or revoke (false) file edits for this call. Omit to use the agent's default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.1.0
    • addedInput schema / properties / allow_bash
      Added value: +{
      +  "description": "Grant (true) or revoke (false) shell commands for this call. Omit to use the agent's default.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / allow_edits / description
      Previous value: -"When false, edit/write tools are disabled for this call."New value: +"Grant (true) or revoke (false) file edits for this call. Omit to use the agent's default."
  2. First observedv1.0.0

TDQS

A4.3/5.0
Behavior5/5

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

With only openWorldHint in annotations, the description carries the burden well: it discloses that the agent explores the repo itself, that grants are per-call, that the bridge security policy still applies (sensitive-file protection for edits, no git history changes for shell), and it names the exact return shape. This is rich behavioral context beyond the structured fields.

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?

Three dense sentences, front-loaded with the core purpose before permissions and return shape. Efficient, though the return-shape enumeration at the end adds a little bulk that an output schema would otherwise carry.

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 tool with 8 parameters, no output schema, and only an openWorldHint annotation, the description covers purpose, permission model, and return fields adequately. Minor gaps remain around timeout behavior and how findings are scoped, but nothing critical for correct invocation is missing.

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 schema already documents all 8 parameters, setting a baseline of 3. The description adds real value beyond it by explaining the security semantics of allow_edits/allow_bash (grants are constrained, omission falls back to agent defaults), which the schema alone does not convey.

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?

States a specific verb (delegate) and resource (a software-engineering task to an OpenCode agent), plus the runtime model and workspace scope. It is clearly distinguishable from session-oriented siblings like create_session/send_message, which manage a conversation rather than running a full delegated task.

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

Usage Guidelines3/5

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

It implies usage by naming the task type (software-engineering) and pointing to list_agents for agent selection, and explains allow_edits/allow_bash per-call granting. However, it never says when to prefer this over send_message/create_session, or what conditions make this the wrong choice, leaving alternative routing to inference.

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