Convert an amount between currencies
convertConvert an amount between two currencies using published African rates. Tries the direct pair, then the inverse, then a cross through USD, and tells you which path it used and which source it trusted. No AfriRate endpoint does this — it is computed here. Passing country when you know it costs one upstream request instead of up to six, which matters against a 10-per-minute budget.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"amount": "<amount>",
"from": "<from>",
"to": "<to>"
},
"name": "convert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Currency to convert to, e.g. ZWG | |
| from | Yes | Currency to convert from, e.g. USD | |
| amount | Yes | Amount to convert | |
| source | No | Restrict to one source by its code as get_rate shows it, e.g. rbz or cbk. Usually leave this out. | |
| country | No | Restrict to sources from this country, e.g. ZW for the RBZ official rate |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | ||
| path | Yes | ||
| rate | Yes | ||
| as_of | Yes | ||
| stale | Yes | ||
| amount | Yes | ||
| result | Yes | ||
| sources | Yes | ||
| age_days | Yes |