Explicit localized number parser
WHEN TO USE: Convert supplied localized numeric spellings into exact ASCII decimal strings using a declared digit alphabet, symbols and primary/secondary grouping. Validates the entire spelling with per-item rejections; preserves fractional digit count and negative-zero evidence. No locale inference, floating-point numeric conversion, exponent/currency parsing or full CLDR claim. Maximum 200 items and 128 Unicode code points each.
structured · Operation ID: localized-number-parse
Choose this operation when
- Parse localized decimal strings with an explicit digit and separator profile
- Convert grouped Arabic-Indic or comma-decimal numbers without floating-point loss
- Reject partially parsed numbers and retain negative zero and fractional precision evidence
Outside this profile
- Inferring a locale, full CLDR/ICU conformance, currency or percentage conversion, exponent notation or accounting parentheses
- Normalizing Unicode or repairing malformed numeric spellings
- Fetching data, executing caller code, contacting agents, transmitting a payload, or changing remote state
- Verifying semantic truth, source authenticity, identity, permissions, or business relationships
Exact release references
Static JSON contract · Markdown reference · Fixed example response
Complete input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"profile": {
"type": "object",
"properties": {
"decimal": {
"type": "string",
"minLength": 1,
"maxLength": 2,
"description": "Exactly one Unicode scalar value; distinct from every digit and other enabled syntax symbol."
},
"group": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 2,
"description": "Exactly one Unicode scalar value; distinct from every digit and other enabled syntax symbol."
},
{
"type": "null"
}
]
},
"digits": {
"type": "string",
"minLength": 10,
"maxLength": 20,
"description": "Exactly ten distinct Unicode scalar values, in digit-value order zero through nine."
},
"primaryGroup": {
"type": "integer",
"minimum": 1,
"maximum": 9
},
"secondaryGroup": {
"type": "integer",
"minimum": 1,
"maximum": 9
},
"minus": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 2,
"description": "Exactly one Unicode scalar value; distinct from every digit and other enabled syntax symbol."
},
{
"type": "null"
}
]
},
"plus": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 2,
"description": "Exactly one Unicode scalar value; distinct from every digit and other enabled syntax symbol."
},
{
"type": "null"
}
]
},
"trim": {
"type": "string",
"enum": [
"none",
"ascii-space"
]
}
},
"required": [
"decimal",
"digits",
"primaryGroup",
"secondaryGroup",
"minus",
"plus",
"trim"
],
"additionalProperties": false
},
"items": {
"maxItems": 200,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"text": {
"type": "string",
"maxLength": 256,
"description": "At most 128 Unicode scalar values (up to 256 UTF-16 code units); complete numeric spelling required."
}
},
"required": [
"id",
"text"
],
"additionalProperties": false
}
}
},
"required": [
"profile",
"items"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "localized-number-parse",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"profile": {
"type": "string",
"const": "explicit-localized-decimal-v1"
},
"items": {
"maxItems": 200,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"status": {
"type": "string",
"const": "parsed"
},
"decimal": {
"type": "string",
"minLength": 1,
"maxLength": 129,
"pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d*[1-9])?$"
},
"fractionDigits": {
"type": "integer",
"minimum": 0,
"maximum": 127
},
"negativeZero": {
"type": "boolean"
}
},
"required": [
"id",
"status",
"decimal",
"fractionDigits",
"negativeZero"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"status": {
"type": "string",
"const": "rejected"
},
"code": {
"type": "string",
"enum": [
"EMPTY_NUMBER",
"INVALID_DECIMAL",
"INVALID_GROUPING",
"INVALID_DIGIT"
]
}
},
"required": [
"id",
"status",
"code"
],
"additionalProperties": false
}
]
}
},
"parsedCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"rejectedCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"externalRequests": {
"type": "number",
"const": 0
},
"semanticValidityVerified": {
"type": "boolean",
"const": false
}
},
"required": [
"profile",
"items",
"parsedCount",
"rejectedCount",
"externalRequests",
"semanticValidityVerified"
],
"additionalProperties": false
},
"provenance": {
"type": "object",
"required": [
"inputSha256",
"outputSha256",
"deterministic",
"externalRequests"
],
"properties": {
"inputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"outputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"deterministic": {
"const": true
},
"externalRequests": {
"const": 0
}
}
}
},
"additionalProperties": false
}
Fixed example
One accepted fixed example, not a custom-input trial. No operation runs when this static page is requested.
Example input
{
"profile": {
"decimal": ",",
"group": ".",
"digits": "0123456789",
"primaryGroup": 3,
"secondaryGroup": 3,
"minus": "-",
"plus": "+",
"trim": "none"
},
"items": [
{
"id": "amount",
"text": "1.234,50"
},
{
"id": "bad",
"text": "12.34,50"
}
]
}
Example response
{
"operation": "localized-number-parse",
"version": "0.29.0",
"result": {
"profile": "explicit-localized-decimal-v1",
"items": [
{
"id": "amount",
"status": "parsed",
"decimal": "1234.5",
"fractionDigits": 2,
"negativeZero": false
},
{
"id": "bad",
"status": "rejected",
"code": "INVALID_GROUPING"
}
],
"parsedCount": 1,
"rejectedCount": 1,
"externalRequests": 0,
"semanticValidityVerified": false
},
"provenance": {
"inputSha256": "fed04dea67f41b2b280d65a04628f220b1990342b4b23286c7385e670866cf8a",
"outputSha256": "33f7fc6af42ba5fea58d25f6e6642910702fb70b6d7f6dbcbf15122d3ffd535a",
"deterministic": true,
"externalRequests": 0
}
}
Bounds and precision
JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.
{
"global": {
"requestBytes": 131072,
"responseBytes": 524288,
"jsonDepth": 32,
"jsonNodes": 20000,
"requestsPerMinute": 60,
"paidAttemptsPerMinute": 20,
"idempotencyHours": 24
},
"operation": {
"inputBytes": 100000,
"outputBytes": 400000,
"jsonNodes": 12000,
"depth": 20,
"maxItems": 200,
"maxTextCodePoints": 128,
"digitAlphabetCodePoints": 10,
"maxGroupWidth": 9,
"trim": "none or leading/trailing U+0020 only",
"numericOutput": "canonical ASCII decimal string"
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.003",
"sixDecimalTokenBaseUnits": "3000",
"subscription": false,
"includesPayerWalletOrNetworkFees": false,
"liveQuoteVerified": false,
"condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
}
Protocol definitions: x402, mpp. MPP uses Tempo charge. Paid MCP execution is unsupported. All runtime readiness is not evaluated in this build.
API path templates, not endpoints on this documentation host
{
"x402": "/v1/x402/localized-number-parse",
"mpp": "/v1/mpp/localized-number-parse"
}
Required headers
{
"Content-Type": "application/json",
"Idempotency-Key": "random 16–128 character operation identifier"
}
Actual SDK challenge amount, asset, network, recipient and wallet costs must pass independent authorization. Preserve identical key, body, protocol and credential on retries; on PAYMENT_UNCERTAIN stop and reconcile.
Execution profile and provider conditions
{
"deterministic": true,
"externalRequests": 0,
"maxExternalRequests": 0,
"resultSnapshotPersisted": false,
"fixedExampleIsIllustrativeSnapshot": false,
"requiresPayment": true,
"supportsMcpExecution": false
}
Deterministic supplied-input operation with no external requests or stored request/result bodies. Payment infrastructure retains payment metadata and hashes.
Failure handling
- HTTP 400: Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch Correct the request before payment
- HTTP 402: Payment challenge or rejected payment Use official protocol SDK; inspect payment outcome before another payment
- HTTP 409: Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay
- HTTP 413: Input or generated output too large Reduce input; no payment attempted for validation failure
- HTTP 415: Unsupported media type or compression Send uncompressed application/json
- HTTP 422: Schema or service-specific semantic validation failure Correct input using returned error code; no payment attempted
- HTTP 429: Request/payment-attempt rate exceeded Wait for rate limit window; preserve existing payment identity
- HTTP 503: Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation
Declared requirements
Before any paid call, refresh the live operation contract and POST the complete bounded budgeted plan to the separate API's /preflight. Unknown requirements block selection; compatible preflight is not permission to spend.