Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
modelNameNoYour 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 }] };
      }
    );
  • 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━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`;
    }
  • Input schema for show_history: optional modelName string described as 'Your model name (optional)'.
    {
      modelName: z.string().optional().describe("Your model name (optional)"),
    },
  • 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.";
      }
    }
  • 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");
    }
Behavior3/5

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

The description lists the fields in the audit log (model, CLI tool, round, time, action) but does not disclose whether it is read-only, has pagination, or any side effects. With no annotations provided, the description partially fills the transparency gap but is insufficient for full behavioral understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that directly states the tool's output. It is concise with no extraneous words, though the use of em-dashes and commas makes it slightly less structured but still effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one optional param, no output schema, no annotations), the description covers the main purpose and content. However, it omits how the optional modelName parameter works and does not specify the return format (e.g., list, table). Adequate but not complete.

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

Parameters3/5

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

The input schema has 100% description coverage for its one parameter (modelName), so baseline is 3. The tool description does not mention the parameter or explain how modelName filters the history. No added value beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it shows a full audit log listing model, CLI tool, round, time, and action. It identifies the tool's purpose as viewing history. However, it does not differentiate from other 'show' tools in the sibling list (e.g., show_status, show_summary), lacking explicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use show_history versus alternatives. There is no mention of use cases, exclusions, or comparisons to sibling tools. The agent receives no context about appropriate scenarios.

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/IMAFDI/polyplan-mcp'

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