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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/get_currencies.ts:13-51 (handler)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"}`, }, ], }; } }
- src/tools/get_currencies.ts:7-7 (schema)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), );