Developer Tools
Unit Conversion & Measurement Policy Guard
Resolve pinned unit codes, convert Decimal quantities, compare compatible measurements with explicit tolerances, process bounded batches, and enforce caller-defined unit, range, sign, integer, and precision policy.
CONTRACT
Predictable for agents. Legible for reviewers.
- REST
POST /v1/units/policy-check- MCP tool
check_measurement_policy- Inputs
- Caller-supplied bounded Decimal values and explicit units across length, mass, area, volume, speed, temperature, pressure, time, energy, and information; batches accept up to 1,000 items.
- Returns
- CLEAR, REVIEW_REQUIRED, or BLOCKED with canonical unit and dimension, exact unrounded values, explicit rounding, tolerance or policy evidence, stable findings, and an agent-readable next action.
- Latency
- Synchronous
- Usage unit
- Measurement operation
The suite also exposes /v1/units/inspect, /convert, /compare, /batch-convert, and /catalog plus /mcp/unit-conversion. More than 60 pinned units use explicit SI, US customary, decimal-byte, binary-byte, and US-liquid semantics. Ambiguous bare tokens such as ton, gallon, and cup are rejected. It queries no sensor or registry, calibrates no measurement, verifies no legal-metrology rule, converts no currency, and stores no payload. Its RapidAPI release is queued until marketplace publication capacity is confirmed.
AGENT-READABLE EXCEPTIONS
UNIT_UNKNOWNUNIT_DIMENSION_MISMATCHMEASUREMENT_BELOW_ABSOLUTE_ZEROMEASUREMENT_ROUNDING_APPLIEDMEASUREMENT_TOLERANCE_EXCEEDEDMEASUREMENT_INPUT_UNIT_NOT_ALLOWEDMEASUREMENT_BELOW_MINIMUMMEASUREMENT_ABOVE_MAXIMUMMEASUREMENT_NEGATIVE_NOT_ALLOWEDMEASUREMENT_INTEGER_REQUIREDMEASUREMENT_PRECISION_EXCEEDEDMEASUREMENT_BATCH_ITEMS_BLOCKEDPOST /v1/units/policy-check
Authorization: Bearer apc_...
Content-Type: application/json
{
"quantity": {
"value": "55",
"unit": "lb"
},
"policy_name": "parcel-weight",
"policy_unit": "kg",
"allowed_input_units": [
"kg",
"lb"
],
"minimum": "0",
"maximum": "25",
"require_nonnegative": true,
"maximum_decimal_places": 3
}curl --request POST \
--url 'https://api-production-9502.up.railway.app/v1/units/policy-check' \
--header 'Authorization: Bearer ${AP_CONTROL_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"quantity": {
"value": "55",
"unit": "lb"
},
"policy_name": "parcel-weight",
"policy_unit": "kg",
"allowed_input_units": [
"kg",
"lb"
],
"minimum": "0",
"maximum": "25",
"require_nonnegative": true,
"maximum_decimal_places": 3
}'{
"status": "COMPLETED",
"decision": "REVIEW_REQUIRED",
"allowed_by_policy": true,
"policy_name": "parcel-weight",
"normalized_input_unit": "lb",
"evaluated_value": "24.94758035",
"policy_unit": "kg",
"evaluated_policy": {
"allowed_input_units": [
"kg",
"lb"
],
"minimum": "0",
"maximum": "25",
"require_nonnegative": true,
"require_integer": false,
"maximum_decimal_places": 3
},
"findings": [
{
"code": "MEASUREMENT_PRECISION_EXCEEDED",
"severity": "MEDIUM",
"message": "The converted value has more decimal places than caller policy.",
"evidence": {
"decimal_places": 8,
"maximum_decimal_places": 3
},
"next_action": "Apply an explicitly authorized rounding rule before downstream use."
}
],
"ruleset_version": "PINNED_UNIT_TABLE_2026_08",
"scope": "CALLER_SUPPLIED_MEASUREMENTS_ONLY",
"registry_queried": false,
"sensor_queried": false,
"measurement_calibrated": false,
"legal_metrology_verified": false,
"currency_converted": false,
"payload_stored": false,
"next_action": "Use the evidence within the caller's documented measurement and approval workflow."
}Try Unit Conversion & Measurement Policy Guard with your own workflow.
Start with the workspace, inspect the typed result, then integrate with REST or the focused MCP server.