Skip to main content
Glama

search_icons

Find icons by name or tags to enhance your designs. Enter search terms separated by commas to locate multiple icons simultaneously.

Instructions

Search for icons by name or tags. Use commas to search for multiple icons (e.g. 'home, notification, settings')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find relevant icons. Separate multiple searches with commas

Implementation Reference

  • MCP handler for the search_icons tool: validates input query and calls searchIcons utility to perform the search, returning JSON results.
    private async handleSearchIcons(args: any) {
      try {
        const query = this.validateSearchQuery(args);
        const results = await searchIcons(query);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(results, null, 2),
            },
          ],
        };
      } catch (error) {
        if (error && typeof error === 'object' && 'isAxiosError' in error) {
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to search icons: ${(error as any).message}`
          );
        }
        throw error;
      }
    }
  • src/index.ts:81-93 (registration)
    Registers the search_icons tool in the ListTools response, including name, description, and input schema.
      name: "search_icons",
      description: "Search for icons by name or tags. Use commas to search for multiple icons (e.g. 'home, notification, settings')",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Search query to find relevant icons. Separate multiple searches with commas",
          }
        },
        required: ["query"],
      },
    },
  • Input schema definition for the search_icons tool, specifying a required 'query' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "Search query to find relevant icons. Separate multiple searches with commas",
        }
      },
      required: ["query"],
    },
  • Core utility function implementing the icon search logic: queries Hugeicons search API, maps results to IconInfo format, handles errors gracefully.
    export async function searchIcons(searchQuery: string): Promise<IconInfo[]> {
        if (!searchQuery || !searchQuery.trim()) {
            return [];
        }
    
        try {
            const response = await axios.get<SearchApiResponse>(
                `https://search.hugeicons.com/search`,
                {
                    params: { q: searchQuery.trim() },
                    timeout: 10000, // 10 second timeout
                }
            );
    
            // Convert API results to our IconInfo format
            return response.data.results.map(result => ({
                id: result.id,
                name: result.name,
                tags: result.tags, // Keep as array to match IconInfo interface
                category: result.category,
                featured: result.featured,
                version: result.version,
            }));
        } catch (error) {
            console.error('Failed to search icons:', error);
            
            // If API fails, return empty results rather than throwing
            // This ensures the MCP server doesn't crash if the search API is down
            return [];
        }
    } 
  • Input validation helper for search_icons query parameter.
    private validateSearchQuery(args: any): string {
      if (!args || typeof args.query !== "string" || !args.query.trim()) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          "Search query must be a non-empty string"
        );
      }
      return args.query.trim();
    }
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 describes the search functionality but lacks details on behavioral traits such as whether the search is case-sensitive, how results are returned (e.g., pagination, format), rate limits, or error handling. The description adds minimal context beyond the basic action, leaving gaps in understanding how the tool behaves.

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 concise and well-structured in two sentences: the first states the purpose, and the second provides usage guidance with an example. Every sentence earns its place by adding clarity and practical information without unnecessary details, making it front-loaded and efficient.

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 moderate complexity (a search function with one parameter) and no output schema or annotations, the description is adequate but incomplete. It covers the basic purpose and parameter usage but lacks details on output format, error cases, or integration with sibling tools. For a search tool without structured output information, more context on what to expect from results would improve completeness.

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?

The input schema has 100% description coverage, with the 'query' parameter documented as 'Search query to find relevant icons. Separate multiple searches with commas.' The description adds value by providing an example ('e.g., 'home, notification, settings'') that clarifies the format for multiple searches, but it does not significantly expand on the schema's semantics. With high schema coverage, the baseline is 3, as the description compensates slightly but not substantially.

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 tool's purpose: 'Search for icons by name or tags.' It specifies the verb ('Search') and resource ('icons'), and mentions the search criteria ('by name or tags'). However, it does not explicitly differentiate from sibling tools like 'list_icons' or 'get_icon_glyphs', which might offer alternative ways to retrieve 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 provides implied usage guidance by mentioning how to search for multiple icons ('Use commas to search for multiple icons'), which suggests this tool is for filtered searches. However, it does not explicitly state when to use this tool versus alternatives like 'list_icons' (which might list all icons without filtering) or 'get_icon_glyphs' (which might retrieve specific icon data). No exclusions or clear alternatives are named.

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

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/hugeicons/mcp-server'

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