Skip to main content
Glama
arjshiv

Local Utilities MCP Server

by arjshiv

get_thought_stats

Retrieve and analyze statistics about recorded thoughts, enabling users to track and evaluate patterns efficiently using the Local Utilities MCP Server interface.

Instructions

Get statistics about recorded thoughts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline anonymous handler function for the get_thought_stats tool. It computes statistics (total count, average content length, timestamps of oldest/newest) from the closure-captured thoughts array and returns a text content block with JSON-formatted stats.
    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) }] }; }
  • Registers the get_thought_stats tool on the MCP server within the registerThinkTool function. Specifies the tool name, description, and attaches the handler function. No input schema is defined (empty args).
    server.tool( "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) }] }; } );
  • TypeScript interface defining the shape of the statistics object returned by the get_thought_stats tool handler.
    export interface ThoughtStats { [key: string]: number | string | null; totalThoughts: number; averageLength: number; oldestThought: string | null; newestThought: string | null; }
  • src/index.ts:25-25 (registration)
    Top-level call to registerThinkTool which includes registration of get_thought_stats among other think-related tools.
    registerThinkTool(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/arjshiv/localutils-mcp-server'

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