Skip to main content
Glama
arjshiv

Local Utilities MCP Server

by arjshiv

get_thought_stats

Retrieve statistics about recorded thoughts to analyze patterns and usage data from the Local Utilities MCP Server.

Instructions

Get statistics about recorded thoughts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline async handler for get_thought_stats tool: computes stats from thoughts array (total count, average content length, timestamps) and returns JSON-formatted text content.
      const totalThoughts = thoughts.length;
      let statsData; // Renamed to avoid conflict with exported interface
    
      if (totalThoughts === 0) {
        statsData = {
          totalThoughts: 0,
          averageLength: 0,
          oldestThought: null,
          newestThought: null
        };
      } else {
        const averageLength = thoughts.reduce((acc, thought) =>
          acc + thought.content.length, 0) / totalThoughts;
        statsData = {
          totalThoughts,
          averageLength: parseFloat(averageLength.toFixed(2)),
          oldestThought: thoughts[0].timestamp,
          newestThought: thoughts[thoughts.length - 1].timestamp
        };
      }
      
      return {
        content: [{
          type: "text",
          text: JSON.stringify(statsData, null, 2)
        }]
      };
    }
  • Registers the "get_thought_stats" MCP tool on the server without input parameters.
      "get_thought_stats",
      "Get statistics about recorded thoughts",
      async () => {
        const totalThoughts = thoughts.length;
        let statsData; // Renamed to avoid conflict with exported interface
    
        if (totalThoughts === 0) {
          statsData = {
            totalThoughts: 0,
            averageLength: 0,
            oldestThought: null,
            newestThought: null
          };
        } else {
          const averageLength = thoughts.reduce((acc, thought) =>
            acc + thought.content.length, 0) / totalThoughts;
          statsData = {
            totalThoughts,
            averageLength: parseFloat(averageLength.toFixed(2)),
            oldestThought: thoughts[0].timestamp,
            newestThought: thoughts[thoughts.length - 1].timestamp
          };
        }
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(statsData, null, 2)
          }]
        };
      }
    );
  • Interface defining the structure of thought statistics output (totalThoughts, averageLength, oldestThought, newestThought).
    export interface ThoughtStats {
      [key: string]: number | string | null;
      totalThoughts: number;
      averageLength: number;
      oldestThought: string | null;
      newestThought: string | null;
    }
  • getThoughtStats method in ThinkToolInternalLogic class implementing identical stats computation logic (not used in tool handler).
    getThoughtStats(): ThoughtStats {
      const totalThoughts = this.thoughts.length;
      
      if (totalThoughts === 0) {
        return {
          totalThoughts: 0,
          averageLength: 0,
          oldestThought: null,
          newestThought: null
        };
      }
    
      const averageLength = this.thoughts.reduce((acc, thought) => 
        acc + thought.content.length, 0) / totalThoughts;
    
      return {
        totalThoughts,
        averageLength: parseFloat(averageLength.toFixed(2)), // Keep formatted
        oldestThought: this.thoughts[0].timestamp,
        newestThought: this.thoughts[this.thoughts.length - 1].timestamp
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves statistics, implying a read-only operation, but doesn't specify what types of statistics are included (e.g., counts, averages, trends), whether authentication is required, or if there are rate limits. This leaves significant gaps in understanding the tool's behavior beyond its basic purpose.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized for a simple tool with no parameters, and every part of the sentence contributes to understanding what the tool does.

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

Completeness2/5

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

Given the tool's simplicity (0 parameters, no output schema), the description is minimally adequate but lacks completeness. It doesn't explain what 'statistics' entail or provide context about the thought system, which could help an agent use it effectively. With no annotations and no output schema, more detail on the return format or behavioral constraints would improve completeness.

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 with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds no parameter information, which is appropriate given there are no parameters to explain. A baseline of 4 is assigned since no compensation is needed for missing parameter documentation.

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') and resource ('statistics about recorded thoughts'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_thoughts' or 'clear_thoughts', which would require more specificity about what distinguishes statistical retrieval from other thought-related operations.

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 provided about when to use this tool versus alternatives like 'get_thoughts' (which might retrieve the actual thoughts rather than statistics) or 'clear_thoughts' (which modifies thoughts). The description offers no context about appropriate use cases or exclusions, leaving the agent to infer usage from the tool name alone.

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/arjshiv/localutils-mcp-server'

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