Skip to main content
Glama
nikolasdehor

mcp-fiscal-brasil

by nikolasdehor

baixar_nfe_distribuicao

Download Brazilian tax documents from SEFAZ using a local A1 certificate. Supports incremental, specific NSU, or key-based retrieval.

Instructions

Baixa documentos fiscais via NFeDistribuicaoDFe (SEFAZ) usando certificado A1 local. REQUER certificado digital A1 (.pfx/.p12) do proprio usuario instalado localmente. O certificado NUNCA e enviado a nenhum servidor - a autenticacao e feita localmente via mTLS. Suporta busca incremental (distNSU), por NSU especifico (consNSU) ou por chave (consChNFe). A Ciencia da Operacao (210200) e prerequisito para obter o XML completo (procNFe).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufYesSigla da UF do autor (ex: "SP") ou codigo IBGE (ex: "35").
nsuNoNSU especifico para modo consNSU.
modoNo"distNSU" (incremental), "consNSU" (NSU especifico) ou "consChNFe" (por chave de acesso de 44 digitos).distNSU
chaveNoChave de acesso de 44 digitos para modo consChNFe.
senhaYesSenha do certificado. Nunca logada ou incluida em excecoes.
timeoutNoTimeout HTTP em segundos (default 30.0).
ambienteNo"producao" ou "homologacao".producao
cnpj_cpfYesCNPJ (14 dig) ou CPF (11 dig) do autor da consulta.
ultimo_nsuNoUltimo NSU recebido para modo distNSU. Default "0" busca todos.0
caminho_certificadoYesCaminho absoluto para o arquivo .pfx ou .p12.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations were provided, so the description carries the full burden. It discloses that the certificate is used locally via mTLS and never sent to a server, and that Ciencia da Operacao is a prerequisite for full XML. It does not cover error handling or rate limits.

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?

The description is a single paragraph that front-loads the main purpose and covers key points. It is concise but could be slightly more structured with separate lines for each mode.

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?

Given the output schema exists (return values documented elsewhere), the description adequately covers the tool's purpose, modes, and certificate handling. It lacks mention of error cases or pagination but is sufficient for a complex tool with 10 parameters.

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 description coverage is 100%, so the baseline is 3. The description adds value by explaining the search modes and the prerequisite relationship, which complements the schema fields.

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?

The description clearly states the tool downloads fiscal documents via NFeDistribuicaoDFe using a local A1 certificate, with three search modes. It distinguishes from sibling tools like consultar_nfe and manifestar_nfe by specifying the download action and certificate requirement.

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

Usage Guidelines4/5

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

The description provides context on when to use the tool (requires local certificate, supports incremental, NSU, or key-based search) and mentions a prerequisite (Ciencia da Operacao for full XML). However, it does not explicitly state when not to use it or name alternative tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolasdehor/mcp-fiscal-brasil'

If you have feedback or need assistance with the MCP directory API, please join our Discord server