Skip to main content
Glama

get_currency_listings

Fetch up-to-date cryptocurrency listings from the Coinmarket API. Use this tool to retrieve comprehensive data on available digital currencies for analysis or integration.

Instructions

Get latest cryptocurrency listings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that fetches the latest cryptocurrency listings from the CoinMarketCap API, limited to 5 entries in USD.
    async def get_currency_listings() -> dict[str, Any]: url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest' parameters = { 'start':'1', 'limit':'5', 'convert':'USD' } headers = { 'Accepts': 'application/json', 'X-CMC_PRO_API_KEY': API_KEY, } response = requests.get(url, headers=headers, params=parameters) response.raise_for_status() data = json.loads(response.text) return data
  • Registration of the 'get_currency_listings' tool in the list_tools handler, including name, description, and empty input schema.
    types.Tool( name="get_currency_listings", description="Get latest cryptocurrency listings", inputSchema={ "type": "object", "properties": {}, "required": [], }, ),
  • Tool execution handler within @server.call_tool() that invokes get_currency_listings and returns the JSON-formatted result as TextContent.
    case "get_currency_listings": try: data = await get_currency_listings() return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch data: {e}")
  • Input schema definition for the get_currency_listings tool: an empty object with no required properties.
    inputSchema={ "type": "object", "properties": {}, "required": [], },

Other Tools

Related 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/anjor/coinmarket-mcp-server'

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