Skip to main content
Glama
cgize

MCP Think Tool Server

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;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'statistics' and 'analyze your thinking process', which gives some behavioral context, but lacks details on what statistics are returned (e.g., counts, trends, metrics), whether it's read-only or has side effects, or any limitations (e.g., session scope). For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, well-structured sentence that efficiently conveys the tool's purpose and usage context. It is front-loaded with the core action ('Get statistics') and avoids unnecessary words. Every part of the sentence earns its place by adding value.

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 complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does and its context, but lacks details on behavioral aspects (e.g., what statistics are returned, any side effects) that would be needed for full understanding. Without annotations or output schema, the description should do more to compensate, but it meets a basic threshold.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description does not need to add parameter semantics, and it appropriately does not mention any. With no parameters, the baseline is 4, as there is nothing to compensate for.

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 the verb ('Get statistics') and resource ('thoughts recorded in the current session'), and specifies the purpose ('to analyze your thinking process'). It distinguishes from 'get_thoughts' (likely listing thoughts) and 'think' (likely generating thoughts), though not explicitly. It avoids tautology by providing meaningful context beyond the tool name.

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

Usage Guidelines3/5

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

The description implies usage context ('recorded in the current session') and purpose ('analyze your thinking process'), suggesting when to use this tool. However, it does not explicitly state when to use it versus alternatives like 'get_thoughts' or 'clear_thoughts', nor does it provide exclusions or prerequisites. The guidance is implied rather than explicit.

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

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