show_history
Retrieve the complete audit log of your multi-model AI planning sessions, including model used, CLI tool, round number, timestamps, and actions performed.
Instructions
Full audit log — which model, which CLI tool, which round, what time, what action
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelName | No | Your model name (optional) |
Implementation Reference
- src/server.ts:290-302 (registration)Registration of the 'show_history' tool on the MCP server, with description, optional modelName schema, and handler delegating to executeHistory.
// ─── show_history ───────────────────────────────────────────────── server.tool( "show_history", "Full audit log — which model, which CLI tool, which round, what time, what action", { modelName: z.string().optional().describe("Your model name (optional)"), }, async (params, extra) => { const identity = detectCaller(server.server.getClientVersion(), params.modelName); const formatted = await executeHistory(projectRoot, identity); return { content: [{ type: "text", text: formatted }] }; } ); - src/tools/history.ts:11-24 (handler)Handler function executeHistory that reads raw history log, logs the view action, and returns formatted output.
export async function executeHistory( projectRoot: string, identity: CallerIdentity ): Promise<string> { const raw = await readHistoryRaw(projectRoot); await logAction(projectRoot, identity.cliTool, identity.modelName, "history", "Viewed history log"); if (raw === "No history yet." || raw.trim().length === 0) { return "📜 No history entries yet. Actions will be logged as you use PolyPlan."; } return `📜 POLYPLAN HISTORY LOG\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n${raw}\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`; } - src/server.ts:294-296 (schema)Input schema for show_history: optional modelName string described as 'Your model name (optional)'.
{ modelName: z.string().optional().describe("Your model name (optional)"), }, - src/core/historyLogger.ts:84-92 (helper)Helper function readHistoryRaw that reads the raw .polyplan/history.log file from disk, returning 'No history yet.' on error.
export async function readHistoryRaw(projectRoot: string): Promise<string> { const logPath = path.join(projectRoot, HISTORY_FILE); try { return await fs.readFile(logPath, "utf-8"); } catch { return "No history yet."; } } - src/core/historyLogger.ts:41-61 (helper)Helper function logAction that appends a timestamped entry to the history log file.
export async function logAction( projectRoot: string, cliTool: string, modelName: string, action: string, details: string ): Promise<void> { await ensurePolyPlanDir(projectRoot); const logPath = path.join(projectRoot, HISTORY_FILE); const entry: HistoryEntry = { timestamp: new Date().toISOString(), cliTool, modelName, action, details, }; const line = formatEntry(entry) + "\n"; await fs.appendFile(logPath, line, "utf-8"); }