Skip to main content
Glama

tariff-resolver

npm version CI coverage: ≥95% lines, CI-enforced npm downloads node MCP Registry license: MIT

An MCP server that turns your AI assistant into a US import duty research tool — built on official USITC Harmonized Tariff Schedule data (US Government public domain, 35,000+ tariff lines).

  • 🔍 HTS code candidates from plain product descriptions, with CBP CROSS ruling links

  • 🧮 Landed-cost components: MFN/FTA base rates + Chapter 99 additional duties (IEEPA / Section 301 / 232) + MPF/HMF fees

  • 📡 Tariff change tracking: watchlist your HTS codes, diff rates between HTS revisions

  • 🤖 AI-optimized, hallucination-resistant: returns the actual Chapter 99 rule text with parsed rates, so your LLM reasons over real exception chains instead of inventing 2024-era numbers

Demo: resolving duties for a vacuum flask from China, then switching product and origin — the full Chapter 99 stack recalculates live

Why now: since the de minimis exemption ended (Aug 29, 2025), every US-bound shipment needs an HTS code and duty payment — and 2025–26 rates keep changing by executive order.

Not affiliated with any government agency. Outputs are candidates/estimates for pre-broker screening — not customs, legal, or tax advice. Estimates exclude AD/CVD duties.

Install

Requires Node.js ≥ 18.

claude mcp add tariff-resolver -- npx -y tariff-resolver

Or in any MCP client config:

{ "mcpServers": { "tariff-resolver": { "command": "npx", "args": ["-y", "tariff-resolver"] } } }

Claude Desktop (one-click): download tariff-resolver-<version>.mcpb from Releases and double-click it — no terminal needed.

Related MCP server: mcp-sputnikx-market

💡 Try these prompts

  • Basic search: "Find the HTS code for a men's 100% cotton t-shirt."

  • Full scenario: "Calculate the tariff scenario for HTS 6109.10.00, origin China, customs value $5,000, ocean freight."

  • Sourcing decision: "I'm importing $10k of stainless steel vacuum flasks. Compare landed cost if I source from China vs Vietnam."

  • Stay current: "Watch tariff changes for my catalog: 6109.10.00, 8507.60.00, 9617.00.10."

Tools

Tool

What it does

search_hs_candidates

Product description → top HTS candidates with rates + CBP CROSS ruling links

calculate_tariff_scenario

HTS code + origin + value (+ weight) → structured JSON: base MFN/FTA rate, candidate Chapter 99 layers with per-layer match/confidence, sourced possibly_expired bucket, MPF/HMF

watch_tariff_changes

Register HTS codes to a local watchlist

check_tariff_updates

Diff current vs previous HTS revision — see exactly which rates changed

dataset_info

Data revision date, row counts, source, license

Design

The server does the retrieval; your LLM does the reasoning. Chapter 99 rules are returned verbatim (with parsed adder_pct where applicable) so the model reads the actual exception chains instead of trusting a black-box calculation. Rates for 10-digit statistical suffixes inherit from their parent rate line. Headings the schedule marks as dead — terminated, suspended, expired — are filtered out and counted, and the USITC's own compiler_note rides along with any rule that carries one.

Status overrides. data/status_overrides.json is a short, sourced list of Chapter 99 headings whose collection has stopped, expired, or been suspended even though the schedule still prints them. A layer matching an entry is returned under possibly_expired with the entry's status, reason, source URL and as_of date instead of in layers. Every entry carries a CBP, Federal Register or USITC source; pull requests adding entries must include one.

What the data cannot tell you. The published schedule is wrong in both directions at any given moment, so every result carries a stacking_warning and the snapshot date. Provisions whose collection has already stopped keep printing with no end date — IEEPA and Section 122 headings are the recurring case — and newly proclaimed actions appear in the schedule days after they take effect. Totalling every layer the schedule prints yields a rate nobody is charged. Treat the layers as candidates, and verify collection status against CBP CSMS messages before relying on a stack.

One core, two front doors. All duty logic lives in tariff-resolver/core (pure TypeScript, no filesystem or network): resolveDuty(dataset, { hts, origin, value_usd?, ocean? })origin takes an ISO-3166 alpha-2 code or an English country name — returns the base line, separate MPF/HMF, every candidate Chapter 99 layer with match and confidence, a sourced possibly_expired bucket, and the snapshot date. The MCP tool calls it; so can any Node or edge runtime. A country name that is not recognised returns the ORIGIN_UNKNOWN error rather than a partial match, so a misspelled origin can never quietly resolve to a thinner stack of layers.

