Skip to main content
Glama

list_all_icons

Retrieve all icons from the Heroicons library, with optional filtering by style (solid or outline), to streamline icon selection and integration.

Instructions

List all icons from the heroicons library, optionally filtered by style

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleNoIcon style: solid or outline (optional)

Implementation Reference

  • Handler function for list_all_icons tool. Filters iconMeta by optional style parameter, limits to 1000 icons, and returns their names as JSON text content.
    async ({ style }) => { // Limit to 1000 icons for safety let results = iconMeta; if (style) { results = results.filter((icon) => icon.style === style); } const names = results.slice(0, 1000).map((icon) => icon.name); return { content: [ { type: "text", text: JSON.stringify(names, null, 2) } ] }; }
  • Input schema for list_all_icons tool, defining an optional 'style' parameter.
    { style: z .enum(["solid", "outline"]) .optional() .describe("Icon style: solid or outline (optional)")
  • src/utils.ts:182-207 (registration)
    Registration of the list_all_icons tool on the MCP server using server.tool, including description, schema, and inline handler.
    server.tool( "list_all_icons", "List all icons from the heroicons library, optionally filtered by style", { style: z .enum(["solid", "outline"]) .optional() .describe("Icon style: solid or outline (optional)") }, async ({ style }) => { // Limit to 1000 icons for safety let results = iconMeta; if (style) { results = results.filter((icon) => icon.style === style); } const names = results.slice(0, 1000).map((icon) => icon.name); return { content: [ { type: "text", text: JSON.stringify(names, null, 2) } ] }; } );
  • Precomputed array of all icon metadata (name, style, categories), used by the list_all_icons handler.
    export const iconMeta = [ ...allIcons.solid.map((name) => ({ name, style: "solid", categories: categorizeIcon(name) })), ...allIcons.outline.map((name) => ({ name, style: "outline", categories: categorizeIcon(name) })) ];
  • Helper function that extracts all icon names from heroicons imports, used to build iconMeta.
    export const getAllIcons = () => { // Only keep keys ending with 'Icon' const solid = Object.keys(solidIcons).filter((k) => k.endsWith("Icon")); const outline = Object.keys(outlineIcons).filter((k) => k.endsWith("Icon")); return { solid, outline }; };

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/heroicons-mcp'

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