Skip to main content
Glama

opencode_run

Destructive

Execute software engineering tasks via an AI coding agent for feature implementation, refactoring, debugging, and code explanation; attach files for context.

Instructions

Execute a coding task through OpenCode AI agent. Use for implementing features, refactoring, debugging, explaining code, or any software engineering task.

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_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNoAgent to use: build, plan, or custom agent name
filesNoFile paths to attach as context
modelNoModel in format provider/model (e.g., anthropic/claude-sonnet-4)
promptYesThe task or question for OpenCode
noReplyNoAdd context without triggering AI response
workingDirectoryNoProject directory path (auto-detected if not specified)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.3/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and idempotentHint=false, so the safety profile is covered. The description adds nothing beyond that: it does not say the agent may edit files or run commands, that repeated invocations can compound changes, or what the caller gets back. For an open-world, non-idempotent, destructive operation, that leaves real behavioral uncertainty unaddressed.

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?

Two short sentences, with the core action front-loaded before the use-case list. There is no filler, though the trailing 'or any software engineering task' broadens scope without adding discriminating information.

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?

There is no output schema, so some explanation of what the tool returns would help, and the mutation semantics deserve a mention. Against a fully described six-parameter schema and explicit annotations, however, the description is close to sufficient for a competent caller to invoke it correctly.

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 100%, so all six parameters including agent, model, files, noReply and workingDirectory are documented in the schema. The description contributes no additional meaning about prompt construction, file attachment semantics, or how workingDirectory affects execution, which is the baseline expectation when the schema does the heavy lifting.

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: 'Execute a coding task through OpenCode AI agent,' which is concrete and actionable. It does not, however, distinguish this from similar siblings such as opencode_session_prompt or opencode_agent_delegate, so an agent cannot tell from the text alone which entry point to pick.

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 second sentence enumerates use cases (implementing features, refactoring, debugging, explaining code), which implies when to reach for it. There is no exclusion guidance, no statement of when a sibling like opencode_agent_delegate is preferable, and no mention of prerequisites such as a working directory or model configuration.

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