{
  "id": "messagepack-compose",
  "name": "Typed MessagePack composer",
  "description": "Compose stable MessagePack bytes from typed integers, text, binary, arrays and restricted-key maps; exact uint64/int64, encode only.",
  "category": "structured",
  "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": [
    "compose typed MessagePack",
    "encode exact int64 uint64 MessagePack",
    "create MessagePack binary record",
    "serialize typed binary payload"
  ],
  "whenToUse": [
    "A declared consumer requires this specific binary format and exact integer/binary distinctions",
    "Create a bounded offline configuration or protocol fixture from supplied typed values"
  ],
  "whenNotToUse": [
    "Floating point, dates, timestamp/tag extensions, missing-value primitives, custom objects, streaming or arbitrary maps",
    "Decode or inspect MessagePack bytes; decoding is explicitly held",
    "A universal MessagePack canonical form",
    "Network transport, authentication, signatures, COSE/CWT/WebAuthn, consumer schema validation, or execution of decoded content"
  ],
  "capabilities": [
    "Canonical decimal input strings preserve the full profile integer domain",
    "Unicode scalar text and strict canonical standard padded base64",
    "Duplicate typed keys rejected; text and byte strings remain distinct",
    "Complete semantic computation and result admission before payment challenge and again during execution",
    "Networkless deterministic supplied-input-only artifacts; externalRequests=0",
    "Service-defined stable ASCII-key ordering and shortest admitted wire forms; encode only"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 300000,
    "jsonNodes": 12000,
    "jsonDepth": 20,
    "wireBytes": 40000,
    "contentBytes": 32768,
    "valueNodes": 1024,
    "arrayItems": 512,
    "mapPairs": 128,
    "valueDepth": 5,
    "cborKeyBytes": 128,
    "messagepackKeyBytes": 64,
    "profile": "messagepack-stable-integer-v1",
    "actions": "encode",
    "integerMinimum": "-9223372036854775808",
    "integerMaximum": "18446744073709551615",
    "mapKeys": "ASCII text [A-Za-z_][A-Za-z0-9_.-]{0,63}; reserved names rejected",
    "determinismScope": "this-profile-only"
  },
  "related": [
    "cbor-typed-codec",
    "protobuf-message-compose",
    "zip-store-compose"
  ],
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "UNSAFE_KEY",
    "INVALID_INTEGER",
    "INTEGER_RANGE",
    "INVALID_KEY",
    "DUPLICATE_KEY",
    "INVALID_ENCODING",
    "UNSUPPORTED_TYPE",
    "NONDETERMINISTIC_ENCODING",
    "ENCODING_MISMATCH"
  ],
  "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": "messagepack-compose",
      "operation.category": "structured",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 300000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "serialization.profile": "messagepack-stable-integer-v1",
      "serialization.actions": "encode",
      "serialization.integerMin": "-9223372036854775808",
      "serialization.integerMax": "18446744073709551615",
      "serialization.mapKeyPolicy": "restricted-ascii-text-no-reserved-keys",
      "serialization.determinismScope": "this-profile-only",
      "serialization.decoderAvailable": false,
      "serialization.universalCanonicalEncoding": false,
      "serialization.maxMapKeyBytes": 64,
      "serialization.exactDecimalStringIntegers": true,
      "serialization.unicodePolicy": "unicode-scalars-no-normalization",
      "serialization.base64Policy": "rfc4648-standard-padded-canonical",
      "serialization.consumerCompatibilityVerified": false,
      "serialization.maxValueDepth": 5,
      "serialization.maxSemanticNodes": 1024,
      "serialization.maxArrayItems": 512,
      "serialization.maxMapPairs": 128,
      "serialization.maxWireBytes": 40000,
      "serialization.maxContentBytes": 32768,
      "serialization.floatTypes": false,
      "serialization.tagsOrExtensions": false,
      "serialization.streaming": false,
      "serialization.fullFormatVocabulary": false
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/messagepack-compose.md",
  "serviceContract": "/reference/services/messagepack-compose.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/messagepack-compose",
    "mpp": "/v1/mpp/messagepack-compose"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "action": {
        "type": "string",
        "const": "encode"
      },
      "value": {
        "$ref": "#/$defs/__schema0"
      }
    },
    "required": [
      "action",
      "value"
    ],
    "additionalProperties": false,
    "$defs": {
      "__schema0": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "null"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "boolean"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "integer"
              },
              "value": {
                "type": "string",
                "maxLength": 21
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "text"
              },
              "value": {
                "type": "string",
                "maxLength": 32768
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "bytes"
              },
              "base64": {
                "type": "string",
                "maxLength": 43692
              }
            },
            "required": [
              "type",
              "base64"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "array"
              },
              "items": {
                "maxItems": 512,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            },
            "required": [
              "type",
              "items"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "map"
              },
              "entries": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "integer"
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 21
                            }
                          },
                          "required": [
                            "type",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "text"
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 32768
                            }
                          },
                          "required": [
                            "type",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "value": {
                      "$ref": "#/$defs/__schema0"
                    }
                  },
                  "required": [
                    "key",
                    "value"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "entries"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "messagepack-compose",
        "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": "messagepack-stable-integer-v1"
          },
          "action": {
            "type": "string",
            "const": "encode"
          },
          "base64": {
            "type": "string",
            "maxLength": 53336
          },
          "byteLength": {
            "type": "integer",
            "minimum": 1,
            "maximum": 40000
          },
          "valueCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          },
          "maxValueDepth": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "determinismScope": {
            "type": "string",
            "const": "this-profile-only"
          }
        },
        "required": [
          "profile",
          "action",
          "base64",
          "byteLength",
          "valueCount",
          "maxValueDepth",
          "determinismScope"
        ],
        "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": {
    "action": "encode",
    "value": {
      "type": "map",
      "entries": [
        {
          "key": {
            "type": "text",
            "value": "id"
          },
          "value": {
            "type": "integer",
            "value": "18446744073709551615"
          }
        },
        {
          "key": {
            "type": "text",
            "value": "blob"
          },
          "value": {
            "type": "bytes",
            "base64": "AP8="
          }
        }
      ]
    }
  },
  "exampleResponse": {
    "operation": "messagepack-compose",
    "version": "0.29.0",
    "result": {
      "profile": "messagepack-stable-integer-v1",
      "action": "encode",
      "base64": "gqRibG9ixAIA/6JpZM///////////w==",
      "byteLength": 22,
      "valueCount": 5,
      "maxValueDepth": 1,
      "determinismScope": "this-profile-only"
    },
    "provenance": {
      "inputSha256": "a4ad025cad1b5ebe3f64d20dac6c26256b62901557a7a6b725a6f08919914302",
      "outputSha256": "d3c9928e42a45e1b8a879ed97400b790571dc529da0d3a483f238db6067743f4",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/messagepack-compose.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."
  }
}
