list_icons
Retrieve all available Hugeicons icons for integration into platforms. This tool provides a complete list to help developers find and use appropriate icons in their projects.
Instructions
Get a list of all available Hugeicons icons
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:282-302 (handler)The main handler function that executes the list_icons tool logic: ensures icons are cached/loaded from API and returns the JSON-formatted list.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:71-79 (registration)Tool registration in ListToolsRequestSchema 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:158-159 (registration)Dispatch routing in CallToolRequestSchema handler to the list_icons handler function.case "list_icons": return await this.handleListIcons();
- src/index.ts:74-78 (schema)Input schema definition for the list_icons tool (empty object, no required parameters).inputSchema: { type: "object", properties: {}, required: [], },
- src/index.ts:497-509 (helper)Supporting helper function to load and cache the full list of icons from the external API, called by the handler.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" ); } }