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
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | ||
| limit | No | ||
| text | No |
Implementation Reference
- src/mcp.ts:1228-1237 (handler)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' }, }, }, },
- src/types.ts:12-16 (schema)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), });