Skip to main content
Glama

clear_session

Destructive

Irreversibly clear a session's conversation history, emptying it so the agent forgets prior messages. Returns SESSION_BUSY if a turn is active; requires HTTP transport.

Instructions

Limpa o histórico de uma conversa (IRREVERSÍVEL — a conversa continua existindo, vazia; o agente esquece o que foi dito). Recusa com SESSION_BUSY se há um turno em andamento (tente depois) e com SERVICE_UNAVAILABLE se a trava (Redis) está fora — no transporte stdio local não há Redis, então a limpeza fica indisponível ali (use o servidor HTTP). Mesma regra do console (POST /sessions/:id/clear).

Input Schema

NameRequiredDescriptionDefault
session_idYessession_id (texto) ou id UUID da sessão

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.3

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds substantial context: the exact destructive effect (history erased irreversibly, session object retained), the failure modes with their error codes, and the infrastructure dependency (Redis lock, unavailable over stdio). This is well beyond what the structured fields convey.

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 irreversible effect is front-loaded and the sentence is dense with useful detail rather than filler. It is somewhat crowded with parentheticals and error-code enumerations, but nothing is clearly redundant.

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 destructive single-parameter tool with no output schema, the description covers effect, irreversibility, error conditions, and transport limitations. It does not say what a successful call returns (e.g., an empty history or a status object), which is the main remaining gap.

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 coverage is 100% and the single session_id parameter is already documented in the schema, including that it accepts either a plain string or a UUID. The description adds no further parameter meaning, so the baseline of 3 applies.

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 states a specific verb and resource ('Limpa o histórico de uma conversa') and immediately clarifies the resulting state — the conversation still exists but is empty and the agent forgets prior turns. That distinguishes it from sibling tools like archive_session or delete_agent_memory without needing their schemas.

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

Usage Guidelines4/5

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

It gives concrete usage conditions: retry later on SESSION_BUSY, and use the HTTP server instead of stdio because the Redis lock is absent there. It does not explicitly contrast with archive_session or explain when clearing is preferable to archiving, which keeps it below a 5.

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