Skip to main content
Glama
SoapyRED

FreightUtils MCP Server

hs_code_lookup

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch by product description (min 2 chars)
codeNoExact HS code lookup (2-6 digits)
sectionNoBrowse by section (Roman numeral, e.g., "II")

Implementation Reference

  • 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 }),
    };
  • 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,
  • 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> {
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds context: it operates on a specific dataset of 6,940 codes, explains the digit structure, and confirms no side effects. No contradictions.

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 efficiently structured: an introductory sentence, a brief explanation of HS code format, bulleted use cases, and a final instruction. No extraneous content. Every sentence serves a purpose, and key information is front-loaded.

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

Completeness3/5

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

The description covers the tool's main functionalities but lacks explicit description of the output format. Since there is no output schema, the agent must infer what the tool returns (e.g., list of codes with descriptions). It would benefit from stating 'returns matching codes, descriptions, and hierarchy details.'

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?

Schema coverage is 100% with descriptions for each parameter. The description adds value by explaining the relationship between parameters (e.g., description-based search vs exact code) and the HS hierarchy. It also provides usage examples (e.g., 'laptop', 'olive oil') that enrich meaning beyond schema.

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 clearly states the tool's purpose: 'Search 6,940 Harmonized System (HS) tariff codes.' It explains what HS codes are and lists specific use cases: find HS code for a product, get hierarchy, browse sections. This distinguishes it clearly from sibling tools like incoterms_lookup or container_lookup.

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 explicitly says 'Use this tool when you need to:' followed by three bullet points covering common use cases. It also advises on input types (description search, exact code, section). While it doesn't mention when not to use it or alternative tools, the guidance is clear and actionable.

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

Install Server

Other Tools

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/SoapyRED/freightutils-mcp'

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