Skip to main content
Glama

Br Validate Cte Xml

br__validate_cte_xml

Validate CT-e XML documents against the official PL_CTe_400 XSD schema, returning validity status, errors, warnings, and schema version.

Instructions

Validate a CT-e XML (modelo 57, schema 4.00) against the bundled PL_CTe_400 XSD.

CTeXSDValidator selects the schema automatically: documents without a <ds:Signature> are validated against the unsigned derivative; signed documents 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 CT-e XML bytes.
xml_contentNoRaw CT-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. Addedv0.6.2

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 meaningfully explains that CTeXSDValidator auto-selects the unsigned or signed XSD depending on the presence of ds:Signature, and it states the returned dict fields. It does not explicitly declare read-only behavior or offline validation, but 'validate against the bundled XSD' strongly implies those traits.

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 compact and well-structured: a clear purpose statement, followed by the key automatic schema-selection behavior, followed by the return value summary. Every sentence contributes necessary information and there is no filler.

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 output schema covers return-value structure, and the input schema already documents parameters. The description covers the non-obvious schema-selection behavior that would otherwise be opaque. The only notable gap is the absence of explicit guidance for choosing between this and sibling validators, but the tool name and opening sentence already make the CT-e scope clear.

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%, with both xml_base64 and xml_content already documented, including the either/or relationship. The description adds no new 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 first sentence states a precise verb and object: validate a CT-e XML (modelo 57, schema 4.00) against the bundled PL_CTe_400 XSD. This clearly distinguishes the tool from validate_nfe_xml, validate_nfse_xml, and the other CT-e sibling tools like submit_cte or cancel_cte.

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 implies the use case—validating CT-e XML documents—but does not explicitly state when to use this tool versus the NFe/Nfse validators, nor does it name alternatives or exclusion conditions. The context is clear, but the description leaves tool-selection routing to the agent's inference.

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