[
  {
    "name": "tariffs_duty_stack",
    "title": "Duty stack for an HTS code, origin and date",
    "description": "Base MFN rate plus every Chapter 99 line (Section 301, 232, IEEPA and others) that applies on the entry date (2025-01-01 to 2026-10-09), with the lines considered and not applied, totals, attributes the HTS code itself settles, and citations; with entered_value_usd, also the duty in dollars per line and in total (amounts). If a fact about the goods decides between lines and you did not declare it, the result branches on it. Reference calculation from the HTS code you supply: we do not classify goods. (Quota cost: 10 units.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "hts10": {
          "type": "string",
          "pattern": "^[0-9.]{10,13}$",
          "description": "10-digit HTSUS statistical number"
        },
        "origin": {
          "type": "string",
          "pattern": "^[A-Za-z]{2}$",
          "description": "Country of origin, ISO 3166-1 alpha-2"
        },
        "entry_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "export_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "mode": {
          "type": "string",
          "enum": [
            "vessel",
            "air",
            "truck",
            "rail",
            "mail",
            "postal",
            "other"
          ]
        },
        "declared_attributes": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          },
          "description": "Facts you declare, e.g. steel_content_value_share, usmca_qualifying"
        },
        "entered_value_usd": {
          "type": [
            "number",
            "string"
          ],
          "description": "Entered (customs) value in USD: adds the duty in dollars (amounts)"
        }
      },
      "required": [
        "hts10",
        "origin",
        "entry_date"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_duty_stack_batch",
    "title": "Duty stacks for many lines",
    "description": "Up to 200 lines (HTS code, origin, entry date, optional value and declared facts) in one call; each line answers as POST /v1/tariffs/duty-stack does, or with its own error. The summary adds up the dollar totals that are numbers. Reference calculations from the codes you supply: we do not classify goods. (Quota cost: 10 units per line.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "lines": {
          "type": "array",
          "minItems": 1,
          "maxItems": 200,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "hts10",
              "origin",
              "entry_date"
            ],
            "properties": {
              "line_id": {
                "type": "string",
                "maxLength": 40
              },
              "hts10": {
                "type": "string",
                "pattern": "^[0-9.]{10,13}$",
                "description": "10-digit HTSUS statistical number"
              },
              "origin": {
                "type": "string",
                "pattern": "^[A-Za-z]{2}$"
              },
              "entry_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "YYYY-MM-DD"
              },
              "export_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "YYYY-MM-DD"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "vessel",
                  "air",
                  "truck",
                  "rail",
                  "mail",
                  "postal",
                  "other"
                ]
              },
              "declared_attributes": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                }
              },
              "entered_value_usd": {
                "type": [
                  "number",
                  "string"
                ],
                "description": "Entered (customs) value in USD: adds the duty in dollars (amounts)"
              }
            }
          }
        }
      },
      "required": [
        "lines"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_compare_origins",
    "title": "Compare origins for one HTS code",
    "description": "One HTS code and entry date, up to 20 countries of origin: the total duty (and dollars with entered_value_usd), the Chapter 99 headings and branches for each, and the origins ranked lowest first where the total is a number. (Quota cost: 10 units per distinct origin.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "hts10": {
          "type": "string",
          "pattern": "^[0-9.]{10,13}$"
        },
        "origins": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$"
          }
        },
        "entry_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "export_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "mode": {
          "type": "string",
          "enum": [
            "vessel",
            "air",
            "truck",
            "rail",
            "mail",
            "postal",
            "other"
          ]
        },
        "declared_attributes": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "entered_value_usd": {
          "type": [
            "number",
            "string"
          ],
          "description": "Entered (customs) value in USD: adds the duty in dollars (amounts)"
        }
      },
      "required": [
        "hts10",
        "origins",
        "entry_date"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_hts_search",
    "title": "Search the tariff schedule's text",
    "description": "Lines of the current HTS release whose text (with their parent lines) contains every word as a whole word (or its plural or singular: screw = screws). By default the lines whose own text matches the words best come first ('cap screws' finds the line 'Cap screws' before 'Machine screws ... (not including cap screws)'; each line has its score and why); order=schedule gives schedule order. For finding a line whose wording you know: it orders text matches only, does not choose a code for a product, and is not classification. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "q": {
          "type": "string",
          "minLength": 2,
          "maxLength": 100
        },
        "chapter": {
          "type": "string",
          "pattern": "^\\d{2}$"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 25
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "default": 0
        },
        "order": {
          "type": "string",
          "enum": [
            "relevance",
            "schedule"
          ],
          "default": "relevance",
          "description": "relevance: how well the lines' text matches the words (the 500 lines with the most words in their own text are ranked); schedule: chapter, then line, through all matches"
        }
      },
      "required": [
        "q"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_hts_lookup",
    "title": "HTS line lookup",
    "description": "An HTS line (10 digits) or every statistical line under a subheading (8 digits): description with its hierarchy and units (current release), the column 1 General rate in force on a date, current special and column 2 rates, and the HTS revision in force. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "hts": {
          "type": "string",
          "pattern": "^[0-9.]{8,13}$"
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        }
      },
      "required": [
        "hts"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_hts_history",
    "title": "Revision history of an HTS line",
    "description": "Column 1 General rate intervals by HTS release (2025HTSBasic to the current release), and established/discontinued events from the Change Records. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "hts": {
          "type": "string",
          "pattern": "^[0-9.]{10,13}$"
        }
      },
      "required": [
        "hts"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_revisions",
    "title": "HTS revisions",
    "description": "HTS releases with their validity windows and links to the official PDF and Change Record. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_measure",
    "title": "A Chapter 99 measure",
    "description": "Every rule under a Chapter 99 heading, 9903 or 9904 (versions over time, country lists, quotas), or one rule by the rule_id GET /v1/tariffs/measures gives (the way to fetch rules without a heading, such as postal measures): authority, rate as published, valuation basis, countries, entry dates, scope size, conditions, stacking relations and citations with quotes. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "heading": {
          "type": "string",
          "pattern": "^(99\\d{2}\\.\\d{2}\\.\\d{2}|[A-Za-z0-9][A-Za-z0-9_./-]{2,59})$",
          "description": "Chapter 99 heading (e.g. 9903.01.24, 9904.02.01) or a rule_id (e.g. OTH-122-POSTAL; encode / as %2F)"
        }
      },
      "required": [
        "heading"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_measures_for_hts",
    "title": "Measures that reach an HTS code",
    "description": "Chapter 99 rules whose scope reaches an HTS code (listed by prefix, covering all goods except listed ones, or scoped by a description the code alone does not settle), optionally for one origin and entry date, newest first. Whether a measure applies to an entry is decided by the duty stack. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "hts": {
          "type": "string",
          "pattern": "^[0-9.]{4,13}$",
          "description": "HTS heading, subheading or line (4 to 10 digits)"
        },
        "origin": {
          "type": "string",
          "pattern": "^[A-Za-z]{2}$"
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000,
          "default": 0
        }
      },
      "required": [
        "hts"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_changes",
    "title": "Tariff change feed",
    "description": "Dated changes in the dataset, newest first: Chapter 99 measures starting or ending (by entry date, with the first citation), HTS lines established, discontinued or modified (USITC Change Records), and column 1 General rate changes between releases. Filter by date range, kind and HTS code. Measures already in force on the first entry date the rules cover (2025-01-01) are counted (in_force_at_coverage_start), not listed as starting then. (Quota cost: 1 unit.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "since": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "until": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "kind": {
          "type": "string",
          "enum": [
            "measure",
            "hts_line",
            "base_rate"
          ]
        },
        "hts": {
          "type": "string",
          "pattern": "^[0-9.]{4,13}$",
          "description": "Only changes reaching this heading, subheading or line; each measure event says how it reaches the code (scope_match: listed, all goods except listed codes, or a description the code alone does not settle)"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000,
          "default": 0
        }
      },
      "required": [
        "since"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  },
  {
    "name": "tariffs_ieepa_refund",
    "title": "IEEPA refund calculation for entry lines",
    "description": "For each entry line: the IEEPA percentage the duty stack applies on the entry date, the IEEPA duty on the entered value, the refundable amount (or the IEEPA duty actually paid, if you declare it), and the CAPE route (Phase 1, Phase 2, a later deployment, or outside CAPE) from liquidation and reconciliation status, with quotes from the CBP IEEPA Duty Refunds page. Interest is not computed. A reference calculation, not a CAPE declaration. (Quota cost: 10 units per line.)",
    "inputSchema": {
      "type": "object",
      "properties": {
        "as_of": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "YYYY-MM-DD"
        },
        "lines": {
          "type": "array",
          "minItems": 1,
          "maxItems": 500,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "hts10",
              "origin",
              "entry_date",
              "entered_value_usd"
            ],
            "properties": {
              "line_id": {
                "type": "string",
                "maxLength": 40
              },
              "entry_number": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              },
              "line_number": {
                "type": "integer",
                "minimum": 1
              },
              "hts10": {
                "type": "string",
                "pattern": "^[0-9.]{10,13}$",
                "description": "10-digit HTSUS number from the entry summary (you supply it; we do not classify)"
              },
              "origin": {
                "type": "string",
                "pattern": "^[A-Za-z]{2}$"
              },
              "entry_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "YYYY-MM-DD"
              },
              "export_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "YYYY-MM-DD"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "vessel",
                  "air",
                  "truck",
                  "rail",
                  "mail",
                  "postal",
                  "other"
                ]
              },
              "entered_value_usd": {
                "type": [
                  "number",
                  "string"
                ],
                "description": "Entered (customs) value in USD"
              },
              "declared_attributes": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                }
              },
              "ieepa_duty_paid_usd": {
                "type": [
                  "number",
                  "string"
                ],
                "description": "IEEPA duty actually paid on the line (ACE ES-003), if known"
              },
              "liquidation_status": {
                "type": "string",
                "enum": [
                  "unliquidated",
                  "liquidated",
                  "extended",
                  "suspended",
                  "under_review"
                ]
              },
              "liquidation_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "description": "YYYY-MM-DD"
              },
              "reconciliation_flag": {
                "type": "boolean"
              },
              "reconciliation_entry_on_file": {
                "type": "boolean"
              },
              "entry_type": {
                "type": "string",
                "pattern": "^\\d{1,2}$",
                "description": "CBP entry type code, e.g. 01, 11, 21"
              },
              "ace_filed": {
                "type": "boolean"
              },
              "drawback_designated": {
                "type": "boolean"
              },
              "open_protest": {
                "type": "boolean"
              },
              "adcvd_pending": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "required": [
        "lines"
      ],
      "additionalProperties": false
    },
    "annotations": {
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    }
  }
]
