Skip to main content
Glama

opencode_command_execute

Destructive

Execute slash commands like init, undo, or redo in an existing session to manage and control OpenCode workflow.

Instructions

Execute a slash command in a session (e.g. /init, /undo, /redo)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNoAgent to use
commandYesThe slash command to execute (e.g. 'init', 'undo')
modelIDNoModel ID
variantNoModel variant
argumentsNoArguments for the command
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.
sessionIdYesSession ID
providerIDNoProvider ID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
textYes
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already convey destructive and open-world behavior, and the description adds little beyond examples. It does not disclose that commands like /undo or /redo mutate session state, that effects may be significant, or what an agent should watch out for. There is no contradiction with annotations.

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?

A single front-loaded sentence with useful examples and no filler. Every word contributes to understanding what the tool does.

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?

The output schema and full parameter coverage reduce the burden on the description, but an agent is not told how to discover valid slash commands or how this relates to command_list and the TUI execution tools. Adequate but minimal.

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 parameters. The description adds no parameter-level meaning beyond examples, but the baseline of 3 is appropriate because the schema carries the load.

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: executing a slash command within a session, with concrete examples (/init, /undo, /redo). It is clear, though it does not explicitly distinguish itself from sibling tools like opencode_tui_execute_command or opencode_command_list.

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

Usage Guidelines2/5

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

No guidance is given about when to use this tool versus alternatives such as opencode_command_list, opencode_shell_execute, or opencode_tui_execute_command. The context implies session-scoped slash commands, but there are no exclusions or selection criteria.

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

Deploy Server

Other Tools