Skip to main content
Glama

Currency Converter MCP

by wesbos

get_currencies

Retrieve a comprehensive list of available currencies for real-time or historical conversion using the Currency Converter MCP server, supporting global financial calculations.

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The handler function that fetches the list of currencies from the Frankfurter API and returns them as a JSON string in a ToolResponse.
    export async function getCurrencies( _input: GetCurrenciesInput, ): Promise<ToolResponse> { try { const url = `${FRANKFURTER_API_BASE}/currencies`; const response = await fetch(url); if (!response.ok) { return { content: [ { type: "text", text: `Error: Unable to fetch currencies. Status: ${response.status}`, }, ], }; } const data = (await response.json()) as CurrenciesResponse; return { content: [ { type: "text", text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error: Failed to fetch currencies - ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } }
  • The schema for the get_currencies tool, which is empty as it requires no input.
    export const getCurrenciesSchema = {};
  • src/index.ts:33-35 (registration)
    Registration of the get_currencies tool in the MCP server, linking the schema and handler.
    this.server.tool("get_currencies", getCurrenciesSchema, async (input) => getCurrencies(input), );

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/wesbos/currency-conversion-mcp'

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