Skip to main content
Glama

Currency Converter MCP

by wesbos
get_currencies.ts985 B
import { FRANKFURTER_API_BASE, type CurrenciesResponse, type ToolResponse, } from "../types"; export const getCurrenciesSchema = {}; export type GetCurrenciesInput = Record<string, never>; export type GetCurrenciesOutput = CurrenciesResponse; 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"}`, }, ], }; } }

Implementation Reference

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