Skip to main content
Glama

Br Sign Nfse

br__sign_nfse

Sign an unsigned NFS-e DPS with an ICP-Brasil A1 certificate, applying an enveloped XML-DSig signature to the infDPS element. Returns the signed XML or an error.

Instructions

Aplicar assinatura XML-DSig ICP-Brasil ao DPS da NFS-e Nacional.

Assina o elemento <infDPS> com enveloped ds:Signature adicionada como último filho de <DPS>, usando mcp_nfe_br.standards.nfse_signer.build_nfse_signer.

Algoritmo: RSA-SHA1 (padrão XMLDSigSigner). [Unverified para NFS-e Nacional — confirme no manual ADN antes de usar em produção.]

Somente certificados A1 (PKCS#12 em arquivo) são suportados. A3 (hardware token/HSM) [NEED: não modelado].

Returns a dict with xml (the signed DPS) or error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
xml_base64NoDPS não assinado codificado em base64.
xml_contentNoDPS não assinado (saída de br__generate_nfse). Informe xml_content ou xml_base64.
cert_passwordNoSenha do certificado A1, se houver

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it does so thoroughly. It discloses the algorithm (RSA-SHA1), the signature structure (enveloped ds:Signature as last child of <DPS>), the underlying builder function, certificate limitations (A1 only, A3 not modeled), and the production-readiness caveat. It also states the return shape.

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?

The description is well-structured and front-loaded: purpose first, then technical signing details, then algorithm/caveat, certificate limitations, and return format. Every sentence adds useful information, with no filler or redundancy.

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?

The description is quite complete for a cryptographic signing tool: it covers mechanism, algorithm, certificate constraints, production caveat, and return value. The main gaps are the lack of explicit workflow guidance (when to sign relative to generate/submit) and no clarification about requiring exactly one of xml_content or xml_base64, especially since the schema marks both as optional/nullable.

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%, so the baseline is 3. The description adds little beyond the schema: it confirms A1 certificate support, but the schema already describes cert_path as an ICP-Brasil A1 (.p12/.pfx) file. It does not explain precedence between xml_content and xml_base64, or clarify that at least one of them is effectively needed.

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 opens with a specific verb and resource: 'Aplicar assinatura XML-DSig ICP-Brasil ao DPS da NFS-e Nacional'. It further clarifies exactly what is signed (<infDPS>) and how the signature is placed (<DPS>), which unambiguously distinguishes it from siblings like br__sign_nfe or br__generate_nfse.

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 context is implied rather than explicit: an agent can infer this tool is used to sign a DPS before submission, and the schema mentions xml_content coming from br__generate_nfse. However, the description does not explicitly state when to use this tool versus alternatives, nor does it describe the workflow around generate_nfse/submit_nfse.

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