Skip to main content
Glama

Claude Desktop Commander MCP

history-handlers.ts1.2 kB
import { toolHistory } from '../utils/toolHistory.js'; import { GetRecentToolCallsArgsSchema } from '../tools/schemas.js'; import { ServerResult } from '../types.js'; /** * Handle get_recent_tool_calls command */ export async function handleGetRecentToolCalls(args: unknown): Promise<ServerResult> { try { const parsed = GetRecentToolCallsArgsSchema.parse(args); // Use formatted version with local timezone const calls = toolHistory.getRecentCallsFormatted({ maxResults: parsed.maxResults, toolName: parsed.toolName, since: parsed.since }); const stats = toolHistory.getStats(); // Format the response (excluding file path per user request) const summary = `Tool Call History (${calls.length} results, ${stats.totalEntries} total in memory)`; const historyJson = JSON.stringify(calls, null, 2); return { content: [{ type: "text", text: `${summary}\n\n${historyJson}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting tool history: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }

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/wonderwhy-er/DesktopCommanderMCP'

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