Skip to main content
Glama

classify_item

Read-only

Suggest an NCM, CFOP, CST/CSOSN, CEST or service code for one item. A suggestion to confirm with the user — never issue on it blindly.

Every code in a candidate was read from the published tables, but the NCM and the CFOP decide the tax owed, and a plausible wrong one is authorized by the SEFAZ and only caught at an audit. Show the primary candidate, its confidence and the alternatives, say it is a suggestion, and put a code on an item only after the user confirms it — whatever the confidence. lookup_fiscal_code can confirm one code against the table.

When missing_information is not empty, ask the user those questions and call again with the answers in the matching arguments. Changes nothing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "description": "<description>",
      "document_type": "<document_type>"
    },
    "name": "classify_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
originNoResold goods (CFOP x102) or own production (x101). Only when missing_information asked for it.
purposeNoWhether the buyer resells it or consumes it. Only when missing_information asked for it.
company_idNoUUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both.
descriptionYesWhat the item is, as the user describes it, e.g. Cerveja artesanal IPA garrafa 500ml.
tax_retainedNoWhether the ISS is retained by the buyer. Only when missing_information asked for it.
document_typeYesnfe for goods, nfse for a service.
company_tax_idNoCNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both.
operation_scopeNoOnly when missing_information asked for it.
recipient_stateNoThe buyer's UF, e.g. SP. It decides intrastate (5xxx) or interstate (6xxx) CFOP.
contains_alcoholNoOnly when missing_information asked for it.
service_city_codeNoIBGE code of the city where the service is provided. Only when missing_information asked for it.

Output Schema

NameRequiredDescriptionDefault
idNo
warningsNo
confidenceNo0 to 1. Not a guarantee at any value.
justificationNo
primary_candidateNo
classification_typeNoproduct or service.
missing_informationNoAsk the user these and call again with the answers.
confirmation_requiredNoAlways true: a suggestion goes on an item only after the user confirms it.
alternative_candidatesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / operation_scope / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "intrastate",
      -      "interstate"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "intrastate",
      +      "interstate",
      +      "export"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / origin
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "resale",
      +        "own_production"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Resold goods (CFOP x102) or own production (x101). Only when missing_information asked for it."
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
  3. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces this with 'Changes nothing.' It goes further, disclosing the domain risk that a plausible wrong NCM/CFOP is SEFAZ-authorized and only caught at audit, plus the required output posture (primary candidate, confidence, alternatives). This is behavioral context annotations cannot carry.

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?

Purpose is front-loaded in the first sentence and the risk rationale follows. There is mild redundancy: the 'suggestion, confirm with the user' instruction is restated twice ('never issue on it blindly' and 'put a code on an item only after the user confirms it'), which could be tightened without losing meaning.

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?

For an 11-parameter advisory tool with an output schema and full annotations, the description covers the workflow, the confirmation gate, and the missing_information retry loop. Company identification (company_id vs company_tax_id, 'send one, never both') is handled only by the schema, which is acceptable but leaves a small gap.

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 would be 3, but the description explains the conditional-parameter pattern that dominates this 11-param tool: many arguments are only supplied on a follow-up call once missing_information returns questions. It does not add per-parameter meaning beyond what the schema already documents, so it stops short of 5.

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 ('Suggest an NCM, CFOP, CST/CSOSN, CEST or service code for one item') and explicitly limits scope to a single item. It also names the sibling tool lookup_fiscal_code for the confirm-a-known-code case, so an agent can separate the two without opening either 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?

Gives explicit guidance for the whole workflow: treat the result as a suggestion, show the primary candidate with confidence and alternatives, and only assign a code after the user confirms — regardless of confidence. It also routes the alternate case ('lookup_fiscal_code can confirm one code against the table') and instructs a re-call with answers when missing_information is non-empty.

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.