Skip to main content
Glama

calcular_tributos

Calculates CBS, IBS, and Imposto Seletivo for a tax operation under LC 214/2025 and reports item-level status so partial calculation errors can be identified.

Instructions

Calcula CBS, IBS e Imposto Seletivo de uma operação (regime geral, LC 214/2025).

operacao segue o JSON da API oficial: id, versao, dhFatoGerador, municipio (IBGE), uf e itens[] (numero, ncm ou nbs, cst, cClassTrib, baseCalculo, quantidade, unidade, aliquotasNominais obrigatórias a partir de 2027). Com observabilidade (padrão) cada item com erro vem marcado em estadoItem e os demais são calculados. Sem observabilidade, o primeiro erro rejeita a operação (HTTP 422). Confira sempre estadoItem de cada item: a resposta é 200 mesmo com itens em erro.

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": {
      "operacao": "<operacao>"
    },
    "name": "calcular_tributos"
  }
}

Input Schema

NameRequiredDescriptionDefault
operacaoYes
com_observabilidadeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations the description carries the full burden and does substantial work: it discloses that observability is the default, that per-item errors are flagged in estadoItem while other items still compute, that without observability the first error returns HTTP 422, and that HTTP 200 does not imply a clean result. It stops short of stating whether the call is stateless/side-effect-free or what auth is needed, so not a 5.

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?

Roughly six short lines, front-loaded with the purpose, then the parameter contract, then error semantics and the closing caution. Backticks around field names make it scannable; no sentence is filler.

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 a nested-object calculation tool with no annotations and no output schema, the definition covers input shape, error-partiality semantics, and the key post-call check (estadoItem). It leaves the response payload structure and statelessness/idempotency unstated, which prevents a 5.

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 0% and the schema is an opaque object with additionalProperties, so the description must compensate, and it largely does: it enumerates operacao's fields (id, versao, dhFatoGerador, municipio IBGE, uf, itens[] with numero, ncm or nbs, cst, cClassTrib, baseCalculo, quantidade, unidade, aliquotasNominais required from 2027) and explains com_observabilidade's effect. It adds real meaning beyond the schema, though per-field requiredness beyond the 2027 note and the 'ncm ou nbs' alternative is only partially spelled out.

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 (calcula) plus the exact tax set (CBS, IBS, Imposto Seletivo) and the legal regime (regime geral, LC 214/2025). This clearly separates it from siblings like validar_xml, gerar_xml, or aliquota_referencia, which do not compute a full operation's taxes.

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 by the purpose (call it to compute taxes for one operation) and the observability paragraph explains a calling mode, but there is no explicit when-to-use/when-not guidance relative to siblings such as base_calculo_unificada or aliquota_referencia. The agent can infer the role but is not routed.

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