Skip to main content
Glama

handoff_clear

Clear specific or all conversation handoffs to manage transferred context between AI chats and projects, removing stored conversation histories.

Instructions

Clear handoffs. If key is provided, clears only that handoff. Otherwise clears all.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoOptional: specific handoff key to clear

Implementation Reference

  • Main tool handler for handoff_clear. Executes audit logging, calls storage.clear() with optional key, and formats success/error response messages with count of cleared items.
    async ({ key }) => { const audit = getAuditLogger(); const timer = audit.startTimer(); const { storage } = await getStorage(); const result = await storage.clear(key); audit.logTool({ event: "tool_call", toolName: "handoff_clear", durationMs: timer.elapsed(), success: result.success, error: result.error, }); if (!result.success) { return { content: [ { type: "text", text: `❌ ${result.error}`, }, ], }; } const message = key ? `✅ ${result.data?.message}` : `✅ ${result.data?.message} (${result.data?.count} items)`; return { content: [ { type: "text", text: message, }, ], }; }
  • src/index.ts:453-458 (registration)
    Tool registration for handoff_clear. Defines tool name, description, and input schema using zod (optional 'key' parameter).
    server.tool( "handoff_clear", "Clear handoffs. If key is provided, clears only that handoff. Otherwise clears all.", { key: z.string().optional().describe("Optional: specific handoff key to clear"), },
  • LocalStorage.clear() method implementation. Deletes a specific handoff if key provided, or clears all handoffs from the Map. Returns success message with optional count of cleared items.
    async clear(key?: string): Promise<StorageResult<{ message: string; count?: number }>> { if (key) { if (this.handoffs.has(key)) { this.handoffs.delete(key); return { success: true, data: { message: `Handoff cleared: "${key}"` } }; } return { success: false, error: `Handoff not found: "${key}"` }; } const count = this.handoffs.size; this.handoffs.clear(); return { success: true, data: { message: "All handoffs cleared", count } }; }
  • RemoteStorage.clear() method implementation. Sends HTTP DELETE requests to server - either to /handoff/{key} for specific handoff or /handoff for all handoffs.
    async clear(key?: string): Promise<StorageResult<{ message: string; count?: number }>> { if (key) { return this.request("DELETE", `/handoff/${encodeURIComponent(key)}`); } return this.request("DELETE", "/handoff"); }

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/trust-delta/conversation-handoff-mcp'

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