Skip to main content
Glama

search_icons

Find and retrieve icons from Lucide by name or category using partial matching, with optional filters and result limits for precise searches.

Instructions

Search for icons from lucide by name or category using partial matching

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNocategory to filter by (optional)
limitNoMax results to return
queryYesSearch term for icon name

Implementation Reference

  • Handler function for the 'search_icons' tool that performs partial matching on icon names, optionally filters by category, applies a limit, and returns a formatted text response with the results.
    async ({ query, category, limit }) => { let results = SearchService.filterIconsByName(iconMetadata, query); if (category) { results = SearchService.filterIconsByCategory(results, category); } results = SearchService.applyLimit(results, limit); return createTextResponse(results); }
  • Zod input schema defining parameters for the 'search_icons' tool: query (required string), category (optional string), limit (optional number with constraints).
    { query: z.string().describe("Search term for icon name"), category: z .string() .optional() .describe("category to filter by (optional)"), limit: searchSchemas.iconLimit.describe("Max results to return") },
  • src/utils.ts:86-107 (registration)
    Registration of the 'search_icons' tool using server.tool(), including name, description, input schema, and handler function.
    server.tool( "search_icons", "Search for icons from lucide by name or category using partial matching", { query: z.string().describe("Search term for icon name"), category: z .string() .optional() .describe("category to filter by (optional)"), limit: searchSchemas.iconLimit.describe("Max results to return") }, async ({ query, category, limit }) => { let results = SearchService.filterIconsByName(iconMetadata, query); if (category) { results = SearchService.filterIconsByCategory(results, category); } results = SearchService.applyLimit(results, limit); return createTextResponse(results); } );
  • SearchService helper method for filtering icons by partial name match (case-insensitive). Used in the search_icons handler.
    static filterIconsByName(icons: typeof iconMetadata, name: string) { return icons.filter((icon) => icon.name.toLowerCase().includes(name.toLowerCase()) ); }
  • SearchService helper method for filtering icons by partial category match (case-insensitive). Used conditionally in the search_icons handler.
    static filterIconsByCategory(icons: typeof iconMetadata, category: string) { return icons.filter((icon) => icon.categories.some((cat) => cat.toLowerCase().includes(category.toLowerCase()) ) ); }

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