Skip to main content
Glama

Delete OpenCode session

opencode_session_delete
Destructive

Deletes an OpenCode session and all of its messages by session ID. Use it to clean up finished or unneeded sessions and remove their stored history.

Instructions

Delete a session and its messages.

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": "opencode_session_delete"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionIDYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered. The description adds one useful behavioral fact — that messages are removed along with the session — but says nothing about irreversibility, whether related tasks/workspaces are affected, or what the response returns.

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 short sentence with zero waste and the action front-loaded. It is efficient, though it is terse enough that some needed detail is missing rather than trimmed.

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

Completeness2/5

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

For a destructive mutation with no output schema and no parameter documentation, the description should say more about what is destroyed and whether it is recoverable. It provides only the basic action and the message cascade, leaving key risk context absent.

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?

There is one parameter with 0% schema description coverage, and the description does not explain what sessionID refers to, whether it is an ID or a name, or what happens if it is invalid. The name is somewhat self-descriptive, but the description does not compensate for the schema gap.

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 states a specific verb and resource ('Delete a session') and adds that the session's messages are removed too, which is real information beyond the title. It does not differentiate itself from siblings like session_compact or session_move, but the name and verb make selection unambiguous.

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?

There is no guidance on when to delete versus alternatives such as session_compact or session_create, and no mention of preconditions or cautions. It gives the barest description of the action with no when-to-use context at all.

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