Skip to main content
Glama

calcular_base_calculo_unificada

Calculates the unified CBS/IBS tax base from NF-e/NFC-e item components, showing inclusions and deductions based on the transition year.

Instructions

Calcula a base de cálculo unificada de CBS/IBS da NF-e/NFC-e a partir dos componentes do item.

Mostra o que soma e o que é deduzido (PIS/COFINS, ICMS, ISSQN etc. conforme o ano de transição).

Args: ano_fato_gerador: Ano do fato gerador, ex: 2026. natureza: 'bem' ou 'servico'. tipo_documento: Modelo do documento (55=NF-e, 65=NFC-e). vProd..vISSQN: Valores dos componentes (informe só os que existirem).

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": {
      "ano_fato_gerador": "<ano_fato_gerador>",
      "natureza": "<natureza>"
    },
    "name": "calcular_base_calculo_unificada"
  }
}

Input Schema

NameRequiredDescriptionDefault
vIINo
vISNo
vFCPNo
vPISNo
vSegNo
vDescNo
vICMSNo
vProdNo
vFreteNo
vISSQNNo
vOutroNo
vCOFINSNo
naturezaYes
vICMSMonoNo
vFCPUFDestNo
vICMSUFDestNo
tipo_documentoNo
ano_fato_geradorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3/5.0
Behavior2/5

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

With no annotations and no output schema, the description carries the full burden. It discloses one useful behavioral trait — the result shows which components are added and which are deducted, varying by transition year — but says nothing about the return shape, number/currency formatting, or what happens with missing or contradictory components. For an 18-parameter domain calculation this leaves real uncertainty.

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, with the add/deduct behavior immediately after; nothing is padded. The Args block is somewhat schema-restating, but it is compact and the 'informe só os que existirem' line earns its place.

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?

Given 18 parameters, zero annotations and no output schema, the definition is just barely sufficient: an agent knows the two required parameters and that optional value components should be supplied only when present. It is not sufficient to resolve per-component semantics or to predict the return payload, which for a tax-base tool is a meaningful gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does explain ano_fato_gerador (with a 2026 example), natureza ('bem'/'servico') and tipo_documento (55=NF-e, 65=NFC-e), which is genuine added meaning. But it lumps the remaining ~13 value fields into 'vProd..vISSQN: Valores dos componentes', giving no per-field meaning for vICMSMono, vFCPUFDest, vICMSUFDest, vSeg, vOutro and the rest — the caller cannot tell which to supply and which to omit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: it computes the unified CBS/IBS tax base for NF-e/NFC-e from item components. That is distinct enough from a generic 'calcular_tributos' that an agent can tell which one it wants, though the description never names or contrasts any sibling explicitly.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: you use it when you have the item's value components and a transition year and need the base, not the tax. There is no when-not guidance, no mention of prerequisites (e.g. that this is a purely local calculation with no side effects), and no routing to alternatives such as calcular_tributos.

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