Skip to main content
Glama

index-list-keys

List and count known keys in MCP Index Notes to organize and manage indexed data, enabling efficient retrieval and analysis of tagged and semantic connections.

Instructions

List known keys and counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • Tool handler for 'index-list-keys': parses optional limit parameter (1-500, default 100), calls db.listKeys() with the limit, and returns the result as JSON array of {key: string, count: number}.
    case 'index-list-keys': { const parsed = z.object({ limit: z.number().positive().max(500).optional().default(100) }).parse(args ?? {}); const keys = db.listKeys(parsed.limit); return { content: [{ type: 'text', text: JSON.stringify(keys) }] }; }
  • src/mcp.ts:154-158 (registration)
    Registers the MCP tool 'index-list-keys' in the tools array provided to the MCP server, including name, description, and input schema for optional 'limit' parameter.
    { name: 'index-list-keys', description: 'List known keys and counts.', inputSchema: { type: 'object', properties: { limit: { type: 'number' } } }, },
  • JSON schema definition for the tool input: object with optional 'limit' number property.
    inputSchema: { type: 'object', properties: { limit: { type: 'number' } } },
  • Implementation of listKeys in NotesDB (SQLite): SQL query groups notes by key, counts occurrences, orders by descending count then ascending key, limits results, returns array of {key, count}.
    listKeys(limit = 100) { const rows = this.db.prepare(`SELECT key, COUNT(*) as count FROM notes GROUP BY key ORDER BY count DESC, key ASC LIMIT ?`).all(limit); return rows as Array<{ key: string; count: number }>; }
  • TypeScript interface INotesStore defines the listKeys method signature used by all store implementations.
    listKeys(limit?: number): Array<{ key: string; count: number }>;

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/vjsr007/mcp-index-notes'

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