Skip to main content
Glama

Br Consult Cte

br__consult_cte

Check the status of a CT-e by its 44-character access key through a specified SEFAZ endpoint. Returns the official response code, reason, and protocol when available.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.2

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it delivers: it declares read-only behavior ('Read-only — não requer confirmação'), scopes the operation to a single pre-known document, discloses that no endpoint URL is embedded in this version and that endpoint_override is therefore required, and states the return contract (cStat/xMotivo/protCTe or error). It omits certificate/auth side effects, but the cert parameters are schema-documented and this is a non-mutating consult, so the disclosure is solidly above the minimum viable bar.

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?

Three short paragraphs, front-loaded with the core purpose, then scope/disambiguation and the return contract. Every sentence carries distinct information; the br__distribute_dfe aside earns its place as disambiguation rather than filler. No redundancy with the title or schema.

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?

An output schema exists, so return values are structurally covered, and all six parameters are fully documented in the input schema. The description adds the operation type, the mandatory endpoint override, and read-only semantics. The main gap is that it does not differentiate from the similar-looking sibling br__consult_cte_sefaz_status; aside from that, this is nearly complete for a read-only consult tool whose schema and output schema carry much of the load.

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 only light framing — that ch_cte identifies the document and that endpoint_override is necessary because no URL is embedded — which slightly enriches the schema's 'obrigatório, ver docstring do módulo' note, but it does not add meaningful format or behavioral detail beyond what the schema already states for each parameter.

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 specific verb and resource — 'Consulta a situação de um CT-e por chave de acesso (CTeConsultaV4)' — and names the exact protocol operation. It also distinguishes itself from a sibling ('diferente de br__distribute_dfe no NF-e') and clarifies scope: a single, already-known CT-e, not a batch. An agent can tell exactly what this does without opening the schema.

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 explicitly names br__distribute_dfe as the alternative and states the selecting condition — this tool queries one specific CT-e known by access key, not a batch of third-party fiscal data. It also flags that endpoint_override is mandatory. However, it never offsets the closer sibling br__consult_cte_sefaz_status, which an agent could plausibly confuse with this CT-e consultation tool.

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