Skip to main content
Glama

Match amounts (FX drift)

match_amounts_with_fx_drift
Read-onlyIdempotent

Compare two amounts in different currencies using a supplied FX rate and check whether their percentage difference stays within a tolerance for cross-currency reconciliation.

Instructions

Compare two amounts in different currencies within an FX drift tolerance.

Purpose: Converts currency amounts using a provided exchange rate and verifies if the percentage difference falls within an acceptable tolerance window using exact decimal arithmetic.

When to use:

  • When reconciling cross-currency payments with conversion timing or rate variance.

  • When evaluating FX tolerance bounds on cross-border transactions.

When NOT to use:

  • Designed for cross-currency comparisons with a positive fx_rate; use reconcile for same-currency tolerance matching.

  • Rejects zero or negative FX rates.

Behavioral transparency: Pure mathematical calculation; read-only and idempotent.

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_a": "<amount_a>",
      "currency_a": "<currency_a>",
      "amount_b": "<amount_b>",
      "currency_b": "<currency_b>",
      "fx_rate": "<fx_rate>"
    },
    "name": "match_amounts_with_fx_drift"
  }
}

Input Schema

NameRequiredDescriptionDefault
fx_rateYesUnits of currency_a per one unit of currency_b (e.g. an EUR/USD quote of 1.08 is USD per EUR).
amount_aYesAmount denominated in currency_a.
amount_bYesAmount denominated in currency_b.
currency_aYesISO 4217 code of amount_a.
currency_bYesISO 4217 code of amount_b.
tolerance_pctNoMax percentage difference still counted as a match.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.5

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the closing 'read-only and idempotent' line mostly restates structured data. The value beyond annotations is the disclosure that computation is pure/exact decimal and that non-positive fx_rate inputs are rejected, which tells the agent how the tool fails.

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?

Labeled sections (Purpose / When to use / When NOT to use / Behavioral transparency) make it easy to scan, and the core operation is front-loaded in the first sentence. The final 'Behavioral transparency' line is partially redundant with the annotations and could be dropped without loss.

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?

An output schema exists, so return values need not be explained, and all six parameters have full schema coverage. The description supplies the remaining decision-relevant context: direction of conversion, tolerance concept, input rejection rules, and the sibling to use for same-currency work.

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 description coverage is 100%, and the schema already documents fx_rate direction, currency code semantics and the tolerance_pct default of 1, so the baseline is 3. The description adds only that the rate must be positive; it gives no extra guidance on how tolerance_pct interacts with the comparison beyond what the schema states.

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 names a specific operation (compare two amounts in different currencies within an FX drift tolerance) and elaborates that it converts via a supplied rate and checks a percentage delta with exact decimal arithmetic. This is distinguishable from the sibling 'reconcile', which is explicitly assigned the same-currency case.

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

Usage Guidelines5/5

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

It provides explicit 'When to use' contexts (cross-currency reconciliation with timing/rate variance, FX tolerance bounds) and an explicit 'When NOT to use' that names the alternative tool 'reconcile' for same-currency matching. It also states a precondition failure mode: zero or negative FX rates are rejected.

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