Skip to main content
Glama

index-query

Query and retrieve indexed notes by specific keys or full-text search. Quickly find relevant information and organize data efficiently using advanced search capabilities.

Instructions

Query notes by key or full-text search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNo
limitNo
textNo

Implementation Reference

  • Handler for 'index-query' tool: validates input with QuerySchema, retrieves notes by key using db.getByKey or performs full-text search using db.search based on parameters, limits results, and returns JSON array of matching notes.
    case 'index-query': { const parsed = QuerySchema.parse(args ?? {}); let result: any[] = []; if (parsed.key) { result = db.getByKey(parsed.key, parsed.limit); } else if (parsed.text) { result = db.search(parsed.text, parsed.limit); } return { content: [{ type: 'text', text: JSON.stringify(result) }] }; }
  • src/mcp.ts:111-121 (registration)
    Registration of the 'index-query' tool in the MCP server, defining name, description, and basic input schema.
    name: 'index-query', description: 'Query notes by key or full-text search.', inputSchema: { type: 'object', properties: { key: { type: 'string' }, text: { type: 'string' }, limit: { type: 'number' }, }, }, },
  • Zod validation schema (QuerySchema) used by the index-query handler for input parsing, defining optional key/text for query, and limit up to 100 with default 10.
    export const QuerySchema = z.object({ key: z.string().optional(), text: z.string().optional(), limit: z.number().int().positive().max(100).optional().default(10), });

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