Skip to main content
Glama

Purge Knowledge Base

ctx_purge

Permanently deletes indexed content for a specific session or entire project. Specify with confirm:true and either sessionId or scope:'project'.

Instructions

DESTRUCTIVE — permanently delete indexed content. CANNOT be undone.

You MUST specify exactly ONE scope:

• { confirm: true, sessionId: "" } Deletes ONLY that session's events + per-session FTS5 chunks. Preserves stats file and ALL other sessions.

• { confirm: true, scope: "project" } Wipes the ENTIRE project: FTS5 knowledge base, every session DB row, events markdown, AND resets the stats file.

REFUSAL RULES (tool returns an error): • confirm: false → 'purge cancelled' • Both sessionId AND scope:'project' provided → 'ambiguous — pick one' • scope:'session' without sessionId → throws (sessionId required) • Neither sessionId NOR scope provided → DEPRECATED: maps to scope:'project' with a deprecation warning to stderr. Will be a hard error in a future major.

Use sessionId when the user asks to clear a specific conversation's data. Use scope:'project' ONLY when the user explicitly asks to reset everything. NEVER call with bare {confirm:true} — always specify the scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmYesMUST be true. Destructive operation; false returns 'purge cancelled'.
sessionIdNoUUID of a single session. Pairs with confirm:true to wipe only that session's events + per-session FTS5 chunks. Sibling sessions and the stats file are preserved. MUST NOT be combined with scope:'project'.
scopeNoExplicit scope selector. 'session' REQUIRES sessionId. 'project' wipes the entire project (FTS5 + every session + stats). Omit only for the deprecated bare-{confirm:true} back-compat path.
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It fully discloses the destructive and irreversible nature, details what each scope deletes (e.g., sessions, FTS5 chunks, stats file), and explains error conditions and deprecated paths.

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 well-structured with a clear warning, enumerated scope options, refusal rules, and usage guidance. It is front-loaded with critical information, and every sentence serves a purpose without redundancy.

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?

Given the tool's complexity (3 parameters, deprecated behavior, no output schema), the description is complete. It covers all possible input combinations, error conditions, and usage scenarios, leaving no gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds substantial value beyond the schema by explaining exact effects of each parameter combination, providing usage examples, and detailing refusal rules. It transforms the schema from a list into a complete guide.

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 clearly states the tool's purpose: 'permanently delete indexed content. CANNOT be undone.' It specifies the resource (knowledge base, sessions, events, stats) and distinguishes between session-level and project-wide deletion.

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?

The description provides explicit when-to-use guidance: 'Use sessionId when the user asks to clear a specific conversation's data. Use scope:'project' ONLY when the user explicitly asks to reset everything.' It also includes refusal rules for common misuses and warns about deprecated behavior.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mksglu/context-mode'

If you have feedback or need assistance with the MCP directory API, please join our Discord server