Skip to main content
Glama

Check FX Mid-Market Rate

check_fx_mid_market_rate
Read-onlyIdempotent

Returns the live mid-market FX rate for a currency pair (Twelve Data, Open Exchange Rates fallback), in both directions (pair and inverted_pair). Inputs: currency_from, currency_to, optional bank_rate. When bank_rate is given, the output also includes the spread versus mid-market; both quote directions (rate and 1/rate) are tested, the closer one is kept and flagged as inverted when 1/rate wins; a rate more than 10% from mid-market in both directions is rejected as incoherent.

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": {
      "currency_from": "<currency_from>",
      "currency_to": "<currency_to>"
    },
    "name": "check_fx_mid_market_rate"
  }
}

Input Schema

NameRequiredDescriptionDefault
bank_rateNoOptional bank/broker rate. When provided, returns spread vs mid-market and tests both quote directions; >10% off in both → rejected as incoherent.
currency_toYesISO 4217 quote currency (e.g. CAD)
currency_fromYesISO 4217 base currency (e.g. USD)

Output Schema

NameRequiredDescriptionDefault
lowNo
highNo
noteNo
pairYes
bank_rateNo
fetched_atYes
spread_bpsNo
spread_pctNo
currency_toYes
currency_fromYes
inverted_pairNo
rate_providerYes
bank_rate_inputNo
mid_market_rateYes
rate_from_cacheNo
cotation_inverseeNo
inverted_mid_rateNo
mcp_server_versionNo
rate_timestamp_utcYes
loss_per_million_usdNo
inverted_rate_appliedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "bank_rate": {
      +      "type": "number"
      +    },
      +    "bank_rate_input": {
      +      "type": "number"
      +    },
      +    "cotation_inversee": {
      +      "type": "boolean"
      +    },
      +    "currency_from": {
      +      "type": "string"
      +    },
      +    "currency_to": {
      +      "type": "string"
      +    },
      +    "fetched_at": {
      +      "type": "string"
      +    },
      +    "high": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "inverted_mid_rate": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "inverted_pair": {
      +      "type": "string"
      +    },
      +    "inverted_rate_applied": {
      +      "type": "boolean"
      +    },
      +    "loss_per_million_usd": {
      +      "type": "number"
      +    },
      +    "low": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "mcp_server_version": {
      +      "type": "string"
      +    },
      +    "mid_market_rate": {
      +      "type": "number"
      +    },
      +    "note": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "pair": {
      +      "type": "string"
      +    },
      +    "rate_from_cache": {
      +      "type": "boolean"
      +    },
      +    "rate_provider": {
      +      "type": "string"
      +    },
      +    "rate_timestamp_utc": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "spread_bps": {
      +      "type": "number"
      +    },
      +    "spread_pct": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "pair",
      +    "currency_from",
      +    "currency_to",
      +    "mid_market_rate",
      +    "rate_provider",
      +    "rate_timestamp_utc",
      +    "fetched_at"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / bank_rate / description
      Previous value: -"Optional bank/broker rate. When provided, returns spread vs mid-market and auto-detects inverted quotes (>20% spread → tries 1/rate)."New value: +"Optional bank/broker rate. When provided, returns spread vs mid-market and tests both quote directions; >10% off in both → rejected as incoherent."
  3. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, openWorld and non-destructive, so the bar is lower, yet the description adds real behavior beyond them: a provider fallback chain, bidirectional quote testing with an 'inverted' flag, and a hard 10% coherence rejection rule. It stops short of saying what happens if both providers fail or whether results are cached/rate-limited.

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?

Content is front-loaded with the core purpose in the first clause, followed by inputs, then edge-case behavior. It is dense and slightly run-on in the final clause (both directions tested, closer kept, flag, 10% rejection), but no sentence is filler.

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 an output schema present, return values need no explanation; the description covers inputs, the optional-parameter mode, provider fallback, and the incoherence rejection rule. For a 3-parameter read-only lookup, nothing an agent needs to invoke it correctly is 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 description coverage is 100%, so the schema already explains currency_from/currency_to as ISO 4217 base/quote and documents bank_rate's spread-and-direction behavior. The description adds little parameter meaning beyond restating the bank_rate contract, so the baseline of 3 is appropriate.

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

Purpose4/5

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

The description opens with a specific verb+resource: 'Returns the live mid-market FX rate for a currency pair,' and names the upstream providers (Twelve Data, Open Exchange Rates fallback). That scope makes it self-evidently the single-pair spot lookup rather than a batch/audit tool like its siblings, though no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is only implied: the presence of the optional bank_rate is described as a mode switch ('When bank_rate is given, the output also includes the spread'), which tells the agent when the extra output appears. There is no explicit when-to-use/when-not guidance and no routing to alternatives such as audit_fx_transaction or compare_fx_sources for multi-pair or historical needs.

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