aspro_search
Search for modules, entities, methods by substring in name, path, description, or tags. Find what you need without knowing the exact name.
Instructions
Substring search across module/entity/method/path/description/tags. Useful when you don't know the exact module or entity name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Substring to search for, case-insensitive. | |
| limit | No | Max results (default 30). |
Implementation Reference
- src/index.ts:97-111 (handler)Tool registration and handler for 'aspro_search'. Calls spec.search() with the provided query and optional limit, then returns results as JSON.
server.registerTool( "aspro_search", { description: "Substring search across module/entity/method/path/description/tags. Useful when you don't know the exact module or entity name.", inputSchema: { query: z.string().min(1).describe("Substring to search for, case-insensitive."), limit: z.number().int().positive().max(200).optional().describe("Max results (default 30)."), }, }, async ({ query, limit }) => { const ops = spec.search(query, limit ?? 30); return asJson({ count: ops.length, operations: ops.map(summarizeOp) }); }, ); - src/index.ts:102-105 (schema)Input schema for aspro_search: requires a 'query' string (min length 1) and an optional 'limit' integer (positive, max 200, default 30).
inputSchema: { query: z.string().min(1).describe("Substring to search for, case-insensitive."), limit: z.number().int().positive().max(200).optional().describe("Max results (default 30)."), }, - src/index.ts:97-111 (registration)Tool registered with the MCP server under the name 'aspro_search'.
server.registerTool( "aspro_search", { description: "Substring search across module/entity/method/path/description/tags. Useful when you don't know the exact module or entity name.", inputSchema: { query: z.string().min(1).describe("Substring to search for, case-insensitive."), limit: z.number().int().positive().max(200).optional().describe("Max results (default 30)."), }, }, async ({ query, limit }) => { const ops = spec.search(query, limit ?? 30); return asJson({ count: ops.length, operations: ops.map(summarizeOp) }); }, ); - src/spec.ts:184-204 (helper)The search() method on SpecIndex class performs a case-insensitive substring search across module, entity, method, path, description, and tags of all operations. Results are sorted by index position and limited.
search(query: string, limit = 30): OperationSpec[] { const q = query.toLowerCase().trim(); if (!q) return []; const results: { score: number; op: OperationSpec }[] = []; for (const op of this.operations) { const haystack = [ op.module, op.entity, op.method, op.path, op.description ?? "", op.tags.join(" "), ] .join(" ") .toLowerCase(); const idx = haystack.indexOf(q); if (idx >= 0) results.push({ score: idx, op }); } results.sort((a, b) => a.score - b.score); return results.slice(0, limit).map((r) => r.op); }