Skip to main content
Glama
getNoteStats.ts1.79 kB
import { Tool } from "@modelcontextprotocol/sdk/types.js"; import { BearDB } from "../bearDB.js"; export const getNoteStatsTool: Tool = { name: "get_note_stats", description: "Get statistics about your Bear notes", inputSchema: { type: "object", properties: {} } }; export async function handleGetNoteStats(bearDB: BearDB, args: any) { try { const stats = bearDB.getNoteStatistics(); const response = `# Bear Notes Statistics ## Overview - **Total Notes:** ${stats.totalNotes} - **Pinned Notes:** ${stats.pinnedNotes} - **Notes with Tags:** ${stats.notesWithTags} - **Total Unique Tags:** ${stats.uniqueTags} - **Average Note Length:** ${Math.round(stats.averageNoteLength)} characters ## Activity - **Notes Created This Week:** ${stats.notesCreatedThisWeek} - **Notes Modified This Week:** ${stats.notesModifiedThisWeek} - **Notes Created This Month:** ${stats.notesCreatedThisMonth} - **Notes Modified This Month:** ${stats.notesModifiedThisMonth} ## Top Tags ${stats.topTags.map((tag: any, index: number) => `${index + 1}. **#${tag.name}** (${tag.noteCount} notes)` ).join('\n')} ## Note Length Distribution - **Very Short (<100 chars):** ${stats.noteLengthDistribution.veryShort} - **Short (100-500 chars):** ${stats.noteLengthDistribution.short} - **Medium (500-2000 chars):** ${stats.noteLengthDistribution.medium} - **Long (2000-5000 chars):** ${stats.noteLengthDistribution.long} - **Very Long (>5000 chars):** ${stats.noteLengthDistribution.veryLong}`; return { content: [{ type: "text", text: response }] }; } catch (error) { return { content: [{ type: "text", text: `Error getting statistics: ${error instanceof Error ? error.message : 'Unknown error'}` }] }; } }

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/quanticsoul4772/bear-mcp'

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