Skip to main content
Glama

Br Validate Nfe Xml

br__validate_nfe_xml

Validate NF-e/NFC-e XML documents against the official PL_010d XSD schema, returning errors and warnings for signed or unsigned files.

Instructions

Validate an NF-e/NFC-e XML (modelo 55/65, schema 4.00) against the bundled PL_010d XSD.

NFeXSDValidator selects the schema automatically: documents without a <ds:Signature> are validated against the unsigned derivative; signed documents (produced by br__sign_nfe) are validated against the unmodified official schema, which requires <ds:Signature>.

Returns a dict with valid, errors, warnings, and schema_version.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xml_base64NoBase64-encoded NF-e/NFC-e XML bytes.
xml_contentNoRaw NF-e/NFC-e XML string. Provide either xml_content or xml_base64.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral disclosure burden. It does well by explaining the automatic schema selection logic, the difference between unsigned and signed derivatives, and the returned dictionary keys. It does not mention potential side effects or permission requirements, but validation is inherently read-only and the description conveys no hidden destructive behavior.

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 concise and well-structured: it front-loads the primary purpose, then explains the key behavioral nuance, then lists the return fields. No sentences are wasted, and the formatting with code spans improves readability.

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 covers the validation target, schema selection behavior, and return structure, which is sufficient for a tool with a rich output schema and only two optional parameters. Minor gaps such as what happens if both parameters are provided or neither is provided are not addressed, but the schema's 'Provide either' instruction partly mitigates this.

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?

The input schema already provides 100% coverage of both parameters with clear descriptions for xml_base64 and xml_content. The tool description adds no parameter-level meaning beyond the schema, so the baseline of 3 is appropriate.

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 states a specific action ('Validate an NF-e/NFC-e XML'), the exact document types (modelo 55/65, schema 4.00), and the validation artifact (bundled PL_010d XSD). This clearly differentiates it from sibling validators like br__validate_nfse_xml and br__validate_cte_xml.

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?

The description gives useful context, especially the distinction between unsigned and signed documents, implying use after br__sign_nfe. However, it does not explicitly state when to prefer this tool over alternatives or when not to use it. The usage guidance is implied rather than explicit.

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