Giving an LLM agent a currency tool is easy: wrap Frankfurter in a function and you're done. The problem shows up later, when the agent answers "what's the dollar rate in Sri Lanka?" with a central bank number while the user means what their bank will give them.
Frankfurter returns the first two for official rates. That's enough for many agents.
AllRatesToday publishes an MCP server (@allratestoday/mcp-server on npm) with separate tools for market rates (get_exchange_rate), official tables from central banks and tax or customs authorities (get_official_rates) and commercial bank boards ( get_bank_rates). In Claude Desktop or any MCP client:
{
"mcpServers": {
"allratestoday": {
"command": "npx",
"args": ["-y", "@allratestoday/mcp-server"],
"env": { "ALLRATES_API_KEY": "YOUR_KEY" }
}
}
}
Now the agent can answer three different questions correctly:
get_official_rates for ecb. get_bank_rates. hmrc. Even if you stay on Frankfurter, put the source and date into your tool's output string. Agents repeat whatever you give them, so give them the citation too.
I work on AllRatesToday.
原文来源:dev.to