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
      };
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions listing and optional filtering but doesn't describe key behaviors such as pagination, rate limits, authentication requirements, or what the output format looks like (e.g., list of icon names, metadata). For a tool with no annotations, this leaves significant gaps in understanding how it operates.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('List all icons from the heroicons library') and adds an optional feature ('optionally filtered by style'). There is no wasted text, and it's appropriately sized for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 optional parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and parameter intent but lacks details on behavioral aspects like output format or usage constraints. For a listing tool, this is borderline acceptable but could be improved with more context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'style' fully documented in the schema (including enum values 'solid' or 'outline'). The description adds minimal value beyond the schema by mentioning 'optionally filtered by style', which aligns with the schema but doesn't provide additional context like default behavior if omitted or how filtering is applied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'all icons from the heroicons library', which provides a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'search_icons' or 'get_icon_usage_examples', which likely have different functions (searching vs listing, or getting usage examples vs listing icons).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning 'optionally filtered by style', suggesting this tool is for listing icons with optional style filtering. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_icons' (which might allow more complex queries) or 'get_icon_usage_examples' (which focuses on examples rather than listing).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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