Skip to main content
Glama

Resolve Product Code

resolve_product_code

Resolve a free-text query or CN code(s) into validated product code(s) with descriptions -- the recommended first step before using a code as product in any other tool's query. Saves the search -> validate -> (optional) subtree round-trip: a bare keyword runs a search, a single code (or comma-separated list) is validated and described directly.

Tip: Comext/CN nomenclature is frequently coarser than a colloquial product name (e.g. there is no code for "glass jars" alone -- only heading 7010, which bundles jars with bottles, flasks and closures). Check has_subcodes and, if useful, set include_children=true to see whether a finer sub-code is actually a better match before committing to one code for a whole report.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNoLanguage for translated labels in the response. One of: bg, cs, da, de, el, en, es, et, fi, fr, ga, hr, hu, it, lt, lv, mt, nl, pl, pt, ro, sk, sl, sv.en
limitNoMax keyword-search results (ignored for direct code validation).
queryYesFree-text keyword (e.g. 'glass jars') OR one or more CN codes, comma-separated (e.g. '7010' or '7010, 7013').
include_childrenNoWhen resolving a single direct code, also fetch its immediate CN subtree so finer-grained alternatives are visible in one call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure, and it excels: it explains the tool's dual behavior (bare keyword triggers a search; a single code or comma-separated list is validated and described directly), the coarseness of CN nomenclature, and the effect of `include_children`. It also flags the importance of inspecting `has_subcodes` before committing to a code, all without needing annotations.

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 concise yet complete: the purpose appears in the first sentence, followed by a short explanation of the combined workflow and a focused tip with a practical example. No filler or redundancy; every sentence contributes to either usage or behavioral transparency.

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?

Given the tool's complexity (4 parameters, dual input modes) and the presence of an output schema, the description covers all essential aspects: input handling, behavior for different query types, and guidance on subtree exploration. It is fully adequate for an AI agent to select and invoke the tool correctly, and the output schema handles return-value 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?

The input schema already documents all four parameters with 100% coverage, so the baseline is 3. The description adds value by clarifying the `query` parameter's dual nature (free-text vs. CN codes) and by giving a concrete example of the coarseness problem for choosing `include_children`. It reinforces the schema's meaning rather than merely repeating it.

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 opens with a clear, specific action: 'Resolve a free-text query or CN code(s) into validated product code(s) with descriptions.' It also distinguishes this tool from siblings by positioning it as 'the recommended first step before using a code as `product` in any other tool's `query`' and explicitly notes it saves the search → validate → subtree round-trip, differentiating it from search_codes and validate_code.

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?

The description provides explicit when-to-use guidance: it is the recommended first step for resolving product codes before use in other tools. It also advises checking `has_subcodes` and setting `include_children=true` when a coarser code may not be the best match, giving concrete decision criteria. This goes beyond generic context to actionable alternatives.

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.

TDQS

A3.8/5.0
Disambiguation4/5

Most tools have clearly distinct purposes, but several concentration-related tools (get_concentration, get_concentration_compare, get_concentration_map) and volatility-related tools (get_volatility, get_volatility_summary) could be confused without careful reading. The detailed descriptions help, but the boundaries are not always immediately obvious.

Naming Consistency4/5

The vast majority of tools follow a consistent get_ prefix pattern for data retrieval. A few exceptions (guidelines_for_a_*, resolve_product_code, search_codes, validate_code) deviate to signal different kinds of operations, which is sensible but breaks uniformity.

Tool Count2/5

With 37 tools, the server is heavily overloaded. Many tools are variations on the same analytical theme (e.g., multiple concentration and production tools) and could be consolidated or parameterized. This creates a steep learning curve and increases the chance of selecting the wrong tool.

Completeness5/5

The tool set comprehensively covers the trade-exploration workflow: product code resolution, hierarchical browsing, headline stats, partner/reporter detail, concentration, volatility, shocks, production metrics, and report generation. There are no obvious gaps or dead ends for its stated purpose.

Resources