Data

Ships with a full HTS snapshot, fetched from USITC's official JSON API (US Government public domain). Refresh anytime:

python3 scripts/fetch_hts.py   # ~2 min, fails hard rather than write a partial dataset

dataset_info reports the revision date your queries run against.

Privacy Policy

tariff-resolver runs entirely on your machine and collects nothing:

  • Data collection: none. No queries, telemetry, analytics, or usage data are collected or transmitted.

  • Usage and storage: your watchlist is stored in a local JSON file on your machine; all lookups run against the bundled local dataset.

  • Third-party sharing: none. The server makes no network requests at runtime. (The optional scripts/fetch_hts.py refresh script contacts only the official USITC API.)

  • Data retention: nothing to retain — delete the local watchlist file at any time.

  • Contact: tom@opsloft.dev

Full policy: https://opsloft.dev/privacy

License

MIT. Tariff data is a work of the US Government (public domain).

Available Tools

5 tools
calculate_tariff_scenarioCalculate tariff scenarioA
Read-only

Returns the HTS code's MFN/FTA base rate, ALL active chapter 99 rules (IEEPA/301/232 additional duties) matching the origin as verbatim text, and MPF/HMF fees. The LLM should walk the chapter-99 exception chains itself to stack the right duty layers, explain each step to the user, and always note this is an estimate.

ParametersJSON Schema
NameRequiredDescriptionDefault
hts_codeYes8-10 digit HTS code, with or without dots
quantityNoQuantity in the code's units (No./Dz Pcs...) — needed for per-piece specific duties
weight_kgNoTotal weight (kg) — REQUIRED when the code carries a specific duty per kg (e.g. '12.4¢/kg')
ocean_freightNoOcean shipment? (applies HMF)
origin_countryYesCountry of origin (English name, e.g. 'China', 'Vietnam', 'Mexico')
customs_value_usdYesCustoms value of the shipment (USD)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish readOnlyHint=true. The description adds important behavior beyond that: it returns chapter-99 rule text verbatim rather than a final computed rate, instructs the LLM to walk exception chains itself, and requires the output to be labeled as an estimate. This is useful and non-obvious behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact: the first sentence enumerates return values, and the second captures the agent workflow and estimate caveat. Every sentence adds meaningful guidance without filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, but the description explains the output categories and tells the LLM how to use and present the results. It does not specify an exact response shape, but that is not essential for correct invocation given the parameter schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all six parameters adequately. The description adds no parameter-level detail beyond mentioning origin and HTS code, which keeps this at the baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Returns') and names concrete outputs: MFN/FTA base rate, active chapter 99 rules, and MPF/HMF fees. This clearly distinguishes the tool from sibling tools like search_hs_candidates, watch_tariff_changes, and check_tariff_updates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context that the tool is for computing a tariff scenario from an HTS code and origin, and includes explicit procedural guidance for the LLM. It does not explicitly say when NOT to use it or name alternatives, so it misses the highest bar.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_tariff_updatesCheck tariff changes between revisionsD
Read-only

Compares the current HTS snapshot with the previously fetched one. Call without codes to check the whole watchlist. Returns each change: code, column (general/special/other/additionalDuties), old → new value.

ParametersJSON Schema
NameRequiredDescriptionDefault
hts_codesNoLimit to these codes (default: the watchlist)

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description fails to reveal any behavioral aspects, and the annotation readOnlyHint=true suggests safe operation, but the description adds no clarity on side effects or authorization needs. Without a description, behavioral transparency is entirely absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

With zero words, it is concise but lacks substance, making the criterion 'appropriate length relative to purpose'. The description has no structure to evaluate, so it cannot be effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 1-parameter helper tool, the description is empty, failing to cover required behaviors like whether it mutates state or how to use it. The description is absent, so it cannot be complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema includes one parameter, but the description gives no insight into its meaning beyond the schema itself. The schema description is decent, but the description should complement it. No added value is provided beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description is absent, so it cannot describe the purpose with a verb and resource. It does not differentiate the tool from siblings. The title and name provide some clues, but the description itself is missing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description is empty, leaving the AI without instructions on when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

dataset_infoDataset infoA
Read-only

