{
  "id": "message-variants-render",
  "name": "Render supplied message variants",
  "description": "Render bounded literal/argument/select/plural message trees for explicit cases using fixed CLDR47 integer cardinal rules for en/de/ja/ar/pt-BR/pt-PT. Exact branches precede categories; other is required. Returns selected branches and finite case coverage. No translation, escaping, ICU syntax or runtime Intl dependency.",
  "category": "text",
  "priceUsd": "0.005",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.005",
    "sixDecimalTokenBaseUnits": "5000",
    "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."
  },
  "intents": [
    "Render supplied plural/select messages into concrete localized preview strings",
    "Preview fixed integer cardinal branches and finite case coverage for supplied message trees"
  ],
  "whenToUse": [
    "Render supplied plural/select messages into concrete localized preview strings",
    "Preview fixed integer cardinal branches and finite case coverage for supplied message trees"
  ],
  "whenNotToUse": [
    "Translate or verify language quality; parse full ICU MessageFormat; decimal/ordinal plurals; format dates/numbers; send messages; escape HTML or SQL",
    "Network calls, external actions, supplied-evidence authenticity or factual correctness certification"
  ],
  "capabilities": [
    "Flat unique-ownership fully reachable trees with all branches and variables validated before rendering",
    "CLDR47-derived integer-only en/de/ja/ar/pt-BR/pt-PT cardinal rules, no locale fallback or runtime Intl",
    "Exact-value overrides and required other branches, literal substitution, branch coverage over supplied cases only",
    "Networkless bounded computation; advisoryOnly=true; externalRequests=0"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 400000,
    "jsonNodes": 12000,
    "depth": 20,
    "nodes": 512,
    "branchDepth": 8,
    "branchesPerChoice": 16,
    "variables": 128,
    "cases": 128,
    "literalValueBytes": 60000,
    "caseTextBytes": 20000,
    "totalTextBytes": 200000,
    "renderNodeVisits": 65536,
    "pluralCountMaximum": 1000000000,
    "cldrVersion": "47"
  },
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "UNSAFE_KEY",
    "DUPLICATE_ID",
    "INVALID_MESSAGE_TREE",
    "DUPLICATE_BRANCH",
    "MISSING_OTHER",
    "VARIABLE_TYPE_CONFLICT",
    "MISSING_VARIABLE",
    "EXTRA_VARIABLE",
    "INVALID_COUNT",
    "TEXT_LIMIT",
    "RENDER_LIMIT"
  ],
  "related": [
    "localization-bundle-build",
    "template-render"
  ],
  "requirementsProfile": {
    "format": "declared-requirements-v1",
    "facts": {
      "execution.suppliedCode": false,
      "execution.remoteMutation": false,
      "execution.llmInference": false,
      "execution.paidMcp": false,
      "verification.semanticTruth": false,
      "verification.sourceAuthenticity": false,
      "verification.liveVulnerabilities": false,
      "numbers.arbitraryPrecisionJson": false,
      "numbers.model": "ieee754-binary64",
      "privacy.requestBodyPersisted": false,
      "execution.deterministic": true,
      "execution.networkAccess": false,
      "privacy.resultBodyPersisted": false,
      "payment.x402": true,
      "payment.mpp": true,
      "operation.id": "message-variants-render",
      "operation.category": "text",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 400000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "messageRender.profile": "bounded-message-tree-cldr47-integer-v1",
      "messageRender.cldrVersion": "47",
      "messageRender.locales": "en,de,ja,ar,pt-BR,pt-PT",
      "messageRender.maxNodes": 512,
      "messageRender.maxBranchDepth": 8,
      "messageRender.maxBranchesPerChoice": 16,
      "messageRender.maxVariables": 128,
      "messageRender.maxCases": 128,
      "messageRender.maxLiteralValueBytes": 60000,
      "messageRender.maxPluralCount": 1000000000,
      "messageRender.maxCaseTextBytes": 20000,
      "messageRender.maxRenderedTextBytes": 200000,
      "messageRender.maxVisitedNodes": 65536,
      "messageRender.integerCardinalsOnly": true,
      "messageRender.fullIcuMessageFormat": false,
      "messageRender.runtimeIntlRules": false,
      "messageRender.translationVerified": false,
      "messageRender.outputEscaped": false,
      "messageRender.sendsMessages": false,
      "input.root.maxItems": 512,
      "input.nodes.maxItems": 512,
      "input.cases.maxItems": 128,
      "input.cases.minItems": 1
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/message-variants-render.md",
  "serviceContract": "/reference/services/message-variants-render.json",
  "errors": [
    {
      "status": 400,
      "meaning": "Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch",
      "retry": "Correct the request before payment"
    },
    {
      "status": 402,
      "meaning": "Payment challenge or rejected payment",
      "retry": "Use official protocol SDK; inspect payment outcome before another payment"
    },
    {
      "status": 409,
      "meaning": "Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN",
      "retry": "Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay"
    },
    {
      "status": 413,
      "meaning": "Input or generated output too large",
      "retry": "Reduce input; no payment attempted for validation failure"
    },
    {
      "status": 415,
      "meaning": "Unsupported media type or compression",
      "retry": "Send uncompressed application/json"
    },
    {
      "status": 422,
      "meaning": "Schema or service-specific semantic validation failure",
      "retry": "Correct input using returned error code; no payment attempted"
    },
    {
      "status": 429,
      "meaning": "Request/payment-attempt rate exceeded",
      "retry": "Wait for rate limit window; preserve existing payment identity"
    },
    {
      "status": 503,
      "meaning": "Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement",
      "retry": "Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation"
    }
  ],
  "numericPrecision": "JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.",
  "paymentWorkflow": {
    "discoveryOnly": false,
    "supportedProtocols": [
      "x402",
      "mpp"
    ],
    "x402": {
      "credentialHeader": "PAYMENT-SIGNATURE",
      "challengeHeader": "PAYMENT-REQUIRED",
      "receiptHeader": "PAYMENT-RESPONSE",
      "version": 2,
      "scheme": "exact",
      "paymentIdentifier": "payment-identifier extension MUST equal the HTTP Idempotency-Key",
      "sdk": "@x402/core with @x402/evm"
    },
    "mpp": {
      "supported": true,
      "credentialHeader": "Authorization",
      "challengeHeader": "WWW-Authenticate",
      "receiptHeader": "Payment-Receipt",
      "method": "tempo",
      "intent": "charge",
      "sdk": "mppx",
      "tokenDecimals": 6
    },
    "steps": [
      "Check configured readiness and the exact service schema",
      "Generate a fresh random Idempotency-Key for this operation; never use a discovery probe fixture for purchases",
      "Send valid input without a credential to obtain the official protocol challenge",
      "Use the official SDK and authorized wallet to fulfill the challenge",
      "Retry only with identical key, body, protocol and credential",
      "On PAYMENT_UNCERTAIN stop and request operator reconciliation; never blindly pay again"
    ],
    "versionedRetries": "Request fingerprint includes service release version. Retries across a version upgrade can conflict; coordinate upgrades outside the 24-hour replay window and reconcile pending attempts.",
    "docs": "/llms.txt"
  },
  "method": "POST",
  "paths": {
    "x402": "/v1/x402/message-variants-render",
    "mpp": "/v1/mpp/message-variants-render"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "locale": {
        "type": "string",
        "enum": [
          "en",
          "de",
          "ja",
          "ar",
          "pt-BR",
          "pt-PT"
        ]
      },
      "root": {
        "maxItems": 512,
        "type": "array",
        "items": {
          "type": "integer",
          "minimum": 0,
          "maximum": 511
        }
      },
      "nodes": {
        "maxItems": 512,
        "type": "array",
        "items": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "text"
                },
                "text": {
                  "type": "string",
                  "maxLength": 60000
                }
              },
              "required": [
                "kind",
                "text"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "arg"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
                }
              },
              "required": [
                "kind",
                "name"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "select"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
                },
                "options": {
                  "minItems": 1,
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "nodes": {
                        "maxItems": 512,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 511
                        }
                      }
                    },
                    "required": [
                      "key",
                      "nodes"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "kind",
                "name",
                "options"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plural"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
                },
                "exact": {
                  "default": [],
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      "nodes": {
                        "maxItems": 512,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 511
                        }
                      }
                    },
                    "required": [
                      "value",
                      "nodes"
                    ],
                    "additionalProperties": false
                  }
                },
                "categories": {
                  "minItems": 1,
                  "maxItems": 6,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "category": {
                        "type": "string",
                        "enum": [
                          "zero",
                          "one",
                          "two",
                          "few",
                          "many",
                          "other"
                        ]
                      },
                      "nodes": {
                        "maxItems": 512,
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 511
                        }
                      }
                    },
                    "required": [
                      "category",
                      "nodes"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "kind",
                "name",
                "categories"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "cases": {
        "minItems": 1,
        "maxItems": 128,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "variables": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 60000
                  },
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                ]
              }
            }
          },
          "required": [
            "id",
            "variables"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "locale",
      "root",
      "nodes",
      "cases"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "message-variants-render",
        "type": "string"
      },
      "version": {
        "const": "0.29.0",
        "type": "string"
      },
      "result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "advisoryOnly": {
            "type": "boolean",
            "const": true
          },
          "externalRequests": {
            "type": "number",
            "const": 0
          },
          "profile": {
            "type": "string",
            "const": "bounded-message-tree-cldr47-integer-v1"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "de",
              "ja",
              "ar",
              "pt-BR",
              "pt-PT"
            ]
          },
          "cases": {
            "maxItems": 128,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "text": {
                  "type": "string",
                  "maxLength": 20000
                },
                "branches": {
                  "maxItems": 512,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "node": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "selected": {
                        "type": "string",
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "node",
                      "selected"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "text",
                "branches"
              ],
              "additionalProperties": false
            }
          },
          "coverage": {
            "maxItems": 512,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "node": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "visited": {
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "unvisited": {
                  "maxItems": 16,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              },
              "required": [
                "node",
                "visited",
                "unvisited"
              ],
              "additionalProperties": false
            }
          },
          "translationVerified": {
            "type": "boolean",
            "const": false
          },
          "escaped": {
            "type": "boolean",
            "const": false
          }
        },
        "required": [
          "advisoryOnly",
          "externalRequests",
          "profile",
          "locale",
          "cases",
          "coverage",
          "translationVerified",
          "escaped"
        ],
        "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
  },
  "exampleInput": {
    "locale": "en",
    "root": [
      0,
      1,
      2,
      3
    ],
    "nodes": [
      {
        "kind": "text",
        "text": "Hello "
      },
      {
        "kind": "arg",
        "name": "name"
      },
      {
        "kind": "text",
        "text": ", "
      },
      {
        "kind": "plural",
        "name": "count",
        "exact": [
          {
            "value": 0,
            "nodes": [
              4
            ]
          }
        ],
        "categories": [
          {
            "category": "one",
            "nodes": [
              5
            ]
          },
          {
            "category": "other",
            "nodes": [
              6,
              7
            ]
          }
        ]
      },
      {
        "kind": "text",
        "text": "no files"
      },
      {
        "kind": "text",
        "text": "one file"
      },
      {
        "kind": "arg",
        "name": "count"
      },
      {
        "kind": "text",
        "text": " files"
      }
    ],
    "cases": [
      {
        "id": "none",
        "variables": {
          "name": "Ana",
          "count": 0
        }
      },
      {
        "id": "several",
        "variables": {
          "name": "Ana",
          "count": 2
        }
      }
    ]
  },
  "exampleResponse": {
    "operation": "message-variants-render",
    "version": "0.29.0",
    "result": {
      "advisoryOnly": true,
      "externalRequests": 0,
      "profile": "bounded-message-tree-cldr47-integer-v1",
      "locale": "en",
      "cases": [
        {
          "id": "none",
          "text": "Hello Ana, no files",
          "branches": [
            {
              "node": 3,
              "selected": "=0"
            }
          ]
        },
        {
          "id": "several",
          "text": "Hello Ana, 2 files",
          "branches": [
            {
              "node": 3,
              "selected": "other"
            }
          ]
        }
      ],
      "coverage": [
        {
          "node": 3,
          "visited": [
            "=0",
            "other"
          ],
          "unvisited": [
            "one"
          ]
        }
      ],
      "translationVerified": false,
      "escaped": false
    },
    "provenance": {
      "inputSha256": "9c6f1456c7c70aec965865d71fcd320490baa18b73493f18455d3a7dde5e7d88",
      "outputSha256": "1097155c3e335474e79c1efb7ed8ed6d15ad7d54090e1723725e2d191324b07c",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/message-variants-render.json",
  "execution": {
    "deterministic": true,
    "externalRequests": 0,
    "maxExternalRequests": 0,
    "resultSnapshotPersisted": false,
    "fixedExampleIsIllustrativeSnapshot": false,
    "requiresPayment": true,
    "supportsMcpExecution": false
  },
  "releaseSnapshot": {
    "format": "static-release-reference-v1",
    "sourceVersion": "0.29.0",
    "sourceRegistrySha256": "a2b5ec09bf6c38b9d2879d746a4fded374f5928b445377b0270ef6aa8e6cac65",
    "generatedAt": "2026-10-06T15:38:00Z",
    "releaseAcceptance": "not-verified-by-generator",
    "runtimeReadiness": "not-evaluated",
    "livePaymentsVerified": false,
    "indexingVerified": false,
    "apiOrigin": null,
    "notice": "Build-time release reference. Runtime readiness, deployment, payment settlement and external indexing are not evaluated here. Prices are proposed; this file cannot authorize execution or payment."
  }
}
