Skip to main content
Glama

fuzzy_search_categories

Find Lucide Icons categories using fuzzy search by entering a query term and specifying the number of results to display. Simplifies locating relevant icon categories efficiently.

Instructions

Fuzzy Search for icon categories by category name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results to return
queryYesSearch term for category name

Implementation Reference

  • The inline async handler function for the fuzzy_search_categories tool. It creates a Fuse.js searcher on the categories data, performs fuzzy search with the query, applies the optional limit to results, and returns a formatted text response.
    async ({ query, limit }) => { const fuse = SearchService.createFuseSearch(categories, ["name"]); let results = fuse.search(query); results = SearchService.applyLimit(results, limit); return createTextResponse(results); }
  • Zod schema defining the input parameters: required 'query' string and optional 'limit' number (validated via shared schema).
    { query: z.string().describe("Search term for category name"), limit: searchSchemas.categoryLimit.describe("Max results to return") },
  • src/utils.ts:141-154 (registration)
    Registration of the 'fuzzy_search_categories' tool on the MCP server, including name, description, schema, and handler.
    server.tool( "fuzzy_search_categories", "Fuzzy Search for icon categories by category name", { query: z.string().describe("Search term for category name"), limit: searchSchemas.categoryLimit.describe("Max results to return") }, async ({ query, limit }) => { const fuse = SearchService.createFuseSearch(categories, ["name"]); let results = fuse.search(query); results = SearchService.applyLimit(results, limit); return createTextResponse(results); } );
  • Static helper method in SearchService that initializes a Fuse.js instance for fuzzy searching on the given data and keys, case-insensitive.
    static createFuseSearch<T>(data: T[], keys: string[]) { return new Fuse(data, { keys, isCaseSensitive: false }); }
  • Utility function to create a standard MCP text response by stringifying the data as pretty JSON.
    const createTextResponse = (data: any) => ({ content: [ { type: "text" as const, text: JSON.stringify(data, null, 2) } ] });

Other Tools

Related Tools

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/SeeYangZhi/lucide-icons-mcp'

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