Skip to main content
Glama
OpenCode V2 MCP Bridge
by ddarkwing

Cancel an OpenCode session

oc_cancel

Interrupts the active execution of a session, stopping running work early so you can halt an agent task and regain control.

Instructions

Interrupt the active execution of a session.

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>"
    },
    "name": "oc_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionIDYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and does not meet it. It does not say whether the interruption is graceful or immediate, what happens to in-flight work, whether the session can be resumed afterward, or whether it errors when nothing is executing.

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?

A single front-loaded sentence with no wasted words. Brevity is appropriate, though it leans toward under-specification rather than tight, information-dense phrasing.

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?

With one required parameter, no annotations, and no output schema, the definition is minimal but operable: an agent knows what the tool does and roughly what to pass. It omits the outcome (return value or confirmation), post-cancellation session state, and failure behavior, which matter for a mutation-style interrupt.

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

Parameters2/5

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

The single parameter sessionID has 0% schema description coverage, and the description only obliquely references "a session" without naming the parameter, its format, or how to obtain a valid ID. With no compensating detail, an agent must guess the identifier's provenance.

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 ("Interrupt") and a precisely scoped resource ("the active execution of a session"), which distinguishes it from a reply/status tool without needing to name a sibling. It stops short of explicitly contrasting with siblings like oc_reply or oc_status, so it is clear but not fully differentiated.

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 phrase "active execution" implies the precondition that a session must currently be running, which is implicit when-to-use guidance. There is no explicit statement of when not to call it (e.g., idle or completed sessions) and no mention of alternatives for stopping or querying a session.

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