Skip to main content
Glama

clear_thinking_history

Clear all recorded thoughts and reset the server state to remove previous thinking history and start fresh.

Instructions

Clear all recorded thoughts and reset the server state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP CallToolRequest handler switch case for "clear_thinking_history" that calls thinkingServer.clearHistory() and returns success response.
    case "clear_thinking_history": { thinkingServer.clearHistory(); return { content: [{ type: "text", text: JSON.stringify({ status: "success", message: "Thinking history cleared" }) }] }; }
  • Core implementation of clearing the thinking history: resets thoughtHistory array, branches object, calls memoryManager.clear(), and nulls activeBranchId.
    clearHistory(): void { this.thoughtHistory = []; this.branches = {}; this.memoryManager.clear(); this.activeBranchId = null; }
  • Tool schema definition including name, description, empty parameters schema, and inputSchema.
    export const clearThinkingHistoryTool: Tool = { name: "clear_thinking_history", description: "Clear all recorded thoughts and reset the server state.", parameters: emptySchema, inputSchema: zodToInputSchema(emptySchema) };
  • src/tools.ts:83-89 (registration)
    Registration of the clearThinkingHistoryTool in the exported array of all tools, used by listTools handler.
    export const toolDefinitions = [ captureThoughtTool, reviseThoughtTool, retrieveRelevantThoughtsTool, getThinkingSummaryTool, clearThinkingHistoryTool ];
  • MemoryManager helper method that clears short-term buffer and long-term storage, called by clearHistory.
    clear(): void { this.shortTermBuffer = []; this.longTermStorage = {}; }

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/Promptly-Technologies-LLC/mcp-structured-thinking'

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