Logistics & Postal Intelligence · Deterministic Decimal Engine Slug: dim_weight_calculator 0-LLM Deterministic

Carrier Volumetric & Dimensional Weight Calculator

Lightweight bulky parcels routinely trigger unexpected carrier surcharges when fulfillment software quotes rates from scale weight instead of dimensional (DIM) weight.

5-Second Try-Now Console Connect via /mcp FastMesh SuperBus

How It Works & Live Probe Telemetry

Implemented strictly with Python decimal.Decimal arithmetic (zero binary floating-point rounding drift), this engine accepts carton length, width, height, actual_weight, dimension_unit (cm or in), weight_unit (kg or lb), and carrier ('ups', 'fedex', 'dhl', 'usps', 'air_iata', or 'ocean_cbm'). For example, a 40x30x20 cm parcel weighing 3.5 kg under DHL (divisor 5000) yields dim_weight '4.80' kg, volume_cbm '0.024', and rounded billable_weight '5.0' kg.

Verified Endpoint & Billing Contract

MCP Tool Namedim_weight_calculator
Subdomain & Modelogistics_address · deterministic
REST EndpointPOST https://devour-com.fastmesh.dev/v1/organs/dim_weight_calculator/invoke
MCP EndpointPOST https://devour-com.fastmesh.dev/mcp (also mounted on https://mcp.fastmesh.dev/mcp)
Verified Probe Latency0.1 ms (HTTP 200, verified 2026-12-02T10:50:00Z)
Archive Cache TTL30 days (2592000s) cross-tenant verified-hit cache
Empty / Error RuleCharge $0.00 when dimensions or actual weight are non-positive or carrier/unit parameters are invalid.
Plans & PrivacyStarter $19/mo · Pro $79/mo · Scale $249/mo · Zero trajectory resale

Production Use Cases

ScenarioTrigger InputDeterministic Output Value
Pre-Checkout Freight QuotingCompare UPS vs DHL vs FedEx billable weight in real timePrevents margin erosion on oversized low-density cartons
3PL Cartonization OptimizationTest smaller box dimensions before packingQuantifies exact DIM weight savings across cm/kg and in/lb units
Air vs Ocean Freight TriageSwitch between air_iata and ocean_cbm modesComputes exact cubic meter volume_cbm alongside chargeable weight

MCP JSON-RPC 2.0 & REST Invocation Examples

Call via MCP tools/call on https://devour-com.fastmesh.dev/mcp:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "dim_weight_calculator",
    "arguments": {
      "length": 40,
      "width": 30,
      "height": 20,
      "actual_weight": 3.5,
      "dimension_unit": "cm",
      "weight_unit": "kg",
      "carrier": "dhl"
    }
  }
}

Or invoke directly via REST (POST /v1/organs/dim_weight_calculator/invoke):

curl -sS -X POST https://devour-com.fastmesh.dev/v1/organs/dim_weight_calculator/invoke \
  -H 'Content-Type: application/json' \
  -d '{"input": {"length": 40, "width": 30, "height": 20, "actual_weight": 3.5, "dimension_unit": "cm", "weight_unit": "kg", "carrier": "dhl"}}'

Verified structured JSON response:

{
  "ok": true,
  "carrier": "dhl",
  "divisor_used": "5000",
  "dim_weight": "4.80",
  "actual_weight": "3.5",
  "billable_weight": "5.0",
  "weight_unit": "kg",
  "volume_cbm": "0.0240",
  "billable_usd": "0.005"
}

Strict Input Schema

{
  "type": "object",
  "properties": {
    "length": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "width": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "height": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "actual_weight": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "dimension_unit": {
      "type": "string",
      "enum": [
        "cm",
        "in"
      ],
      "default": "cm"
    },
    "weight_unit": {
      "type": "string",
      "enum": [
        "kg",
        "lb"
      ],
      "default": "kg"
    },
    "carrier": {
      "type": "string",
      "enum": [
        "ups",
        "fedex",
        "dhl",
        "usps",
        "air_iata",
        "ocean_cbm"
      ],
      "default": "dhl"
    }
  },
  "required": [
    "length",
    "width",
    "height",
    "actual_weight"
  ],
  "additionalProperties": false
}

Frequently Asked Questions

Why use Decimal math instead of standard float for DIM calculations?

Carrier billing thresholds round up at 0.5 or 1.0 unit boundaries; IEEE-754 float errors like 4.9999999998 can cause inconsistent rounding across warehouses.

What happens if someone passes zero or negative carton dimensions?

Schema validation rejects non-positive numbers with $0.00 billed.

Related Commerce & Marketing MCP Tools