Skip to main content
Glama
Antigravity OpenCode Delegate

Antigravity OpenCode Delegate

opencode_execute

Delegate a bounded coding or codebase-analysis task to a local OpenCode 2 executor with an explicit provider/model, returning text, session ID, exit status, and Git context. Runs read-only by default.

Instructions

Run a bounded task in a new session with local OpenCode 2. An explicit provider/model is REQUIRED for every task; never infer a model or rely on CLI defaults. Defaults to isolated read-only project analysis. Returns the requested model (not independently verified), text, session ID, exit status and Git context; reports model failures as errors.

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": {
      "task": "<task>",
      "cwd": "<cwd>",
      "model": "<model>"
    },
    "name": "opencode_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesExisting absolute project directory.
taskYesTask, scope and expected output. Start with ordinary text, not a CLI option.
agentNoOptional OpenCode agent in write mode. Read-only mode always uses an isolated reader agent.
modelYesREQUIRED for each delegation: configured provider/model, optionally #variant. Use an explicitly authorized ID; ask or call opencode_models if unspecified. No automatic model selection or fallback.
readOnlyNoAllow file reading/search only. Denies edit, shell, external directories and network tools.
sessionIdNoUnsupported: omit this field. Old sessions can override the selected project and current permissions.
timeoutMsNoOpenCode process timeout, independent of the MCP request timeout.
standaloneNoStart a private OpenCode server. Required in read-only mode.
autoApproveNoApprove tools that are not explicitly denied. Enable only for tasks whose tool actions are authorized.
continueSessionNoMust remain false. This bridge creates a new session for each task.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose several useful traits: isolation/read-only default, the fact that the returned model is not independently verified, and that model failures surface as errors. It omits the converse behavior for write mode (what edits actually touch, permission prompts, autoApprove risk) and says nothing about the timeout or failure modes beyond model errors.

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 tightly packed sentences covering purpose, hard constraint, default posture and return contract, with the most important constraint (model REQUIRED) front-loaded. No filler or restatement of the 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?

For a 10-parameter, annotation-free tool, the description covers purpose, the mandatory-parameter rule, the default isolation posture and the return contract including Git context. It does not clarify that autoApprove/agent only matter in write mode or describe timeout semantics, which leaves a small gap for an agent configuring a non-default invocation.

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 description coverage is 100%, so the schema already documents all 10 parameters well. The description reinforces two of them (model must be explicit, readOnly isolation default), but adds little syntax or meaning the schema does not already state, so the baseline 3 applies.

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?

States a specific verb and resource: "Run a bounded task in a new session with local OpenCode 2," which is far more concrete than the bare name opencode_execute. It does not explicitly name a sibling tool, but the "new session" framing and the returned fields make it distinguishable from cancel/status/doctor/start in practice.

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 gives a clear operating context (delegated bounded tasks, isolated read-only analysis by default) and a strong usage constraint: an explicit provider/model is REQUIRED and must never be inferred. However, it never says when to prefer this over opencode_start or opencode_models, so the agent must infer the routing itself.

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