Skip to main content
Glama

opencode_session_delete

Destructive

Delete a coding session by ID and permanently remove all its associated data. Use this to clean up unused sessions and free storage.

Instructions

Delete a session and all its data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSession ID to delete
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
textYes
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description adds meaningful context by specifying that the session's data is destroyed with the session. This goes beyond the bare destructive flag, though it could be even more explicit about irreversibility and cascading effects.

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 one short sentence with no filler, front-loading the action and the scope. Every word earns its place.

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 a simple two-parameter delete operation, the combination of the description, full schema coverage, output schema, and annotations is nearly complete. It lacks guidance on irreversibility or live-session behavior, but those are partially implied by the destructive annotation and deletion semantics.

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 description coverage is 100%, so the parameters 'id' and 'directory' are already clearly documented. The tool description adds no parameter-specific meaning, but it does not need to because the schema carries that burden.

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 uses a specific verb ('Delete'), names the resource ('a session'), and explicitly scopes the effect ('and all its data'). This clearly separates it from sibling tools like session_get, session_update, session_revert, or session_abort.

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?

No guidance is provided about when to use this tool instead of related session operations such as opencode_session_abort, opencode_session_revert, or opencode_session_fork. There is no mention of prerequisites, warnings about active sessions, or scenarios where deletion is or is not appropriate.

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

Deploy Server

Other Tools