Skip to main content
Glama

Brazil DANFSe & Tax Reform RTC (x402)

generate_danfse_rtc

Gera o DANFSe oficial da NFS-e Nacional e calcula automaticamente CBS/IBS/ISS usando as tabelas oficiais MIT da Receita Federal (Base V0073 — 170 cClassTrib, reduções legais de construção civil 50%, saúde 60%, educação 60%, cesta básica 100%, Simples Nacional e transição 2026–2033) no Cloudflare Edge sem servidor Java ($0.005 USDC via x402 on Base ou B2B API Key).

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": "generate_danfse_rtc"
  }
}

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. Changed21 schema fields changed
    • addedInput schema / properties / aliqCbs
      Added value: +{
      +  "description": "Optional manual override for nominal CBS rate (%). Alias: cbsAliquota, aliq_cbs.",
      +  "type": "number"
      +}
    • addedInput schema / properties / aliqIbs
      Added value: +{
      +  "description": "Optional manual override for nominal IBS total rate (%). Alias: ibsAliquota, aliq_ibs.",
      +  "type": "number"
      +}
    • addedInput schema / properties / aliqIbsMun
      Added value: +{
      +  "description": "Optional manual override for nominal Municipal IBS rate (%).",
      +  "type": "number"
      +}
    • addedInput schema / properties / aliqIbsUf
      Added value: +{
      +  "description": "Optional manual override for nominal State IBS rate (%).",
      +  "type": "number"
      +}
    • addedInput schema / properties / anexoSimples
      Added value: +{
      +  "description": "Simples Nacional Annex (I-V) when regime='simples_nacional' (alias: anexo_simples).",
      +  "enum": [
      +    "I",
      +    "II",
      +    "III",
      +    "IV",
      +    "V"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / ano
      Added value: +{
      +  "description": "Calendar year for LC 214/2025 transition schedule (2026..2033, default: 2026).",
      +  "type": "integer"
      +}
    • addedInput schema / properties / atividadeSimples
      Added value: +{
      +  "description": "Official RFB Simples Nacional activity code ('01'..'14', '90').",
      +  "type": "string"
      +}
    • addedInput schema / properties / cClassTrib
      Added value: +{
      +  "description": "Official 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.",
      +  "type": "string"
      +}
    • changedInput schema / properties / discriminacao / description
      Previous value: -"Shortcut service description"New value: +"Service or operation description"
    • addedInput schema / properties / fatorR
      Added value: +{
      +  "description": "Payroll/revenue ratio (0..1) for Simples Nacional Annex III vs V (threshold 0.28). Alias: fator_r.",
      +  "type": "number"
      +}
    • addedInput schema / properties / generateHtml
      Added value: +{
      +  "description": "Include printable DANFSe HTML in response (default: true on /generate, false on /calculate).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / itens
      Added value: +{
      +  "description": "Optional batch list of items/services to compute official RTC reductions and totals in a single call (max 50).",
      +  "items": {
      +    "properties": {
      +      "cClassTrib": {
      +        "type": "string"
      +      },
      +      "descricao": {
      +        "type": "string"
      +      },
      +      "nbs": {
      +        "type": "string"
      +      },
      +      "ncm": {
      +        "type": "string"
      +      },
      +      "setor": {
      +        "type": "string"
      +      },
      +      "valor": {
      +        "type": "number"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / nbs
      Added value: +{
      +  "description": "Optional 4-9 digit NBS service code for automatic official RFB cClassTrib lookup",
      +  "type": "string"
      +}
    • addedInput schema / properties / ncm
      Added value: +{
      +  "description": "Optional 4-8 digit NCM code for automatic official RFB cClassTrib & reduction lookup",
      +  "type": "string"
      +}
    • changedInput schema / properties / prestador / description
      Previous value: -"Service provider identification"New value: +"Service provider identification (cnpjCpf, razaoSocial, municipio, uf, simplesNacional)"
    • addedInput schema / properties / rbt12
      Added value: +{
      +  "description": "Last 12-month gross revenue in BRL for Simples Nacional effective DAS rate (default: 360000).",
      +  "type": "number"
      +}
    • addedInput schema / properties / regime
      Added value: +{
      +  "description": "Tax regime (default: 'regime_regular'). Supports Simples Nacional DAS simulation and transferable B2B credit.",
      +  "enum": [
      +    "regime_regular",
      +    "simples_nacional",
      +    "simples_nacional_regular_por_fora"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / servico / description
      Previous value: -"Service values and ISS/CBS/IBS rates"New value: +"Service values, cTribNac, cClassTrib, nbs, ISS and optional manual CBS/IBS rates"
    • addedInput schema / properties / setor
      Added value: +{
      +  "description": "Semantic sector alias when cClassTrib is unknown (e.g. 'construcao_civil', 'saude', 'educacao', 'cesta_basica', 'profissao_intelectual', 'locacao_imoveis', 'bares_restaurantes', 'combustiveis', 'padrao').",
      +  "type": "string"
      +}
    • changedInput schema / properties / tomador / description
      Previous value: -"Service taker identification"New value: +"Service taker identification (cnpjCpf, razaoSocial, municipio, uf)"
    • changedInput schema / properties / valorServico / description
      Previous value: -"Shortcut service amount in BRL"New value: +"Service or item amount in BRL (alias: valor_servico, baseCalculo)"
  2. First observed

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the burden. It usefully discloses the pricing model ($0.005 USDC via x402 or B2B key), the serverless edge execution, and the data source (Base V0073), but says nothing about side effects, idempotency, error behavior, or what the response contains.

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?

The whole definition is one dense run-on sentence mixing purpose, table trivia, edge-hosting, and payment rails. The core purpose is front-loaded, but marketing detail like '170 cClassTrib' and '$0.005 USDC via x402 on Base' crowds out more useful guidance.

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 output schema, the definition explains what it does and its cost but never clarifies how single-item versus batch computation works, what the response shape is, or how it differs from the sibling calculator. Adequate but with clear gaps.

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 coverage is 100%, so all 22 parameters are already documented in the schema, and the description adds only illustrative detail (reduction percentages, a few cClassTrib codes) that largely repeats schema examples. Baseline 3 applies since the schema does the heavy lifting.

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 states a concrete verb and resource in Portuguese: it generates the official DANFSe for NFS-e Nacional and computes CBS/IBS/ISS using official RFB tables. An agent can tell what it produces, but the definition never distinguishes it from the sibling calculate_rtc_official, leaving overlap ambiguous.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance and no mention of the alternative calculate_rtc_official. The presence of both generateHtml and a batch 'itens' mode implies usage paths but never states which to pick or the conditions for each.

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.