Skip to main content
Glama

delegate_task

Delegate a coding task to an external model in OpenCode for agentic execution, returning a session_id to monitor or abort the run. Use for atomic tasks with a clear design.

Instructions

Delegate a coding task to an external model running in OpenCode. The delegated model runs an agentic loop with the MCP servers configured in opencode and the skills from ~/.claude/skills - it is a full worker, not a single completion call.

Monitoring is event-driven (SSE) with poll fallback and a hard ceiling (OPENCODE_MAX_POLL_MS, default 45 min) - it never waits forever. Empty responses are retried automatically; a session that ends in error comes back as an error, not as an empty success; if the opencode server is down the bridge restarts it. Run bridge_health first when in doubt.

USE IT FOR: an atomic task whose design is already decided in the prompt. AVOID IT FOR: open design decisions (the model will fill the gap with something plausible) and long build/run loops inside the agent.

TRAP: use ABSOLUTE paths for every file in the prompt, even when passing 'directory'. If the wait hits the ceiling you get an error carrying the session_id - the model MAY STILL BE RUNNING on the server: check task_progress before continue_task.

CHOOSING THE MODEL - MANDATORY: if the user did not name a model for this task, DO NOT pick one on your own. Call list_models, then propose ONE model with a one-line reason ("qwen3.7-plus: multi-file refactor, needs the bigger context") and ask the user to confirm or change it. Once they answer, reuse that choice for the following delegations in this conversation until they say otherwise. Only skip the question when the user already named the model.

RETURNS: session_id for continue_task / task_progress / abort_task / end_task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesAn alias from bridge.config.json (list_models shows them) or a full "provider/model", e.g. "opencode-go/gpt-5.6-luna". Ask the user when they have not chosen one.
titleNoShort title for the delegation session
effortNoReasoning effort, sent to opencode as the message "variant". Valid values are PER MODEL (list_models has the column); an unsupported value is an error, never a silent downgrade. Omit to use the alias default, then the model default.
promptYesDetailed task description. Use absolute paths for every file operation.
directoryNoProject root for the session (sent as ?directory= when enabled). Still: use absolute paths in the prompt.
Behavior5/5

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

With no annotations provided, the description carries the full transparency burden and delivers richly: it discloses the agentic loop with MCP servers and skills, the SSE-with-poll-fallback monitoring and hard ceiling (OPENCODE_MAX_POLL_MS, default 45 min), automatic retries of empty responses, error mapping ('a session that ends in error comes back as an error, not as an empty success'), server restart behavior, and the critical trap that the model may still be running after a timeout — instructing the agent to check task_progress before continue_task.

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 long but justified for a high-complexity tool, and it is well-structured with scannable labeled sections (USE IT FOR / AVOID IT FOR / TRAP / CHOOSING THE MODEL - MANDATORY / RETURNS). The opening sentence front-loads the core purpose, and while the absolute-path requirement is repeated, it is deliberate emphasis on a critical failure trap rather than waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a high-complexity tool with no annotations and no output schema, so the description must cover behavior, failure modes, and return values on its own — and it does. It explains the returns via session_id linked to sibling tools, documents timeouts, retries, error semantics, server restart, the model-selection process, and the still-running risk. There are no significant gaps for an agent to fall into.

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 baseline is 3. The description nevertheless adds genuine value: the MANDATORY model-selection protocol (do not pick a model on your own; call list_models; propose ONE model with a one-line reason; ask user to confirm; reuse the choice for subsequent delegations) goes well beyond the schema's 'Ask the user when they have not chosen one.' It also reinforces the absolute-path trap for prompt/directory beyond the schema's own wording.

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 first sentence states a specific verb+resource+target: 'Delegate a coding task to an external model running in OpenCode.' It distinguishes from siblings by clarifying 'it is a full worker, not a single completion call' and linking the returned session_id to the sibling tools (continue_task, task_progress, abort_task, end_task), which makes the tool's role in the family unambiguous.

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

Usage Guidelines5/5

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

Provides explicit when-to-use and when-not-to-use guidance: 'USE IT FOR: an atomic task whose design is already decided in the prompt. AVOID IT FOR: open design decisions... and long build/run loops.' It also names alternatives and prerequisites, telling the agent to 'Run bridge_health first when in doubt' and to 'Call list_models' before choosing a model.

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/Guipegoraro/opencode-bridge'

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