Skip to main content
Glama
Leee62
by Leee62

get_icon_detail_by_prefix_and_name

Retrieve SVG icon details from the Iconify API by specifying a prefix and icon name. Use this tool to fetch exact icon data for single icons or batch process multiple icons with fuzzy matching.

Instructions

get icon detail by prefix and svg name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
svg_listNoicon svg name list, match batch of icons fuzzily
svg_nameNoicon svg name, match single icon exactly
prefixNoicon prefix, default env.PREFIX

Implementation Reference

  • MCP tool handler that handles single svg_name or batch svg_list by calling getIconByPrefixAndName and returning JSON stringified content.
    async ({
      svg_list,
      svg_name = "",
      prefix = process.env.PREFIX as string,
    }) => {
      if (svg_name) {
        const icon = await getIconByPrefixAndName(prefix, svg_name);
    
        if (!icon) {
          return {
            content: [
              {
                type: "text",
                text: "Failed to Get Icon",
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(icon),
            },
          ],
        };
      }
    
      const icons = await Promise.all(
        (svg_list || []).map((svg_name) =>
          getIconByPrefixAndName(prefix, svg_name)
        )
      );
    
      if (!icons) {
        return {
          content: [
            {
              type: "text",
              text: "Failed to Get Icon",
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(icons),
          },
        ],
      };
    }
  • Zod input schema defining parameters for the tool: svg_list (array), svg_name (string), prefix (string optional).
    {
      svg_list: z
        .array(z.string())
        .optional()
        .describe("icon svg name list, match batch of icons fuzzily"),
      svg_name: z
        .string()
        .optional()
        .describe("icon svg name, match single icon exactly"),
      prefix: z.string().optional().describe("icon prefix, default env.PREFIX"),
    },
  • src/index.ts:90-92 (registration)
    Registration of the MCP tool 'get_icon_detail_by_prefix_and_name' with description.
    server.tool(
      "get_icon_detail_by_prefix_and_name",
      "get icon detail by prefix and svg name",
  • Helper function that fetches the SVG icon content from Iconify API by prefix and name, returns text or null on error.
    /** get icon by prefix and svg name */
    export async function getIconByPrefixAndName<T>(
      prefix: string,
      svgName: string
    ): Promise<T | null> {
      try {
        const res = await fetch(
          `https://api.iconify.design/${prefix}/${svgName}.svg`,
          {
            method: "GET",
          }
        );
    
        if (!res.ok) {
          throw new Error(`HTTP error! status: ${res.status}`);
        }
        return (await res.text()) as T;
      } catch (error) {
        console.error("Error making request:", error);
        return null;
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but lacks behavioral details. It doesn't disclose if this is a read-only operation, what 'detail' includes (e.g., SVG data, metadata), error handling, or performance traits. The phrase 'get' implies retrieval, but no further context on permissions or side effects is given.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words. It's front-loaded and clear, though slightly under-specified. Every word contributes to the purpose, earning a high score for brevity and structure.

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

Completeness2/5

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

Given 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'icon detail' returns (e.g., SVG content, metadata), how parameters interact, or error cases. For a tool with this complexity and lack of structured data, more context is needed to guide effective use.

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%, so parameters are well-documented in the schema. The description adds minimal value by naming 'prefix and svg name' but omits 'svg_list' and doesn't explain the interaction between 'svg_name' and 'svg_list' (e.g., exclusive use). Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description 'get icon detail by prefix and svg name' clearly states the verb ('get') and resource ('icon detail'), but it's vague about what 'detail' entails (e.g., metadata, content, properties) and doesn't distinguish it from siblings like 'get_icon_repos' or 'get_icons_by_desc_and_desc'. It restates the tool name without adding specificity.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention siblings, prerequisites, or exclusions. For example, it doesn't clarify if this is for single vs. batch lookups or how it differs from 'get_icons_by_desc_and_prefix', leaving usage ambiguous.

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/Leee62/pickapicon-mcp'

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