Unit conversion trace check

unit-conversion-trace-check · version 1.0.0 · Numbers & math · free, no key needed

Check a multi-step unit conversion trace with exact arithmetic; reports the first wrong step and its exact value

Use when you need to: check unit conversion steps · verify multi step unit conversion · find wrong step in unit conversion.

Decide before calling

Read the versioned contract and the supported scope below. Reuse unit-conversion-trace-check@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 unit-conversion-trace-check@1.0.0 for check unit conversion steps. 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:

{
  "units": [
    {
      "symbol": "m",
      "dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "factor": "1",
      "offset": "0"
    },
    {
      "symbol": "mi",
      "dimension": [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "factor": "1609.344",
      "offset": "0"
    },
    {
      "symbol": "s",
      "dimension": [
        0,
        0,
        1,
        0,
        0,
        0,
        0
      ],
      "factor": "1",
      "offset": "0"
    },
    {
      "symbol": "h",
      "dimension": [
        0,
        0,
        1,
        0,
        0,
        0,
        0
      ],
      "factor": "3600",
      "offset": "0"
    }
  ],
  "quantity_kind": "absolute",
  "start_value": "60",
  "start_unit": [
    {
      "unit": "mi",
      "power": 1
    },
    {
      "unit": "h",
      "power": -1
    }
  ],
  "steps": [
    {
      "to_unit": [
        {
          "unit": "m",
          "power": 1
        },
        {
          "unit": "h",
          "power": -1
        }
      ],
      "claimed_value": "96560.64",
      "round_places": null
    },
    {
      "to_unit": [
        {
          "unit": "m",
          "power": 1
        },
        {
          "unit": "s",
          "power": -1
        }
      ],
      "claimed_value": "26.82",
      "round_places": 2
    }
  ]
}

Response:

{
  "result": {
    "valid": true,
    "reason": null,
    "first_discrepancy": null,
    "steps_checked": 2,
    "final_value": "26.82",
    "reference_version": "jcgm-200-2012-vim3-si-brochure-9e-2019"
  }
}

How to call it

MCP

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

{
  "id": "unit-conversion-trace-check",
  "version": "1.0.0",
  "input": {
    "units": [
      {
        "symbol": "m",
        "dimension": [
          1,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "factor": "1",
        "offset": "0"
      },
      {
        "symbol": "mi",
        "dimension": [
          1,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "factor": "1609.344",
        "offset": "0"
      },
      {
        "symbol": "s",
        "dimension": [
          0,
          0,
          1,
          0,
          0,
          0,
          0
        ],
        "factor": "1",
        "offset": "0"
      },
      {
        "symbol": "h",
        "dimension": [
          0,
          0,
          1,
          0,
          0,
          0,
          0
        ],
        "factor": "3600",
        "offset": "0"
      }
    ],
    "quantity_kind": "absolute",
    "start_value": "60",
    "start_unit": [
      {
        "unit": "mi",
        "power": 1
      },
      {
        "unit": "h",
        "power": -1
      }
    ],
    "steps": [
      {
        "to_unit": [
          {
            "unit": "m",
            "power": 1
          },
          {
            "unit": "h",
            "power": -1
          }
        ],
        "claimed_value": "96560.64",
        "round_places": null
      },
      {
        "to_unit": [
          {
            "unit": "m",
            "power": 1
          },
          {
            "unit": "s",
            "power": -1
          }
        ],
        "claimed_value": "26.82",
        "round_places": 2
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/unit-conversion-trace-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"units":[{"symbol":"m","dimension":[1,0,0,0,0,0,0],"factor":"1","offset":"0"},{"symbol":"mi","dimension":[1,0,0,0,0,0,0],"factor":"1609.344","offset":"0"},{"symbol":"s","dimension":[0,0,1,0,0,0,0],"factor":"1","offset":"0"},{"symbol":"h","dimension":[0,0,1,0,0,0,0],"factor":"3600","offset":"0"}],"quantity_kind":"absolute","start_value":"60","start_unit":[{"unit":"mi","power":1},{"unit":"h","power":-1}],"steps":[{"to_unit":[{"unit":"m","power":1},{"unit":"h","power":-1}],"claimed_value":"96560.64","round_places":null},{"to_unit":[{"unit":"m","power":1},{"unit":"s","power":-1}],"claimed_value":"26.82","round_places":2}]}'

The machine-readable contract is at /v1/tools/unit-conversion-trace-check/versions/1.0.0.

CLI

node cli.mjs run unit-conversion-trace-check 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.