Skip to main content
Glama

Br Generate Cte

br__generate_cte

Generate an unsigned CT-e XML (modelo 57, schema 4.00) for freight transport, supporting road modal and ICMS CST 00. Returns XML, access key, and warnings for SEFAZ submission.

Instructions

Generate an unsigned CT-e XML (modelo 57, schema 4.00).

v1 supports modal rodoviário only and ICMS CST 00 (tributação normal) only — other modais/CSTs raise an error. The returned <CTe><infCte>…</infCte></CTe> document does not include <Signature> — sign it with br__sign_cte (roadmap BR-CTE-6 factory, tool not yet registered) before SEFAZ submission.

Returns a dict with:

  • xml: the generated CT-e XML string

  • chave_acesso: the computed 44-character access key (chCTe)

  • warnings: list of non-fatal notices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cteYesCT-e data matching the BRCTeDocument schema (modelo 57)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.2

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full behavioral disclosure burden. It fully meets that burden by stating that the output is unsigned, that unsupported modais/CSTs raise an error, that the return is a dict with xml, chave_acesso, and warnings, and that signing is required before SEFAZ submission.

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: the core purpose appears first, followed by critical constraints and workflow, and then the return value breakdown in a clear bulleted list. Every sentence adds useful information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of generating a CT-e XML document and the absence of annotations, the description is complete enough for an agent to invoke it correctly. It covers scope, version, supported modes, error behavior, the need for signing, the next step in the workflow, and the shape of the return value, while an output schema is also present for additional detail.

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?

The schema describes the single `cte` parameter as 'CT-e data matching the BRCTeDocument schema (modelo 57),' so schema coverage is high. The description adds meaningful semantic constraints beyond the schema by explicitly limiting v1 support to modal rodoviário and ICMS CST 00, telling the agent which values will cause an error.

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: 'Generate an unsigned CT-e XML (modelo 57, schema 4.00).' It clearly distinguishes this tool from siblings like br__validate_cte_xml, br__submit_cte, and br__cancel_cte by focusing on generation and explicitly noting that the output is unsigned.

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 clear usage context: it is for generating CT-e XML in v1, supports only modal rodoviário and ICMS CST 00, and other inputs raise an error. It also tells the agent to sign the document with br__sign_cte before SEFAZ submission. However, it does not explicitly compare this tool to a generation alternative or state when to prefer a sibling generation tool.

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