Skip to main content
Glama

Wait for completion

opencode_wait

Waits for a coding run to complete and returns the full result or progress. Supports waiting on multiple runs and returns the first to finish.

Instructions

Waits up to 'maxSeconds' for a run to finish. If it is done, the full result comes back. If it is still running, a progress report comes back — then simply call again. Never blocks indefinitely, and never shortens the run itself: the task keeps going between calls no matter how long it takes. Returns the moment opencode reports the session idle — there is no polling delay. While waiting it emits notifications/progress with the live tool activity, so a client that sets resetTimeoutOnProgress can raise maxSeconds well past its own default timeout. Pass 'runIds' instead of 'runId' to wait for whichever of several parallel runs finishes first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdNoThe runId returned by opencode_dispatch.
runIdsNoSeveral runIds — returns as soon as any one of them finishes.
maxSecondsNoMaximum wait time for this call (default 55s).
Behavior5/5

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

With no annotations, the description carries full burden and does so thoroughly: it discloses that the tool never blocks indefinitely, never shortens the run, returns the moment opencode reports idle with no polling delay, and emits notifications/progress while waiting.

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?

The description is a single dense paragraph, front-loading the core behavior and then adding necessary clarifications. Every sentence adds relevant information about timing, parallel runs, or notifications.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema, the description explains what returns (full result or progress report), the timeout behavior, the idle detection, and the progress notifications. It is complete for the tool's purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already covers all three parameters with descriptions, but the description adds context: runId is the one returned by opencode_dispatch, runIds allows waiting for the first of several parallel runs, and maxSeconds has a default of 55s. This goes beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool waits up to maxSeconds for a run to finish and returns the full result or a progress report. It uses a specific verb ('wait') and resource ('a run'), distinguishing it from sibling tools like opencode_result or opencode_cancel.

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?

It instructs that if a run is still running, a progress report comes back and one should simply call again, and it explains how to pass runIds to wait for the first of several parallel runs. However, it does not explicitly name alternative tools for when not to use this one.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/teodorgross/opencode-mcp-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server