Skip to main content
Glama

Prompt an OpenCode session

opencode_session_prompt

Send a prompt to an OpenCode session and return assistant text, tool calls, and usage. Attach files or set wait=false for fire-and-forget runs.

Instructions

Send a message to a session and (by default) wait for the answer. Returns the assistant text, new turns, tool calls and usage. Attach files with files (path or data: URI). Set wait=false for fire-and-forget.

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": {
      "sessionID": "<sessionID>",
      "text": "<text>"
    },
    "name": "opencode_session_prompt"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe prompt text
waitNoWait for the run to finish (default true)
filesNo
agentsNoAgents the model may delegate to
skillsNo
sessionIDYes
timeoutMsNoDefault 45000 (kept under typical MCP client timeouts)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations only declare readOnlyHint=false; the description adds real behavioral context by disclosing the default blocking wait and the fire-and-forget escape hatch. It stays silent on concurrency (what happens if a run is already active), error/failure modes, and whether the message is persisted in history, which matter for a mutating tool.

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 tight sentences with the primary behavior front-loaded, the return payload stated second, and parameter tips last. No filler or repetition.

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?

With 7 parameters, no output schema, and a mutating annotation, the description does the important work: it describes return contents, the default wait behavior, and file attachment. The main residual gaps are concurrency and error behavior, which are secondary for a prompt-submission tool.

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 57%, so the schema carries most of the load (e.g. timeoutMs and wait already have descriptions). The description adds some meaning for `files` (path or data: URI) and clarifies wait's default semantics, but says nothing about `agents`, `skills`, or `sessionID`.

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: 'Send a message to a session and (by default) wait for the answer,' plus what is returned (assistant text, new turns, tool calls, usage). This lets an agent distinguish it from sibling reads like opencode_session_history or opencode_session_get, though no sibling is named explicitly.

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?

Gives one concrete usage switch ('Set wait=false for fire-and-forget') and notes the default blocking behavior, which is genuinely helpful. It offers no guidance on when to prefer this over interrupt/history or what to do if the session is already running, so usage is implied rather than spelled out.

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