{
  "resultType": "complete",
  "ttlMs": 0,
  "cacheScope": "private",
  "tools": [
    {
      "name": "trade8_list_markets",
      "title": "List Perpetual Markets",
      "description": "List perpetual markets with their native exchange contracts. Filter by instrument, exchange, or settlement asset. No API key is required.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Filter contracts by settlement asset."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 10; maximum 200.",
            "maximum": 200,
            "default": 10
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/MarketCatalog"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "MarketCatalog": {
            "type": "object",
            "properties": {
              "markets": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Market"
                },
                "description": "Instruments on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "markets",
              "pagination"
            ],
            "additionalProperties": false
          },
          "Market": {
            "type": "object",
            "properties": {
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "contract_type": {
                "type": "string",
                "enum": [
                  "perpetual"
                ],
                "description": "Perpetual futures instrument family; payoff details belong to each exchange contract."
              },
              "base_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "contracts": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/VenueContract"
                },
                "description": "Native contract mappings, grouped under one perpetual instrument."
              }
            },
            "required": [
              "instrument",
              "contract_type",
              "base_asset",
              "contracts"
            ],
            "additionalProperties": false
          },
          "VenueContract": {
            "type": "object",
            "properties": {
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "venue_instrument": {
                "type": "string",
                "description": "Native exchange symbol, such as BTCUSDT or BTC."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "settlement_assets": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "Asset symbol, such as BTC, USDT, or USDC."
                },
                "description": "Settlement tokens for a pool with side-dependent collateral."
              },
              "network": {
                "type": "string",
                "description": "Blockchain network for an onchain pool."
              },
              "payoff_type": {
                "type": "string",
                "enum": [
                  "linear",
                  "inverse"
                ],
                "description": "Contract payoff where specified by the exchange."
              },
              "contract_size": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Value represented by one native contract."
              },
              "contract_size_unit": {
                "type": "string",
                "description": "Unit of contract_size; multiply native contract quantity by contract_size to express face value."
              },
              "quantity_unit": {
                "type": "string",
                "description": "Native size unit: base asset, USD, or contract. Read contract_size for lot-based contracts."
              },
              "price_unit": {
                "type": "string",
                "description": "Price quote unit."
              },
              "price_rule": {
                "$ref": "#/$defs/PriceRule",
                "description": "Fixed increment or significant-figure pricing rule."
              },
              "quantity_step": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Size increment in quantity_unit."
              },
              "minimum_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Exchange LOT_SIZE minimum for limit orders."
              },
              "maximum_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Exchange LOT_SIZE maximum for limit orders; market-order limits may differ."
              },
              "minimum_notional": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Minimum order value in price_unit."
              },
              "max_leverage": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Published exchange ceiling at snapshot time; account risk tiers can lower it."
              }
            },
            "required": [
              "venue",
              "venue_instrument",
              "quantity_unit",
              "price_unit"
            ],
            "additionalProperties": false
          },
          "PriceRule": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "fixed_tick"
                  },
                  "tick_size": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "Price increment in price_unit."
                  }
                },
                "required": [
                  "type",
                  "tick_size"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "significant_figures"
                  },
                  "max_significant_figures": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Maximum significant figures for non-integer prices."
                  },
                  "max_decimal_places": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Maximum decimal places."
                  },
                  "integer_prices_allowed": {
                    "type": "boolean",
                    "description": "Integer prices may exceed the significant-figure limit."
                  }
                },
                "required": [
                  "type",
                  "max_significant_figures",
                  "max_decimal_places",
                  "integer_prices_allowed"
                ],
                "additionalProperties": false
              }
            ]
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_market",
      "title": "Read Contract Specifications",
      "description": "Read an instrument’s exchange symbols, settlement assets, price rules, and quantity increments. Public access; unknown instruments return HTTP 404.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Identifier of the resource to read or change."
          }
        },
        "required": [
          "instrument"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/MarketDetail"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "MarketDetail": {
            "type": "object",
            "properties": {
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "contract_type": {
                "type": "string",
                "enum": [
                  "perpetual"
                ],
                "description": "Perpetual futures instrument family; payoff details belong to each exchange contract."
              },
              "base_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "contracts": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/VenueContract"
                },
                "description": "Native contract mappings, grouped under one perpetual instrument."
              }
            },
            "required": [
              "instrument",
              "contract_type",
              "base_asset",
              "contracts"
            ],
            "additionalProperties": false
          },
          "VenueContract": {
            "type": "object",
            "properties": {
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "venue_instrument": {
                "type": "string",
                "description": "Native exchange symbol, such as BTCUSDT or BTC."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "settlement_assets": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "Asset symbol, such as BTC, USDT, or USDC."
                },
                "description": "Settlement tokens for a pool with side-dependent collateral."
              },
              "network": {
                "type": "string",
                "description": "Blockchain network for an onchain pool."
              },
              "payoff_type": {
                "type": "string",
                "enum": [
                  "linear",
                  "inverse"
                ],
                "description": "Contract payoff where specified by the exchange."
              },
              "contract_size": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Value represented by one native contract."
              },
              "contract_size_unit": {
                "type": "string",
                "description": "Unit of contract_size; multiply native contract quantity by contract_size to express face value."
              },
              "quantity_unit": {
                "type": "string",
                "description": "Native size unit: base asset, USD, or contract. Read contract_size for lot-based contracts."
              },
              "price_unit": {
                "type": "string",
                "description": "Price quote unit."
              },
              "price_rule": {
                "$ref": "#/$defs/PriceRule",
                "description": "Fixed increment or significant-figure pricing rule."
              },
              "quantity_step": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Size increment in quantity_unit."
              },
              "minimum_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Exchange LOT_SIZE minimum for limit orders."
              },
              "maximum_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Exchange LOT_SIZE maximum for limit orders; market-order limits may differ."
              },
              "minimum_notional": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Minimum order value in price_unit."
              },
              "max_leverage": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Published exchange ceiling at snapshot time; account risk tiers can lower it."
              }
            },
            "required": [
              "venue",
              "venue_instrument",
              "quantity_unit",
              "price_unit"
            ],
            "additionalProperties": false
          },
          "PriceRule": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "fixed_tick"
                  },
                  "tick_size": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "Price increment in price_unit."
                  }
                },
                "required": [
                  "type",
                  "tick_size"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "significant_figures"
                  },
                  "max_significant_figures": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Maximum significant figures for non-integer prices."
                  },
                  "max_decimal_places": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Maximum decimal places."
                  },
                  "integer_prices_allowed": {
                    "type": "boolean",
                    "description": "Integer prices may exceed the significant-figure limit."
                  }
                },
                "required": [
                  "type",
                  "max_significant_figures",
                  "max_decimal_places",
                  "integer_prices_allowed"
                ],
                "additionalProperties": false
              }
            ]
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_exchanges",
      "title": "List Exchanges",
      "description": "List all centralized and decentralized exchanges shown in the Trade8 integration directory, with their IDs and official websites.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "centralized",
              "decentralized"
            ],
            "description": "Exchange category."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/VenueCatalog"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "VenueCatalog": {
            "type": "object",
            "properties": {
              "venues": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Venue"
                },
                "description": "Exchanges on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "venues",
              "pagination"
            ],
            "additionalProperties": false
          },
          "Venue": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "name": {
                "type": "string",
                "description": "Exchange display name."
              },
              "type": {
                "type": "string",
                "enum": [
                  "centralized",
                  "decentralized"
                ],
                "description": "Exchange category."
              },
              "website": {
                "type": "string",
                "description": "Official exchange website.",
                "format": "uri"
              }
            },
            "required": [
              "id",
              "name",
              "type",
              "website"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_order_book",
      "title": "Read an Order Book",
      "description": "Read one exchange book. The example uses Hyperliquid BTC settled in USDC. Subscribe to orderbook for sequenced updates.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Identifier of the resource to read or change."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Filter contracts by settlement asset."
          },
          "depth": {
            "type": "integer",
            "enum": [
              10,
              20,
              50
            ],
            "default": 20,
            "description": "Number of levels per side: 10, 20, or 50. Default 20."
          }
        },
        "required": [
          "instrument",
          "venue",
          "settlement_asset"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/OrderBook"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "OrderBook": {
            "type": "object",
            "properties": {
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "book_sequence": {
                "type": "integer",
                "minimum": 0,
                "description": "Monotonic sequence for this exchange/instrument book."
              },
              "bids": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/PriceLevel"
                },
                "description": "Bids, highest price first."
              },
              "asks": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/PriceLevel"
                },
                "description": "Asks, lowest price first."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "instrument",
              "venue",
              "settlement_asset",
              "book_sequence",
              "bids",
              "asks",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "PriceLevel": {
            "type": "object",
            "properties": {
              "price": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Price in the contract quote asset."
              },
              "quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Absolute resting quantity in the contract base unit. Zero removes a level in a delta."
              }
            },
            "required": [
              "price",
              "quantity"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_funding",
      "title": "Read Funding Rates",
      "description": "Compare rates with their settlement interval. The Binance example is an eight-hour indicative rate; other exchanges can use different intervals.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Filter contracts by settlement asset."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "instrument"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "funding": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Funding"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "funding",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Funding": {
            "type": "object",
            "properties": {
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "rate": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Decimal funding rate for the stated interval: 0.0001 = 0.01%."
              },
              "interval_hours": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Hours covered by this rate."
              },
              "next_funding_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "type": {
                "type": "string",
                "enum": [
                  "indicative",
                  "final"
                ],
                "description": "Indicative rates can change before settlement."
              }
            },
            "required": [
              "instrument",
              "venue",
              "settlement_asset",
              "rate",
              "interval_hours",
              "next_funding_at",
              "type"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_accounts",
      "title": "List Trading Accounts",
      "description": "Read main accounts and subaccounts available to this key, including enabled exchanges.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "accounts": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Account"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "accounts",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "name": {
                "type": "string",
                "description": "Account display name."
              },
              "type": {
                "type": "string",
                "enum": [
                  "main",
                  "subaccount"
                ],
                "description": "Account hierarchy role."
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "read_only",
                  "suspended"
                ],
                "description": "Account access state."
              },
              "reporting_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "enabled_venues": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
                },
                "description": "Exchanges enabled for this account."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "account_id",
              "name",
              "type",
              "status",
              "reporting_asset",
              "enabled_venues",
              "created_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_balances",
      "title": "Read Account Balances",
      "description": "Read each asset separately. Custody balances and collateral allocations appear in the Custody and Settlement endpoints.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "balances": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Balance"
                },
                "description": "Ledger balances by asset."
              }
            },
            "required": [
              "balances"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Balance": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "total": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Ledger balance in this asset, excluding unrealized P&L."
              },
              "available": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Uncommitted ledger balance."
              },
              "committed": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Amount allocated or reserved. available + committed = total."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "account_id",
              "asset",
              "total",
              "available",
              "committed",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_fees",
      "title": "Read Account Trading Fees",
      "description": "Read account-specific maker, taker, and Trade8 charges by contract. Example rates illustrate the response structure.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Filter contracts by settlement asset."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "fees": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Fee"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "fees",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Fee": {
            "type": "object",
            "properties": {
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "maker_rate": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Decimal maker fee rate. Negative values indicate rebates."
              },
              "taker_rate": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Decimal taker fee rate."
              },
              "trade8_rate": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Additional Trade8 trading charge as a decimal rate."
              },
              "effective_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "venue",
              "instrument",
              "settlement_asset",
              "maker_rate",
              "taker_rate",
              "trade8_rate",
              "effective_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_positions",
      "title": "Read Open Positions",
      "description": "Read exposure, margin mode, leverage, P&L, and liquidation estimates separately for each exchange contract.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "positions": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Position"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "positions",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Position": {
            "type": "object",
            "properties": {
              "position_id": {
                "type": "string",
                "description": "Position identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "side": {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ],
                "description": "Position direction."
              },
              "quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Absolute base quantity; zero marks a closed position update."
              },
              "entry_price": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity-weighted entry price."
              },
              "mark_price": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Current exchange mark price."
              },
              "unrealized_pnl": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Unrealized P&L in the settlement asset."
              },
              "liquidation_price": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Estimated exchange liquidation price, or null when unavailable."
              },
              "leverage": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Configured leverage multiplier."
              },
              "margin_mode": {
                "type": "string",
                "enum": [
                  "cross",
                  "isolated"
                ],
                "description": "Exchange margin mode."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "position_id",
              "account_id",
              "instrument",
              "venue",
              "settlement_asset",
              "side",
              "quantity",
              "entry_price",
              "mark_price",
              "unrealized_pnl",
              "liquidation_price",
              "leverage",
              "margin_mode",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_risk",
      "title": "Read Margin and Risk",
      "description": "Read exchange-level equity, margin requirements, and available capacity. Compare assets within their own settlement denomination.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "risk": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Risk"
                },
                "description": "Risk by exchange and settlement asset."
              }
            },
            "required": [
              "risk"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Risk": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "equity": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Equity in settlement_asset, including unrealized P&L."
              },
              "initial_margin": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Initial margin requirement."
              },
              "maintenance_margin": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Maintenance margin requirement."
              },
              "available_margin": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Margin available for new positions after reservations."
              },
              "margin_ratio": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Maintenance margin / equity. Rising values indicate less headroom."
              },
              "state": {
                "type": "string",
                "enum": [
                  "normal",
                  "warning",
                  "reduce_only",
                  "liquidating"
                ],
                "description": "Exchange risk state."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "account_id",
              "venue",
              "settlement_asset",
              "equity",
              "initial_margin",
              "maintenance_margin",
              "available_margin",
              "margin_ratio",
              "state",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_orders",
      "title": "List Orders",
      "description": "Read parent orders in ascending created_at order. Open-order queries include all open orders unless time filters are explicit. Use status=open for pending, accepted, trigger_pending, and partially_filled orders.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "terminal",
              "any"
            ],
            "description": "Open, terminal, or any. Default open."
          },
          "start_time": {
            "type": "string",
            "format": "date-time",
            "description": "Inclusive UTC start; default 24 hours before end_time."
          },
          "end_time": {
            "type": "string",
            "format": "date-time",
            "description": "Exclusive UTC end; default request time."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "orders": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Order"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "orders",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Order": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "description": "Trade8 parent order identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "client_order_id": {
                "type": "string",
                "description": "Unique client identifier within the account. Retain it for reconciliation.",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ],
                "description": "Direction."
              },
              "type": {
                "type": "string",
                "description": "Order type."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "accepted",
                  "trigger_pending",
                  "partially_filled",
                  "filled",
                  "cancelled",
                  "rejected",
                  "expired"
                ],
                "description": "Current order lifecycle state."
              },
              "requested_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Total requested base quantity."
              },
              "filled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Cumulative executed base quantity."
              },
              "remaining_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity still open or awaiting execution. Zero after a terminal state."
              },
              "cancelled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity cancelled, rejected, or expired without a fill."
              },
              "average_fill_price": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity-weighted price of actual fills; null before the first fill."
              },
              "revision": {
                "type": "integer",
                "minimum": 1,
                "description": "Monotonic order revision. Use for optimistic concurrency and event reconciliation."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "order_id",
              "account_id",
              "client_order_id",
              "instrument",
              "settlement_asset",
              "side",
              "type",
              "status",
              "requested_quantity",
              "filled_quantity",
              "remaining_quantity",
              "cancelled_quantity",
              "average_fill_price",
              "revision",
              "created_at",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_get_order",
      "title": "Read an Order",
      "description": "Reconcile lifecycle state and cumulative quantities. Compare revision before applying an older REST result over a streamed update.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Identifier of the resource to read or change."
          },
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          }
        },
        "required": [
          "order_id",
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/Order"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Order": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "description": "Trade8 parent order identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "client_order_id": {
                "type": "string",
                "description": "Unique client identifier within the account. Retain it for reconciliation.",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ],
                "description": "Direction."
              },
              "type": {
                "type": "string",
                "description": "Order type."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "accepted",
                  "trigger_pending",
                  "partially_filled",
                  "filled",
                  "cancelled",
                  "rejected",
                  "expired"
                ],
                "description": "Current order lifecycle state."
              },
              "requested_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Total requested base quantity."
              },
              "filled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Cumulative executed base quantity."
              },
              "remaining_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity still open or awaiting execution. Zero after a terminal state."
              },
              "cancelled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity cancelled, rejected, or expired without a fill."
              },
              "average_fill_price": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity-weighted price of actual fills; null before the first fill."
              },
              "revision": {
                "type": "integer",
                "minimum": 1,
                "description": "Monotonic order revision. Use for optimistic concurrency and event reconciliation."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "order_id",
              "account_id",
              "client_order_id",
              "instrument",
              "settlement_asset",
              "side",
              "type",
              "status",
              "requested_quantity",
              "filled_quantity",
              "remaining_quantity",
              "cancelled_quantity",
              "average_fill_price",
              "revision",
              "created_at",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_find_order",
      "title": "Find an Order by Client ID",
      "description": "Find the existing order after a timeout or lost acknowledgement using the identifier you saved before submission.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "client_order_id": {
            "type": "string",
            "description": "Identifier of the resource to read or change."
          },
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          }
        },
        "required": [
          "client_order_id",
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/Order"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Order": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "description": "Trade8 parent order identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "client_order_id": {
                "type": "string",
                "description": "Unique client identifier within the account. Retain it for reconciliation.",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ],
                "description": "Direction."
              },
              "type": {
                "type": "string",
                "description": "Order type."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "accepted",
                  "trigger_pending",
                  "partially_filled",
                  "filled",
                  "cancelled",
                  "rejected",
                  "expired"
                ],
                "description": "Current order lifecycle state."
              },
              "requested_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Total requested base quantity."
              },
              "filled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Cumulative executed base quantity."
              },
              "remaining_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity still open or awaiting execution. Zero after a terminal state."
              },
              "cancelled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity cancelled, rejected, or expired without a fill."
              },
              "average_fill_price": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity-weighted price of actual fills; null before the first fill."
              },
              "revision": {
                "type": "integer",
                "minimum": 1,
                "description": "Monotonic order revision. Use for optimistic concurrency and event reconciliation."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "order_id",
              "account_id",
              "client_order_id",
              "instrument",
              "settlement_asset",
              "side",
              "type",
              "status",
              "requested_quantity",
              "filled_quantity",
              "remaining_quantity",
              "cancelled_quantity",
              "average_fill_price",
              "revision",
              "created_at",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_fills",
      "title": "Read Account Fills",
      "description": "Recover executions across all orders in ascending executed_at order. Deduplicate on fill_id.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "start_time": {
            "type": "string",
            "format": "date-time",
            "description": "Inclusive UTC start; default 24 hours before end_time."
          },
          "end_time": {
            "type": "string",
            "format": "date-time",
            "description": "Exclusive UTC end; default request time."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "fills": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Fill"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "fills",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Fill": {
            "type": "object",
            "properties": {
              "fill_id": {
                "type": "string",
                "description": "Unique Trade8 fill identifier."
              },
              "order_id": {
                "type": "string",
                "description": "Parent order identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "venue_order_id": {
                "type": "string",
                "description": "Native exchange order identifier."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Executed base quantity."
              },
              "price": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Execution price in the quote asset."
              },
              "fee": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Trading charge for this fill; negative indicates a rebate."
              },
              "fee_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "liquidity": {
                "type": "string",
                "enum": [
                  "maker",
                  "taker"
                ],
                "description": "Liquidity role at execution."
              },
              "executed_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "fill_id",
              "order_id",
              "account_id",
              "instrument",
              "venue",
              "venue_order_id",
              "settlement_asset",
              "quantity",
              "price",
              "fee",
              "fee_asset",
              "liquidity",
              "executed_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_custodians",
      "title": "List Custody Integrations",
      "description": "Read custody providers such as Ceffu, Copper, Coinbase Custody, BitGo, Komainu, and Zodia Custody. Linked custody accounts supply the eligible exchange routes.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "custodians": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Custodian"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "custodians",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Custodian": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Custodian identifier from the integration catalog."
              },
              "name": {
                "type": "string",
                "description": "Custodian display name."
              },
              "services": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "custody",
                    "off_exchange_collateral"
                  ],
                  "description": "Supported service."
                },
                "description": "Services enabled for this integration."
              }
            },
            "required": [
              "id",
              "name",
              "services"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_allocations",
      "title": "Read Collateral Allocations",
      "description": "Track custody collateral committed to each exchange and its acknowledgement state.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "allocations": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Allocation"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "allocations",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Allocation": {
            "type": "object",
            "properties": {
              "allocation_id": {
                "type": "string",
                "description": "Collateral allocation identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "client_allocation_id": {
                "type": "string",
                "description": "Unique client identifier within the account. Retain it for reconciliation.",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "custody_account_id": {
                "type": "string",
                "description": "Source custody account."
              },
              "custodian": {
                "type": "string",
                "description": "Custodian identifier."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "amount": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Amount in asset units."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "active",
                  "releasing",
                  "released",
                  "rejected"
                ],
                "description": "Active means the exchange has acknowledged usable collateral."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "allocation_id",
              "account_id",
              "client_allocation_id",
              "custody_account_id",
              "custodian",
              "venue",
              "asset",
              "amount",
              "status",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_list_settlements",
      "title": "Read Settlement Records",
      "description": "Reconcile custody and exchange settlement cycles. The Copper/OKX example credits 125.50 USDT to custody.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier."
          },
          "start_time": {
            "type": "string",
            "format": "date-time",
            "description": "Inclusive UTC start; default 24 hours before end_time."
          },
          "end_time": {
            "type": "string",
            "format": "date-time",
            "description": "Exclusive UTC end; default request time."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size, default 50; maximum 200.",
            "maximum": 200,
            "default": 50
          },
          "cursor": {
            "type": "string",
            "description": "Opaque next_cursor from the preceding response."
          }
        },
        "required": [
          "account_id"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "settlements": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Settlement"
                },
                "description": "Results on this page."
              },
              "pagination": {
                "$ref": "#/$defs/Pagination"
              }
            },
            "required": [
              "settlements",
              "pagination"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Settlement": {
            "type": "object",
            "properties": {
              "settlement_id": {
                "type": "string",
                "description": "Settlement record identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "custodian": {
                "type": "string",
                "description": "Custodian identifier."
              },
              "venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "amount": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Positive credits the custody account; negative debits it."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "processing",
                  "completed",
                  "failed"
                ],
                "description": "Settlement processing state."
              },
              "cycle_start": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "cycle_end": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "settlement_id",
              "account_id",
              "custodian",
              "venue",
              "asset",
              "amount",
              "status",
              "cycle_start",
              "cycle_end",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Pagination": {
            "type": "object",
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Opaque cursor for the next page; null at the end."
              },
              "has_more": {
                "type": "boolean",
                "description": "True when another page is available."
              }
            },
            "required": [
              "next_cursor",
              "has_more"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_create_order",
      "title": "Create an Order",
      "description": "Submit a parent order with exchange and settlement constraints. The example posts a BTC limit order across Binance and Bybit.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "order": {
            "$ref": "#/$defs/OrderRequest"
          }
        },
        "required": [
          "idempotency_key",
          "order"
        ],
        "additionalProperties": false,
        "$defs": {
          "OrderRequest": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "client_order_id": {
                "type": "string",
                "description": "Unique client identifier within the account. Retain it for reconciliation.",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ],
                "description": "Trade direction."
              },
              "type": {
                "type": "string",
                "enum": [
                  "market",
                  "limit",
                  "stop_market",
                  "stop_limit",
                  "take_profit_market",
                  "take_profit_limit"
                ],
                "description": "Order type."
              },
              "quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Order size in the market base unit."
              },
              "limit_price": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Required for limit, stop_limit, and take_profit_limit."
              },
              "trigger_price": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Required for stop and take-profit orders."
              },
              "trigger_source": {
                "type": "string",
                "enum": [
                  "mark",
                  "last",
                  "index"
                ],
                "description": "Price used by a conditional order."
              },
              "trigger_venue": {
                "type": "string",
                "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
              },
              "time_in_force": {
                "type": "string",
                "enum": [
                  "GTC",
                  "IOC",
                  "FOK"
                ],
                "description": "Limit orders: GTC, IOC, or FOK. Market orders: IOC. Default GTC for limit variants and IOC for market variants."
              },
              "post_only": {
                "type": "boolean",
                "description": "Default false. Supported on ordinary GTC limit orders; crossing orders are rejected."
              },
              "reduce_only": {
                "type": "boolean",
                "description": "Default false. Restricts fills to reducing the current exchange position."
              },
              "routing": {
                "type": "string",
                "enum": [
                  "auto",
                  "direct"
                ],
                "description": "Auto chooses eligible exchanges; direct requires exactly one allowed exchange."
              },
              "venue_policy": {
                "$ref": "#/$defs/VenuePolicy"
              },
              "self_trade_prevention": {
                "type": "string",
                "enum": [
                  "cancel_newest",
                  "cancel_oldest",
                  "cancel_both"
                ],
                "description": "Action when orders from the same account would match. Default cancel_newest."
              }
            },
            "required": [
              "account_id",
              "client_order_id",
              "instrument",
              "settlement_asset",
              "side",
              "type",
              "quantity",
              "routing"
            ],
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "properties": {
                    "time_in_force": {
                      "const": "FOK"
                    }
                  },
                  "required": [
                    "time_in_force"
                  ]
                },
                "then": {
                  "properties": {
                    "routing": {
                      "const": "direct"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "type": {
                      "enum": [
                        "limit",
                        "stop_limit",
                        "take_profit_limit"
                      ]
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                "then": {
                  "required": [
                    "limit_price"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "type": {
                      "enum": [
                        "stop_market",
                        "stop_limit",
                        "take_profit_market",
                        "take_profit_limit"
                      ]
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                "then": {
                  "required": [
                    "trigger_price",
                    "trigger_source",
                    "trigger_venue"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "type": {
                      "enum": [
                        "market",
                        "stop_market",
                        "take_profit_market"
                      ]
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                "then": {
                  "properties": {
                    "time_in_force": {
                      "const": "IOC"
                    },
                    "post_only": {
                      "const": false
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "post_only": {
                      "const": true
                    }
                  },
                  "required": [
                    "post_only"
                  ]
                },
                "then": {
                  "properties": {
                    "type": {
                      "const": "limit"
                    },
                    "time_in_force": {
                      "const": "GTC"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "routing": {
                      "const": "direct"
                    }
                  },
                  "required": [
                    "routing"
                  ]
                },
                "then": {
                  "required": [
                    "venue_policy"
                  ],
                  "properties": {
                    "venue_policy": {
                      "required": [
                        "allowed"
                      ],
                      "properties": {
                        "allowed": {
                          "minItems": 1,
                          "maxItems": 1
                        }
                      }
                    }
                  }
                }
              }
            ]
          },
          "VenuePolicy": {
            "type": "object",
            "properties": {
              "allowed": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
                },
                "description": "Only these exchanges may receive child orders.",
                "minItems": 1
              },
              "excluded": {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
                },
                "description": "Exchanges excluded from routing; must be disjoint from allowed."
              },
              "max_slippage_bps": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Maximum market-order slippage from the consolidated best price at acceptance, in basis points. Execution stops at this boundary."
              }
            },
            "required": [],
            "additionalProperties": false
          }
        }
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/Order"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Order": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "description": "Trade8 parent order identifier."
              },
              "account_id": {
                "type": "string",
                "description": "Trading account identifier within the authorized account grant."
              },
              "client_order_id": {
                "type": "string",
                "description": "Unique client identifier within the account. Retain it for reconciliation.",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "instrument": {
                "type": "string",
                "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
              },
              "settlement_asset": {
                "type": "string",
                "description": "Asset symbol, such as BTC, USDT, or USDC."
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ],
                "description": "Direction."
              },
              "type": {
                "type": "string",
                "description": "Order type."
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "accepted",
                  "trigger_pending",
                  "partially_filled",
                  "filled",
                  "cancelled",
                  "rejected",
                  "expired"
                ],
                "description": "Current order lifecycle state."
              },
              "requested_quantity": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Total requested base quantity."
              },
              "filled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Cumulative executed base quantity."
              },
              "remaining_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity still open or awaiting execution. Zero after a terminal state."
              },
              "cancelled_quantity": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity cancelled, rejected, or expired without a fill."
              },
              "average_fill_price": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Quantity-weighted price of actual fills; null before the first fill."
              },
              "revision": {
                "type": "integer",
                "minimum": 1,
                "description": "Monotonic order revision. Use for optimistic concurrency and event reconciliation."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "order_id",
              "account_id",
              "client_order_id",
              "instrument",
              "settlement_asset",
              "side",
              "type",
              "status",
              "requested_quantity",
              "filled_quantity",
              "remaining_quantity",
              "cancelled_quantity",
              "average_fill_price",
              "revision",
              "created_at",
              "updated_at"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": true
      }
    },
    {
      "name": "trade8_cancel_order",
      "title": "Cancel an Order",
      "description": "Request cancellation of the open remainder across its child orders. Track the final quantities through the orders channel or order lookup.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Identifier of the resource to read or change."
          },
          "account_id": {
            "type": "string",
            "description": "Authorized trading account."
          },
          "idempotency_key": {
            "type": "string",
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9_-]+$"
          }
        },
        "required": [
          "order_id",
          "account_id",
          "idempotency_key"
        ],
        "additionalProperties": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "$ref": "#/$defs/Cancellation"
          },
          {
            "$ref": "#/$defs/Error"
          }
        ],
        "$defs": {
          "Cancellation": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "string",
                "description": "Parent identifier."
              },
              "cancellation_status": {
                "type": "string",
                "enum": [
                  "pending",
                  "completed"
                ],
                "description": "Follow the order stream or order lookup for the final quantities."
              },
              "requested_at": {
                "type": "string",
                "format": "date-time",
                "description": "UTC timestamp in RFC 3339 format."
              }
            },
            "required": [
              "order_id",
              "cancellation_status",
              "requested_at"
            ],
            "additionalProperties": false
          },
          "Error": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string",
                "description": "Support correlation identifier; also returned in X-Request-ID."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable machine-readable error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "Human-readable explanation."
                  },
                  "retryable": {
                    "type": "boolean",
                    "description": "Whether the operation may be retried after the documented recovery steps."
                  },
                  "details": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "description": "JSON field or query parameter."
                        },
                        "reason": {
                          "type": "string",
                          "description": "Validation or policy reason."
                        }
                      },
                      "required": [
                        "field",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Field-level details; empty for errors without a specific field."
                  }
                },
                "required": [
                  "code",
                  "message",
                  "retryable",
                  "details"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "request_id",
              "error"
            ],
            "additionalProperties": false
          }
        }
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": true,
        "openWorldHint": true
      }
    }
  ]
}
