Skip to main content
Glama

Prompt an OpenCode session

opencode_session_prompt

Send a message to a session and return the final answer. By default only a summary is returned: tool calls, intermediate steps and reasoning stay inside OpenCode, so the caller's context is not polluted.

Instructions

Send a message to a session and return the final answer. By default only a summary is returned: tool calls, intermediate steps and reasoning stay inside OpenCode, so the caller's context is not polluted. Set verbosity='full' only when you explicitly need the transcript. 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)
verbosityNosummary (default). 'full' is admin-only and usually disabled

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / verbosity
      Added value: +{
      +  "description": "summary (default). 'full' is admin-only and usually disabled",
      +  "enum": [
      +    "summary",
      +    "full"
      +  ],
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

With only readOnlyHint=false supplied, the description carries the burden well: it discloses that tool calls, intermediate steps and reasoning stay inside OpenCode, that the caller's context is not polluted, and that verbosity='full' is admin-only and usually disabled. These are non-obvious behavioral and permission facts an agent could not infer from the annotation alone. Only timeout/failure semantics are left unstated, which is a minor gap.

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?

Four compact sentences, front-loaded with the core action and return behavior, then the default-summary rationale, then attachments, then the async option. Every sentence conveys either behavior or a control decision, with 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?

For an 8-parameter mutation tool with no output schema, the description covers the important surfaces: what is returned by default, why, how to opt into the full transcript, and how to go async. The remaining gap is the undocumented agents/skills delegation parameters and any timeout/error behavior, which an agent may need before wiring up multi-agent runs.

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 a middling 63%, and the description largely restates what the schema already says for files ('path or data: URI'), wait ('fire-and-forget' vs 'Wait for the run to finish'), and verbosity ('admin-only'). The agents, skills, sessionID and timeoutMs parameters get no mention in the description, so it adds only marginal meaning beyond the schema. Baseline 3 fits.

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?

The description uses a concrete verb and resource: 'Send a message to a session and return the final answer', plus it names the return contract. An agent can tell this is the conversational/prompt path rather than a read-only sibling like opencode_session_history or opencode_session_get. It stops short of naming or contrasting any sibling explicitly, so it lands at 4 rather than 5.

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

Usage Guidelines4/5

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

Clear conditional guidance is given for two modes: use verbosity='full' 'only when you explicitly need the transcript', and wait=false for fire-and-forget. That is real when/when-not guidance, but it is scoped to parameter modes rather than to choosing this tool over opencode_session_history, opencode_session_interrupt, or opencode_session_get, so no tool-level exclusions are stated.

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