Skip to main content
Glama

Match amounts (FX drift)

match_amounts_with_fx_drift
Read-onlyIdempotent

Compare two currency amounts using an exchange rate and verify if their percentage difference falls within a specified FX drift 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:

  • Do NOT use for same-currency comparisons where standard tolerance applies; use reconcile.

  • Do NOT use with non-positive FX rates.

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

Input Schema

TableJSON 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

TableJSON 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 and destructiveHint=false, so the restatement of 'read-only and idempotent' is redundant. However the description adds genuine context beyond the annotations: 'pure mathematical calculation', exact decimal arithmetic semantics, and the non-positive-rate input constraint.

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?

Front-loaded with a one-line summary followed by scannable Purpose/When-to-use/When-NOT sections; every sentence is informative. Slightly penalized for restating the annotation-declared read-only/idempotent traits, which duplicate structured data.

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 needn't be described, and annotations already cover the safety profile. Combined with the usage routing, edge-case rejection (non-positive rates) and arithmetic-precision note, an agent has everything needed to call this correctly.

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%, including the direction of the fx_rate quote and the tolerance_pct default, so the schema carries the parameter burden. The description mentions conversion and a tolerance window conceptually but adds no syntax or format detail beyond what the schema already provides; baseline 3 applies.

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?

States a specific verb and resource: compare two amounts in different currencies within an FX drift tolerance, then explicitly says what it does (converts using a provided rate and checks percentage difference). It distinguishes itself from the sibling 'reconcile' by naming it in the when-NOT section.

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?

Provides explicit 'When to use' bullets (cross-currency reconciliation, FX tolerance bounds) and 'When NOT to use' bullets that name the alternative ('use reconcile' for same-currency) and an invalid input case (non-positive FX rates). Nothing is left to inference.

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