Skip to main content
Glama

session_clear_all

DestructiveIdempotent

Clear all gateway session records, optionally filtering by provider, to reset session state and trigger asynchronous worktree cleanup.

Instructions

Delete all gateway session records, optionally scoped to one provider. The tool result confirms record deletion; worktree cleanup observers run asynchronously and may still be in progress. Worktree cleanup runs per session on the processing host for file-backed and PostgreSQL session managers. Both managers stage a caller-hidden cleanup tombstone before cleanup runs and retain a failed removal for retry by the host that owns the worktree, finalizing the record only once Git no longer registers the worktree, read back rather than inferred from the recorded path being absent. File-backed TTL eviction uses the same tombstone retry path. Deletion processed by a different host removes no worktree and leaves the owning host's record intact. The database-side cleanup_expired_sessions function stages the same tombstone instead of deleting a worktree-bearing session; it invokes no gateway observer and so attempts no removal itself. A tombstone is not bounded by retention.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cliNoProvider filter (claude|codex|gemini|grok|mistral|devin|cursor|grok-api)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.2.0
    • changedInput schema / properties / cli / description
      Previous value: -"Provider filter (claude|codex|gemini|grok|mistral|grok-api)"New value: +"Provider filter (claude|codex|gemini|grok|mistral|devin|cursor|grok-api)"
  2. First observedv2.16.0

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already indicate destructive and idempotent behavior, but the description adds substantial operational context: asynchronous worktree cleanup, per-host ownership, tombstone staging and retry, different-host semantics, and the fact that tombstones are not bounded by retention. This is exactly the context an agent needs before invoking a destructive bulk operation.

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?

The description is front-loaded with the core action and then layers necessary caveats. It is dense and jargon-heavy, which keeps it from a 5, but each sentence contributes meaningful behavioral detail for a destructive, asynchronous operation.

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 one-parameter tool with no output schema, the description covers the result ('confirms record deletion'), the asynchronous cleanup caveat, host routing effects, and the retention edge case. An agent has enough information to predict side effects and know what to expect after calling it.

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 documents the single cli parameter with an enum and 'Provider filter' description. The description adds the important default behavior: with no parameter, the tool deletes all records; with cli, it is scoped to one provider. That semantic is not explicit in 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 opens with a specific verb and resource: 'Delete all gateway session records, optionally scoped to one provider.' The word 'all' clearly distinguishes it from per-session tools like session_delete, and the optional provider scope defines the tool's breadth precisely.

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?

The description gives no explicit guidance about when to use this tool versus alternatives, nor does it warn about when not to use it. The only usage cue is 'optionally scoped to one provider,' which is a filtering option rather than a selection rule.

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