Fx cross rate compute

fx-cross-rate-compute · version 1.0.0 · Money & pricing · free, no key needed

Derive a cross exchange rate and its inverse from two quoted rates that share one currency, at a stated scale.

Use when you need to: cross rate from two exchange rates · derive GBP/JPY from USD/JPY and GBP/USD · triangulate currency rate via euro.

Decide before calling

Read the versioned contract and the supported scope below. Reuse fx-cross-rate-compute@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use fx-cross-rate-compute@1.0.0 for cross rate from two exchange rates. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "rates": [
    {
      "base": "EUR",
      "quote": "DEM",
      "rate": "1.95583"
    },
    {
      "base": "EUR",
      "quote": "FRF",
      "rate": "6.55957"
    }
  ],
  "target": {
    "base": "DEM",
    "quote": "FRF"
  },
  "scale": 6,
  "rounding": "half_even"
}

Response:

{
  "result": {
    "base": "DEM",
    "quote": "FRF",
    "rate": "3.353855",
    "inverse_rate": "0.298164",
    "via": "EUR",
    "exact": false
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "fx-cross-rate-compute",
  "version": "1.0.0",
  "input": {
    "rates": [
      {
        "base": "EUR",
        "quote": "DEM",
        "rate": "1.95583"
      },
      {
        "base": "EUR",
        "quote": "FRF",
        "rate": "6.55957"
      }
    ],
    "target": {
      "base": "DEM",
      "quote": "FRF"
    },
    "scale": 6,
    "rounding": "half_even"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/fx-cross-rate-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"rates":[{"base":"EUR","quote":"DEM","rate":"1.95583"},{"base":"EUR","quote":"FRF","rate":"6.55957"}],"target":{"base":"DEM","quote":"FRF"},"scale":6,"rounding":"half_even"}'

The machine-readable contract is at /v1/tools/fx-cross-rate-compute/versions/1.0.0.

CLI

node cli.mjs run fx-cross-rate-compute 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.