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 }; }

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