search_categories
Search for Lucide Icons categories by name using partial matching. Specify a query and limit results to find relevant icon categories efficiently.
Instructions
Search for icon categories by category name using partial matching
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results to return | |
| query | Yes | Search term for category name |
Implementation Reference
- src/utils.ts:109-122 (registration)Full registration of the 'search_categories' MCP tool including name, description, input schema, and handler function.// Tool: search_categories server.tool( "search_categories", "Search for icon categories by category name using partial matching", { query: z.string().describe("Search term for category name"), limit: searchSchemas.categoryLimit.describe("Max results to return") }, async ({ query, limit }) => { let results = SearchService.filterCategories(query); results = SearchService.applyLimit(results, limit); return createTextResponse(results); } );
- src/utils.ts:117-121 (handler)The async handler function that executes the tool logic: filters categories by query using partial matching, applies limit, and returns formatted response.async ({ query, limit }) => { let results = SearchService.filterCategories(query); results = SearchService.applyLimit(results, limit); return createTextResponse(results); }
- src/utils.ts:113-116 (schema)Zod input schema defining 'query' (string) and optional 'limit' (number) parameters for the tool.{ query: z.string().describe("Search term for category name"), limit: searchSchemas.categoryLimit.describe("Max results to return") },
- src/utils.ts:49-53 (helper)SearchService helper method implementing the partial matching filter logic on the categories array.static filterCategories(categoryName: string) { return categories.filter((category) => category.name.toLowerCase().includes(categoryName.toLowerCase()) ); }
- src/utils.ts:29-29 (helper)Definition of categoryLimit schema used in the tool's input schema (max 50, default 10).categoryLimit: limitSchema(50, 10),