Cross-Border Pricing & FX · Deterministic Decimal Engine Slug: multilocale_currency_vat_formatter 0-LLM Deterministic

Multi-Locale Currency Formatter & VAT Breakdown Calculator

European storefronts display gross VAT-inclusive shelf prices like '119,00 €' while accounting exports require exact net and VAT line items—and mixing comma/dot decimal separators across locales breaks invoice templates.

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

How It Works & Live Probe Telemetry

Executing in 0.1 ms with decimal.Decimal arithmetic, this formatter toggles cleanly between VAT-exclusive (amount_includes_vat: false) and VAT-inclusive (amount_includes_vat: true) extraction. Passing amount='119.00', currency='EUR', locale='de-DE', vat_rate_pct='19', amount_includes_vat=true yields net_amount '100.00', vat_amount '19.00', gross_amount '119.00', and locale-formatted '119,00 €'.

Verified Endpoint & Billing Contract

MCP Tool Namemultilocale_currency_vat_formatter
Subdomain & Modepricing_fx · deterministic
REST EndpointPOST https://devour-com.fastmesh.dev/v1/organs/multilocale_currency_vat_formatter/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 currency is unknown, amount < 0, or vat_rate_pct is negative/invalid.
Plans & PrivacyStarter $19/mo · Pro $79/mo · Scale $249/mo · Zero trajectory resale

Production Use Cases

ScenarioTrigger InputDeterministic Output Value
EU Gross-to-Net Invoice SplittingExtract 19% German MwSt or 20% French TVA from shelf pricesEliminates 1-cent rounding mismatches between checkout and ERP
Localized Price Tag RenderingFormat USD, EUR, GBP, and JPY strings per buyer localeApplies proper symbol placement and decimal/thousand separators
B2B vs B2C Toggle PricingDisplay net ex-VAT for logged-in businesses and gross for consumersComputes both values consistently in one deterministic call

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": "multilocale_currency_vat_formatter",
    "arguments": {
      "amount": "119.00",
      "currency": "EUR",
      "locale": "de-DE",
      "vat_rate_pct": "19",
      "amount_includes_vat": true
    }
  }
}

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

curl -sS -X POST https://devour-com.fastmesh.dev/v1/organs/multilocale_currency_vat_formatter/invoke \
  -H 'Content-Type: application/json' \
  -d '{"input": {"amount": "119.00", "currency": "EUR", "locale": "de-DE", "vat_rate_pct": "19", "amount_includes_vat": true}}'

Verified structured JSON response:

{
  "ok": true,
  "currency": "EUR",
  "locale": "de-DE",
  "net_amount": "100.00",
  "vat_amount": "19.00",
  "gross_amount": "119.00",
  "formatted_gross": "119,00 €",
  "billable_usd": "0.005"
}

Strict Input Schema

{
  "type": "object",
  "properties": {
    "amount": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]+)?$"
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Za-z]{3}$"
    },
    "locale": {
      "type": "string",
      "default": "en-US"
    },
    "vat_rate_pct": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]+)?$",
      "default": "0"
    },
    "amount_includes_vat": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "amount",
    "currency"
  ],
  "additionalProperties": false
}

Frequently Asked Questions

How is net_amount extracted when amount_includes_vat is true?

Net is computed via Decimal division amount / (1 + vat_rate_pct / 100) quantized to currency minor units, and vat_amount equals gross minus net so line items always sum exactly.

What happens on negative VAT rates or unknown currency codes?

Invalid parameters return ok: false and bill $0.00.

Related Commerce & Marketing MCP Tools