Fetch date, source, license, row counts — use to check data freshness.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The readOnlyHint annotation already signals this is a safe read operation, and the description aligns with that by saying 'Fetch.' It adds modest context by listing the returned dataset attributes (date, source, license, row counts), but does not go beyond that with additional behavioral details such as output formatting or freshness semantics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, information-dense sentence with no filler. The main purpose and the usage guidance are both front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a simple, zero-parameter metadata retrieval tool. The description covers what it returns and why to use it, and the readOnlyHint covers safety. Nothing essential is missing for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. There is nothing for the description to clarify about parameters, and the schema already confirms an empty parameter set.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Fetch') and identifies the exact resource contents: date, source, license, and row counts. This clearly distinguishes it from sibling tools like search_hs_candidates and calculate_tariff_scenario, which perform different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives concrete usage context: 'use to check data freshness.' It does not explicitly state exclusions or compare against alternatives, but the intended scenario is clear enough for an agent to decide when to call it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_hs_candidatesSearch HTS code candidatesA
Read-only

Returns top 8-10 digit HTS code candidates (with MFN/FTA rates and CBP CROSS ruling links) for a product description. Results are CANDIDATES for pre-broker screening, not a classification ruling. IMPORTANT: the HTS uses legal terminology, not trade names — BEFORE CALLING, rewrite the product description into HTS-style material + use nouns (e.g. 'pink kids backpack' → 'travel bags of man-made fibers'; 'water bottle' → 'vacuum flask' or 'bottle of plastics'). If you get 0 results, retry with 2-3 different phrasings.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of candidates
product_descriptionYesProduct description in English: material, use, composition (e.g. 'stainless steel insulated water bottle 500ml')

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true and openWorldHint=false, and the description adds substantial behavioral context beyond that: it cautions that results are 'CANDIDATES' and not legal rulings, explicitly warns about the HTS's use of 'legal terminology,' and describes the expected retry behavior on zero results. This transparency goes beyond just the read-only nature and helps the agent manage expectations about output reliability.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is tightly written, using sentence case and a clear structure: what it does, a caution, a concrete instruction, and a fallback. The 'IMPORTANT:' emphasis and examples are efficient, though the paragraph could slightly overwhelm new users. Every sentence adds value without fluff, so a 4 is appropriate.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with only two parameters and no output schema, the description covers all necessary context: input format, expected output, limitations, and error handling. It prepares the agent for edge cases (0 results) and clarifies the tool's role within the larger suite. No critical information is missing for it to be invoked correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents both parameters with 100% coverage (product_description and limit). The description adds high-value guidance for product_description by giving concrete rewriting examples ('pink kids backpack' → 'travel bags of man-made fibers') and explaining the need for legal/material-based nouns. This extra semantic layer justifies a score above the baseline of 3. The limit parameter is fully specified in the schema, so no additional info needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Returns top 8-10 digit HTS code candidates … for a product description.' It clearly differentiates itself from a 'classification ruling' and includes concrete details (MFN/FTA rates, CBP CROSS ruling links). This distinguishes it well from sibling tools like 'calculate_tariff_scenario' or 'watch_tariff_changes' by focusing on the candidate search use case.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance is given on how to prepare input ('rewrite the product description into HTS-style material + use nouns') and how to handle empty results ('retry with 2-3 different phrasings'). It also clarifies the tool is for 'pre-broker screening, not a classification ruling,' which sets expectations. However, it doesn't explicitly name when to prefer a sibling tool, and the 'when not' is only implied by the disclaimer, not fully elaborated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

watch_tariff_changesWatch HTS codes for tariff changesA
Idempotent

Saves HTS codes (with optional origin) to a local watchlist. After each dataset refresh, call check_tariff_updates to see whether the rates on these codes changed. This is how you track 2025-2026 tariff volatility without manual re-checking.

ParametersJSON Schema
NameRequiredDescriptionDefault
hts_codesYes8-10 digit HTS codes to watch
origin_countryNoShared origin for the shipment (optional)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate it's a write operation (readOnlyHint=false) and idempotent. The description adds the workflow context (that rates are tracked across dataset refreshes) and specifies the local watchlist, going beyond what the annotations alone convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences. The first sentence states the action; the second sentence provides the workflow and context. No filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (2 params, no output schema), and the description covers the purpose, the workflow (call check_tariff_updates after refresh), and the context (tracking tariff volatility). It doesn't discuss edge cases, but those aren't expected for this simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already fully documents both parameters with descriptions (100% coverage). The description's mention of 'optional origin' mirrors the schema description for origin_country, adding little novelty. It doesn't compensate beyond the existing schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Saves') with a clear resource (HTS codes to a watchlist) and scope. It differentiates from siblings like check_tariff_updates by stating this tool does the saving while the sibling does the checking.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states the workflow: save codes first, then call check_tariff_updates after each dataset refresh. This gives clear context for when to use the tool, though it does not explicitly state when not to use it or mention alternative tools for code search/calculation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.2
    • Changedcalculate_tariff_scenario6 fields changed
      • changedInput schema / properties / customs_value_usd / description
        Previous value: -"Trị giá hải quan lô hàng (USD)"New value: +"Customs value of the shipment (USD)"
      • changedInput schema / properties / hts_code / description
        Previous value: -"Mã HTS 8-10 số, có chấm hay không đều được"New value: +"8-10 digit HTS code, with or without dots"
      • changedInput schema / properties / ocean_freight / description
        Previous value: -"Hàng đi đường biển? (áp HMF)"New value: +"Ocean shipment? (applies HMF)"
      • changedInput schema / properties / origin_country / description
        Previous value: -"Nước xuất xứ (tên tiếng Anh, vd 'China', 'Vietnam', 'Mexico')"New value: +"Country of origin (English name, e.g. 'China', 'Vietnam', 'Mexico')"
      • changedInput schema / properties / quantity / description
        Previous value: -"Số lượng theo đơn vị của mã (No./Dz Pcs...) — cần cho thuế đặc thù theo chiếc"New value: +"Quantity in the code's units (No./Dz Pcs...) — needed for per-piece specific duties"
      • changedInput schema / properties / weight_kg / description
        Previous value: -"Tổng trọng lượng (kg) — BẮT BUỘC nếu mã có thuế đặc thù theo kg (vd '12.4¢/kg')"New value: +"Total weight (kg) — REQUIRED when the code carries a specific duty per kg (e.g. '12.4¢/kg')"
    • Changedcheck_tariff_updates1 field changed
      • changedInput schema / properties / hts_codes / description
        Previous value: -"Giới hạn vào các mã này (mặc định: watchlist)"New value: +"Limit to these codes (default: the watchlist)"
    • Changedsearch_hs_candidates2 fields changed
      • changedInput schema / properties / limit / description
        Previous value: -"Số ứng viên"New value: +"Number of candidates"
      • changedInput schema / properties / product_description / description
        Previous value: -"Mô tả sản phẩm tiếng Anh: chất liệu, công dụng, thành phần (vd 'stainless steel insulated water bottle 500ml')"New value: +"Product description in English: material, use, composition (e.g. 'stainless steel insulated water bottle 500ml')"
    • Changedwatch_tariff_changes2 fields changed
      • changedInput schema / properties / hts_codes / description
        Previous value: -"Danh sách mã HTS 8-10 số cần theo dõi"New value: +"8-10 digit HTS codes to watch"
      • changedInput schema / properties / origin_country / description
        Previous value: -"Xuất xứ chung của lô hàng (tùy chọn)"New value: +"Shared origin for the shipment (optional)"
  2. 5 tool updatesv1.0.1
    • First observedcalculate_tariff_scenario
    • First observedcheck_tariff_updates
    • First observeddataset_info
    • First observedsearch_hs_candidates
    • First observedwatch_tariff_changes

TDQS

B3.2/5.0
Disambiguation5/5

Each tool has a clearly distinct role: candidate search, detailed scenario calculation, watchlist management, update checking, and dataset metadata. Even the paired watch/check tools are unambiguous because one saves codes and the other compares snapshots.

Naming Consistency4/5

Four tools follow a consistent verb_noun pattern: search_hs_candidates, calculate_tariff_scenario, watch_tariff_changes, check_tariff_updates. dataset_info breaks the pattern as a noun-only name, which is a minor deviation but not confusing.

Tool Count5/5

Five tools is well-scoped for a focused tariff-resolution server. Each tool covers a distinct part of the workflow without redundancy or unnecessary breadth.

Completeness4/5

The core workflow is covered: search candidates, calculate duty scenarios, track changes, and verify data freshness. A minor gap is that watch_tariff_changes has no corresponding unwatch or list-watchlist tool, so watchlist management is slightly incomplete.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides access to US Census Bureau International Trade data, enabling querying trade statistics through natural language using ask_pipeworx.
    14
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to search EU/French customs codes, get duty rates, and monitor tariff changes via natural language, using the DouaneCode API.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/opsloft/tariff-resolver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server