Skip to main content
Glama

Agents and subagents

opencode_agent

List available primary and subagent agents, switch a session's agent, or delegate a one-shot task to a subagent; delegation returns the child session transcript.

Instructions

List available agents (primary and subagent), switch the agent of a session, or delegate a one-shot task to a subagent. Delegation creates a real child session and returns its transcript.

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": {
      "action": "<action>"
    },
    "name": "opencode_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNoAgent id, e.g. general, explore, build
actionYes
promptNoFor action=delegate
directoryNo
sessionIDNoFor action=set
timeoutMsNo
parentSessionIDNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations supply only readOnlyHint=false, so the description must carry most of the burden. It does add real value by disclosing that delegation spawns an actual child session and returns its transcript, but it says nothing about the side effects of 'set', timeout behavior, permission requirements, or cost/latency of delegation.

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?

Two sentences, zero padding, with the capability set stated first and the most consequential side effect (child session + transcript) immediately after. Every clause carries information an agent needs.

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?

For a seven-parameter, mixed read/write tool with no output schema, the description covers the action space and the delegate return value but omits the meaning of timeoutMs, directory, and parentSessionID, and gives no detail on what 'list' returns or how 'set' affects an in-flight session.

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 coverage is 43%, with agent, prompt, and sessionID partially described in the schema itself. The description reinforces that sessionID belongs to set and prompt to delegate, but leaves timeoutMs, directory, and parentSessionID entirely unexplained, so it does not fully compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names three concrete modes with a specific resource: list agents (primary and subagent), switch a session's agent, or delegate a one-shot task to a subagent. The verb+resource pairing is unambiguous, but it never contrasts itself with adjacent tools like opencode_task or opencode_session_prompt, which an agent could plausibly confuse with 'delegate'.

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?

The three action values are enumerated so usage is inferable, and 'one-shot task' hints at when delegation is appropriate versus ongoing work. However, there is no explicit when-to-use/when-not guidance, no statement of which action to prefer over session-based siblings, and no prerequisites for switching an agent.

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