hs_code_lookup
Search Harmonized System tariff codes to classify products for customs declarations and duty calculations. Enter a product description, HS code, or section.
Instructions
Search 6,940 Harmonized System (HS) tariff codes.
HS codes are 6-digit international product classification codes used for customs declarations and duty calculations. The first 2 digits = chapter, 4 digits = heading, 6 digits = subheading.
Use this tool when you need to:
Find the HS code for a product (e.g., "laptop", "olive oil")
Get the tariff classification hierarchy (section → chapter → heading → subheading)
Browse HS sections (I through XXI)
Provide a search term for description-based search, or an exact HS code for detailed lookup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search by product description (min 2 chars) | |
| code | No | Exact HS code lookup (2-6 digits) | |
| section | No | Browse by section (Roman numeral, e.g., "II") |
Implementation Reference
- src/tools.ts:303-305 (handler)The handler function for hs_code_lookup — calls apiGet on the 'hs' endpoint with query, code, and section parameters.
handler: async (args) => apiGet('hs', { q: args.query, code: args.code, section: args.section }), }; - src/tools.ts:295-299 (schema)Input schema for hs_code_lookup — accepts optional query (search by description), code (exact HS code), and section (browse by Roman numeral).
schema: z.object({ query: z.string().optional().describe('Search by product description (min 2 chars)'), code: z.string().optional().describe('Exact HS code lookup (2-6 digits)'), section: z.string().optional().describe('Browse by section (Roman numeral, e.g., "II")'), }).strict(), - src/tools.ts:722-722 (registration)Tool is registered in the ALL_TOOLS array which is iterated in server.ts to register all tools with the MCP server.
hsCodeLookup, - src/api.ts:7-7 (helper)The apiGet helper function used by hs_code_lookup to make HTTP GET requests to the FreightUtils API.
export async function apiGet(endpoint: string, params: Record<string, unknown>): Promise<unknown> {