Skip to main content
Glama

Convert currency

convert_currency
Read-only

Convert an amount between currencies at the OpenExchangeRates rate for a date (the same dated rate find_candidate_transactions matches with). Returns {amount, from, to, converted, rate, ratedate}; ratedate is the day the rate is for (a future date uses today's). Pass target (an amount in the to currency, e.g. a bill's outstanding balance) to also get within_tolerance: whether the converted amount lands within tolerance of it (a fraction, default and maximum 0.03 = the 3% cross-currency matching band). No rate for that date reads the latest earlier rate that weekends or market closures explain, marked stale: true with its ratedate; display only, never posted. An exact rate says stale: false. Otherwise it returns {error true, reason no-rate}. READ-ONLY: it converts, never records anything.

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_currency"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesISO currency code to convert into (e.g. ZAR).
dateNoThe date whose rate to use (YYYY-MM-DD). Defaults to today; a future date uses today's rate.
fromYesISO currency code of the amount (e.g. GBP).
amountYesThe amount to convert, in the `from` currency.
targetNoOptional amount in the `to` currency to test the converted amount against (e.g. a bill's outstanding balance).
toleranceNoOptional band for `target`, as a fraction (0.03 = 3%). Must be above 0 and at most 0.03; defaults to 0.03, the cross-currency matching band.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint annotation, the description discloses the return shape, future-date behavior, stale-rate fallback semantics, error result format, and that stale rates are display-only and never posted. This is unusually rich behavioral context for a mutation-free utility and leaves little ambiguity about edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the conversion purpose and return contract, and every clause earns its place by covering outputs, staleness, tolerance, and read-only behavior. However, it is a dense run-on with nested parentheticals that reduces scannability and could be split for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and six parameters, the description supplies the missing return contract, the stale-rate fallback rule, error shape, and the cross-currency matching semantics. Nothing essential for calling the tool correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already documents all six parameters, including `target`, `tolerance`, and future-date handling. The description reinforces the matching-band meaning for `target` and `tolerance` but adds little syntax or meaning beyond the structured parameter descriptions, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: convert an amount between currencies at the OpenExchangeRates rate for a date. It also distinguishes the tool by tying its dated rate to the same rate used by find_candidate_transactions, so an agent can place it relative to a named sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly describes the conversion scenario and explains when to pass `target` and `tolerance` for cross-currency matching, such as a bill's outstanding balance. It does not explicitly state when not to use it or name alternative conversion tools, but the intended use is clear from context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources