Skip to main content
Glama

get_thought_stats

Analyze and evaluate your thinking process by retrieving statistical insights from recorded thoughts during the current session with structured reasoning support.

Instructions

Get statistics about the thoughts recorded in the current session to analyze your thinking process.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the get_thought_stats tool. Computes statistics like total thoughts, average length, longest thought details from the thoughtsLog and returns as JSON.
    async () => { if (this.thoughtsLog.length === 0) { return { content: [{ type: "text", text: "No thoughts have been recorded yet." }] }; } const totalThoughts = this.thoughtsLog.length; const avgLength = this.thoughtsLog.reduce((sum, entry) => sum + entry.thought.length, 0) / totalThoughts; let longestThoughtIndex = 0; let longestThoughtLength = 0; this.thoughtsLog.forEach((entry, index) => { if (entry.thought.length > longestThoughtLength) { longestThoughtLength = entry.thought.length; longestThoughtIndex = index; } }); const stats = { total_thoughts: totalThoughts, average_length: Math.round(avgLength * 100) / 100, longest_thought_index: longestThoughtIndex + 1, longest_thought_length: longestThoughtLength }; return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] }; }
  • src/index.ts:89-124 (registration)
    Registration of the get_thought_stats tool via this.server.tool(), including name, description, and inline handler (no input schema).
    // Register the get_thought_stats tool this.server.tool( "get_thought_stats", "Get statistics about the thoughts recorded in the current session to analyze your thinking process.", async () => { if (this.thoughtsLog.length === 0) { return { content: [{ type: "text", text: "No thoughts have been recorded yet." }] }; } const totalThoughts = this.thoughtsLog.length; const avgLength = this.thoughtsLog.reduce((sum, entry) => sum + entry.thought.length, 0) / totalThoughts; let longestThoughtIndex = 0; let longestThoughtLength = 0; this.thoughtsLog.forEach((entry, index) => { if (entry.thought.length > longestThoughtLength) { longestThoughtLength = entry.thought.length; longestThoughtIndex = index; } }); const stats = { total_thoughts: totalThoughts, average_length: Math.round(avgLength * 100) / 100, longest_thought_index: longestThoughtIndex + 1, longest_thought_length: longestThoughtLength }; return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] }; } );
  • Interface defining ThoughtRecord used by get_thought_stats and other tools to structure log entries.
    interface ThoughtRecord { timestamp: string; thought: string; }

Other Tools

Related 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/cgize/claude-mcp-think-tool'

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