Skip to main content
Glama

get_icon_repos

Retrieve all available icon repository names from the Iconify API for designers and developers to access SVG icons through natural language requests.

Instructions

get all icon repo NAME

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_icon_repos' tool. It calls getIconRepoNames() to fetch icon repositories and returns their names as a JSON string in the response content, or an error message if failed.
    server.tool("get_icon_repos", "get all icon repo NAME", {}, async () => { const allRepos = await getIconRepoNames(); if (!allRepos) { return { content: [ { type: "text", text: "Failed to Get Repo Infos", }, ], }; } return { content: [ { type: "text", text: JSON.stringify(Object.keys(allRepos)), }, ], }; });
  • src/index.ts:24-46 (registration)
    Registration of the 'get_icon_repos' tool using server.tool(), including empty schema {} and inline handler.
    server.tool("get_icon_repos", "get all icon repo NAME", {}, async () => { const allRepos = await getIconRepoNames(); if (!allRepos) { return { content: [ { type: "text", text: "Failed to Get Repo Infos", }, ], }; } return { content: [ { type: "text", text: JSON.stringify(Object.keys(allRepos)), }, ], }; });
  • Helper function getIconRepoNames() that fetches the list of all icon repositories from the Iconify API.
    /** get all icon repo names */ export async function getIconRepoNames<T>(): Promise<T | null> { try { const res = await fetch(`https://api.iconify.design/collections`, { method: "GET", }); if (!res.ok) { throw new Error(`HTTP error! status: ${res.status}`); } return (await res.json()) as T; } catch (error) { console.error("Error making request:", error); return null; } }

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