Skip to main content
Glama

Brazil DANFSe & Tax Reform RTC (x402)

calculate_rtc_official

Calculadora Oficial da Reforma Tributária do Consumo (LC 214/2025, Receita Federal Base V0073) no Edge sem servidor Java 21/Spring Boot. Resolve automaticamente reduções legais de CBS/IBS por cClassTrib, NCM, NBS, LC 116 ou setor, suporta Regime Regular, Simples Nacional (Anexos I-V + Fator R) e transição 2026-2033 ($0.005 USDC via x402 on Base).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calculate_rtc_official"
  }
}

Input Schema

NameRequiredDescriptionDefault
anoNoCalendar year for LC 214/2025 transition schedule (2026..2033, default: 2026).
nbsNoOptional 4-9 digit NBS service code for automatic official RFB cClassTrib lookup
ncmNoOptional 4-8 digit NCM code for automatic official RFB cClassTrib & reduction lookup
xmlNoRaw NFS-e XML (National standard or ABRASF)
itensNoOptional batch list of items/services to compute official RTC reductions and totals in a single call (max 50).
rbt12NoLast 12-month gross revenue in BRL for Simples Nacional effective DAS rate (default: 360000).
setorNoSemantic sector alias when cClassTrib is unknown (e.g. 'construcao_civil', 'saude', 'educacao', 'cesta_basica', 'profissao_intelectual', 'locacao_imoveis', 'bares_restaurantes', 'combustiveis', 'padrao').
fatorRNoPayroll/revenue ratio (0..1) for Simples Nacional Annex III vs V (threshold 0.28). Alias: fator_r.
regimeNoTax regime (default: 'regime_regular'). Supports Simples Nacional DAS simulation and transferable B2B credit.
aliqCbsNoOptional manual override for nominal CBS rate (%). Alias: cbsAliquota, aliq_cbs.
aliqIbsNoOptional manual override for nominal IBS total rate (%). Alias: ibsAliquota, aliq_ibs.
servicoNoService values, cTribNac, cClassTrib, nbs, ISS and optional manual CBS/IBS rates
tomadorNoService taker identification (cnpjCpf, razaoSocial, municipio, uf)
aliqIbsUfNoOptional manual override for nominal State IBS rate (%).
prestadorNoService provider identification (cnpjCpf, razaoSocial, municipio, uf, simplesNacional)
aliqIbsMunNoOptional manual override for nominal Municipal IBS rate (%).
cClassTribNoOfficial 6-digit Receita Federal cClassTrib code (Base V0073, e.g. '200046' construction 50% reduction, '200029' health 60%, '200028' education 60%, '200003' basic food basket 100%, '200052' regulated professions 30%, '000001' standard). Alias: c_class_trib.
anexoSimplesNoSimples Nacional Annex (I-V) when regime='simples_nacional' (alias: anexo_simples).
generateHtmlNoInclude printable DANFSe HTML in response (default: true on /generate, false on /calculate).
valorServicoNoService or item amount in BRL (alias: valor_servico, baseCalculo)
discriminacaoNoService or operation description
atividadeSimplesNoOfficial RFB Simples Nacional activity code ('01'..'14', '90').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two genuinely useful traits: automatic cascade of official cClassTrib/NCM/NBS/LC 116/sector lookups, and that invocation costs $0.005 USDC via x402 on Base (a payment/authorization prerequisite). However, it says nothing about return payload shape, determinism, error behavior, rate limits, or what happens when no reduction matches, and its reference to defaults 'on /generate' vs '/calculate' points at endpoints outside this schema, which is confusing rather than clarifying.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in a single dense sentence, but time is spent on implementation detail unrelated to tool selection ('no Edge sem servidor Java 21/Spring Boot') and the pricing clause is buried at the very end where it is least likely to be read. It is compact but not tight; several clause fragments could be dropped without loss.

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?

For a 22-parameter tool with nested objects and no annotations or output schema, the description does convey the legal domain, regime coverage, and year range. It still leaves the agent without any sense of what the calculation returns, how batch vs single vs XML inputs differ in output, or how the x402 payment must be settled, which are material gaps at this complexity.

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

Parameters3/5

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

Schema description coverage is 100% across all 22 parameters, so the baseline is 3. The prose gestures at the resolution inputs (cClassTrib, NCM, NBS, LC 116, setor) and the supported regimes, but adds no new semantics beyond the enum, alias, and example values already spelled out in the schema, and it does not explain how the mutually overlapping input paths interact.

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?

The description names a specific verb and resource: an official calculator for the Consumo tax reform (LC 214/2025, RFB Base V0073) that resolves CBS/IBS legal reductions. An agent can tell it computes tax rather than generating documents, but it never contrasts itself with the sibling generate_danfse_rtc, so the boundary between the two is left implicit.

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 only implied: it is clear this is the tool to call when you need official RTC reduction/total calculations under a given regime and transition year. There is no explicit when-not guidance, no statement of which of the several input modes (xml, itens batch, single servico, or top-level ncm/nbs/cClassTrib) should be preferred, and no mention that document generation belongs to generate_danfse_rtc.

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.