Skip to main content
Glama

Delete an agent's session

destroy_session
DestructiveIdempotent

Destroy one of an agent's conversation sessions: it leaves list_sessions and cannot be resumed, though its transcript is kept. This cannot be undone, so confirm with the user first, naming the session. A session already deleted, or one of another agent, reports that it is gone and succeeds. Destroying the agent keeps its sessions, and once the agent is gone no MCP tool can remove them, so destroy them first if they should go. Requires connecting a Valet account. Requires the Admin role.

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": {
      "name": "<name>",
      "session": "<session>"
    },
    "name": "destroy_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe agent's name, as list_services shows it: the agent whose session to delete.
sessionYesThe session id, as list_sessions names it.
org_nameNoThe Valet organization the agent belongs to. Omit to use the organization the account joined first.

Output Schema

NameRequiredDescriptionDefault
orgYesName of the Valet organization the call acted in.
kindYesAlways session: the kind of thing this tool destroys.
nameYesID of the session destroyed, as passed in session.
already_goneNoTrue when the session was already gone before the call, so nothing was destroyed. Absent when this call destroyed it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedOutput schema / properties / already_gone / description
      Previous value: -"True when the thing was already gone before the call, so nothing was destroyed. Absent when this call destroyed it."New value: +"True when the session was already gone before the call, so nothing was destroyed. Absent when this call destroyed it."
    • changedOutput schema / properties / kind / description
      Previous value: -"What the thing was, such as channel, connector, or resource."New value: +"Always session: the kind of thing this tool destroys."
    • addedOutput schema / properties / kind / enum
      Added value: +[
      +  "session"
      +]
    • changedOutput schema / properties / name / description
      Previous value: -"Name of the thing the call destroyed, as the caller gave it."New value: +"ID of the session destroyed, as passed in session."
  2. Changed1 schema field changed
    • changedInput schema / properties / name / description
      Previous value: -"The agent's name."New value: +"The agent's name, as list_services shows it: the agent whose session to delete."
  3. Changed6 schema fields changed
    • changedInput schema / properties / name / description
      Previous value: -"Required. The agent's name."New value: +"The agent's name."
    • changedInput schema / properties / session / description
      Previous value: -"Required. The session id, as list_sessions names it."New value: +"The session id, as list_sessions names it."
    • addedOutput schema / properties / already_gone / description
      Added value: +"True when the thing was already gone before the call, so nothing was destroyed. Absent when this call destroyed it."
    • addedOutput schema / properties / kind / description
      Added value: +"What the thing was, such as channel, connector, or resource."
    • addedOutput schema / properties / name / description
      Added value: +"Name of the thing the call destroyed, as the caller gave it."
    • addedOutput schema / properties / org / description
      Added value: +"Name of the Valet organization the call acted in."
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "already_gone": {
      +      "type": "boolean"
      +    },
      +    "kind": {
      +      "type": "string"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "org": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "org",
      +    "name",
      +    "kind"
      +  ],
      +  "type": "object"
      +}
  5. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, yet the description still adds real substance: the transcript is retained, the action cannot be undone, a repeat or wrong-owner delete reports 'gone' and still succeeds, and the prerequisites (Valet account, Admin role) are named. These are exactly the facts an agent needs before committing to an irreversible call.

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?

Front-loaded with the core effect and the irreversibility warning, then prerequisites last. Every sentence carries information, though the agent-destruction ordering clause is dense enough to be read twice.

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 destructive, non-open-world tool with a full schema and an output schema already present, the description covers the destructive aftermath, confirmation protocol, idempotent re-delete behavior, ordering relative to agent destruction, and auth requirements. Nothing essential to correct invocation is missing.

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 all three parameters are already documented, and the description only reinforces that the session should be named at confirmation time. It adds no format hints or edge cases for name/session/org_name beyond what the schema says.

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?

States a specific verb and resource — destroy one of an agent's conversation sessions — and immediately distinguishes the outcome from list_sessions (the session leaves that list). The reader knows exactly what is being removed and what remains (the transcript).

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

Usage Guidelines5/5

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

Gives explicit when/when-not guidance: confirm with the user first and name the session; sessions of a doomed agent must be destroyed first because no MCP tool can remove them afterwards. It also states the outcome for already-deleted sessions and other agents' sessions, which removes a common source of hesitation.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources