Skip to main content
Glama

Code List Lookup

code_list_lookup
Read-onlyIdempotent

Look up a code in a published code list. list (required) is one of: cds-procedure-codes-imports and cds-procedure-codes-exports (HMRC CDS requested and previous procedure codes, DE 1/10, e.g. 4000, 1040); cds-additional-procedure-codes-imports and cds-additional-procedure-codes-exports (HMRC CDS additional procedure codes, DE 1/11, e.g. C07, 1RV). With code it returns the code's name as published, the heading it is listed under, its status and the list's edition; with q it searches that one list (exact code, code prefix, then name); with neither, the list itself, paged. Use it to read what a UK customs procedure or additional procedure code means; for a commodity code use hs_code_lookup, for UK duty uk_duty_calculator. Codes and names as HMRC publishes them on GOV.UK (Open Government Licence v3.0, attribution in every answer). No completion rules and no declaration check; reference, not advice. Rate-limited: a limit error carries reset_at, the UTC time the allowance resets.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "code_list_lookup"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoSearch within the list: exact code first, then codes starting with q, then names containing it.
codeNoOne code, as published (e.g. 4000, C07). Leave out to search or to list.
fullNoFull rows (heading and edition on each) instead of summary rows, five per page by default.
listNoThe code list, e.g. cds-procedure-codes-imports (the lists are named in the description). Required: a lookup or a search runs within one list.
limitNoPage size: summary rows 1-200 (default 50), full rows 1-25 (default 5).
offsetNoPage start for a list or a search (default 0).
include_deprecatedNoAlso list and search codes the publisher marks as no longer to be used (a direct lookup always returns them, with the status). No list served today marks one.

Output Schema

NameRequiredDescriptionDefault
okYes
as_ofYes
resultYes
statusYes
_sourceYes
editionYes
citationYes
warningsNo
confidenceYes
missing_inputsYes
blocking_errorsNo
envelope_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only and idempotent, and the description adds what they cannot: the shape of the return (published name, heading, status, list edition), the fact that a direct lookup returns deprecated codes with their status while include_deprecated governs listing/search, and rate-limiting behavior including that a limit error carries reset_at in UTC. The licensing/attribution statement (OGL v3.0) and the 'reference, not advice' disclaimer are non-obvious behavioral context an agent would otherwise lack.

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?

Front-loaded with the action, then the list inventory, then the mode semantics, then routing and caveats — a logical order with no filler sentences. It is dense to the point of being packed (long parentheticals carrying DE numbers, examples, and licence terms), which costs a little readability.

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?

Seven optional parameters, full schema coverage, an output schema, and rich annotations are all complemented by the description's coverage of list selection, mode behavior, deprecation handling, and rate-limit errors. Nothing an agent needs in order to call this correctly is missing.

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%, so the baseline is 3, but the description adds genuine meaning by naming the concrete list identifiers that the schema only gestures at ('the lists are named in the description') and by contrasting code vs q vs neither mode, which determines which other parameters matter. The one gap is the schema/description mismatch on requiredness: the description calls list required while the schema's required array is empty.

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?

States a specific verb and resource ('Look up a code in a published code list') and then enumerates exactly which code lists exist (CDS procedure and additional procedure codes, import and export) with the DE reference and example values. The three operating modes (code lookup, q search, bare listing) are spelled out, so an agent can distinguish this tool from hs_code_lookup and uk_duty_calculator without opening the schema.

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

Usage Guidelines5/5

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

Explicitly routes the agent: use this to learn what a UK customs procedure or additional procedure code means, use hs_code_lookup for a commodity code and uk_duty_calculator for UK duty. It also states exclusions ('No completion rules and no declaration check; reference, not advice'), so both the when and the when-not are covered.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.