list_icons
Retrieve a comprehensive list of all available icons within the Hugeicons library for easy integration and selection in your projects.
Instructions
Get a list of all available Hugeicons icons
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:281-301 (handler)The main handler function that loads the icons cache if necessary and returns the full list of icons as JSON-formatted text content.private async handleListIcons() { try { await this.ensureIconsLoaded(); return { content: [ { type: "text", text: JSON.stringify(this.iconsCache, null, 2), }, ], }; } catch (error) { if (error && typeof error === 'object' && 'isAxiosError' in error) { throw new McpError( ErrorCode.InternalError, `Failed to list icons: ${(error as any).message}` ); } throw error; } }
- src/index.ts:74-78 (schema)Input schema definition for the list_icons tool, specifying no required parameters.inputSchema: { type: "object", properties: {}, required: [], },
- src/index.ts:71-79 (registration)Tool registration in the ListToolsRequest handler, defining name, description, and input schema.{ name: "list_icons", description: "Get a list of all available Hugeicons icons", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/index.ts:157-158 (registration)Dispatch registration in the CallToolRequest switch statement, routing list_icons calls to the handler.case "list_icons": return await this.handleListIcons();
- src/index.ts:495-507 (helper)Helper method used by the handler to load and cache the complete list of icons from the external API.private async ensureIconsLoaded() { if (this.iconsCache) return; try { const response = await axios.get<{ icons: IconInfo[] }>("https://hugeicons.com/api/icons"); this.iconsCache = response.data.icons; } catch (error) { throw new McpError( ErrorCode.InternalError, "Failed to load icons data" ); } }