classify_item
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
| Name | Required | Description | Default |
|---|---|---|---|
| origin | No | Resold goods (CFOP x102) or own production (x101). Only when missing_information asked for it. | |
| purpose | No | Whether the buyer resells it or consumes it. Only when missing_information asked for it. | |
| company_id | No | UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both. | |
| description | Yes | What the item is, as the user describes it, e.g. Cerveja artesanal IPA garrafa 500ml. | |
| tax_retained | No | Whether the ISS is retained by the buyer. Only when missing_information asked for it. | |
| document_type | Yes | nfe for goods, nfse for a service. | |
| company_tax_id | No | 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. | |
| operation_scope | No | Only when missing_information asked for it. | |
| recipient_state | No | The buyer's UF, e.g. SP. It decides intrastate (5xxx) or interstate (6xxx) CFOP. | |
| contains_alcohol | No | Only when missing_information asked for it. | |
| service_city_code | No | IBGE code of the city where the service is provided. Only when missing_information asked for it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| warnings | No | ||
| confidence | No | 0 to 1. Not a guarantee at any value. | |
| justification | No | ||
| primary_candidate | No | ||
| classification_type | No | product or service. | |
| missing_information | No | Ask the user these and call again with the answers. | |
| confirmation_required | No | Always true: a suggestion goes on an item only after the user confirms it. | |
| alternative_candidates | No |