Skip to main content
Glama

br__consult_cte

Consult the status of a CT-e by its 44-character access key. Returns the authorization status, reason, and processing protocol (if available) from SEFAZ.

Instructions

Consulta a situação de um CT-e por chave de acesso (CTeConsultaV4).

Read-only — não requer confirmação (consulta um CT-e específico e já conhecido pela chave de acesso, não um lote de dados fiscais de terceiros — diferente de br__distribute_dfe no NF-e). Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — endpoint_override é obrigatório.

Retorna cStat/xMotivo/protCTe (quando aplicável) ou error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
c_ufYesCódigo IBGE da UF do autorizador (cUF), 2 dígitos
ch_cteYesChave de acesso do CT-e (chCTe), 44 caracteres
tp_ambNoIdentificação do Ambiente (tpAmb): '1' = produção, '2' = homologação2
cert_pathYesCaminho local para o certificado ICP-Brasil A1 (.p12/.pfx)
cert_passwordNoSenha do certificado A1, se houver
endpoint_overrideYesURL completa do webservice CTeConsultaV4 — obrigatório, ver docstring do módulo.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations provided, so description fully carries the burden. It discloses the tool is a consultation (non-destructive), describes return fields (cStat, xMotivo, protCTe or error), and warns that no endpoint URL is embedded, making endpoint_override mandatory. This gives agents a clear behavioral model.

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?

Description is three sentences, front-loaded with the verb and resource. Every sentence adds value: what it does, scope, mandatory parameter, return format. No fluff.

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 6 parameters (4 required), no annotations, and an output schema, the description covers return values, behavioral constraints (read-only, mandatory override), and differentiation from sibling. It is complete for the tool's complexity.

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?

Input schema has 100% description coverage, so each parameter is already documented. The description adds context that endpoint_override is mandatory (already in required) and explains that ch_cte is the access key. No significant extra meaning beyond the schema, thus baseline 3.

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?

Description clearly states the tool consults the situation of a specific CT-e using its access key. It specifies the operation (CTeConsultaV4), marks it as read-only, and distinguishes from sibling `br__distribute_dfe` by scope (single known CT-e vs batch).

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?

Description indicates the tool is read-only and requires no confirmation. It contrasts with `br__distribute_dfe` and notes endpoint_override is mandatory. However, no explicit 'when to use' or 'when not to use' guidance beyond the sibling distinction.

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/cmendezs/mcp-nfe-br'

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