Skip to main content
Glama

Pré-validar regras de negócio do BP-e

bpe_validar_regras_negocio

Validates BP-e business rules locally before submission, checking dates, contingency, access key, trip/connections, issuer/buyer, values, discounts, payments, substitution, autXML, and QR Code.

Instructions

Executa localmente as regras do Grupo F do MOC (datas de emissão/embarque/validade, contingência, chave, viagem/conexões, emitente, comprador, componentes de valor, descontos, pagamentos, substituição, autXML e QR Code) antes do envio.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tpEmis": "<tpEmis>",
      "dhEmi": "<dhEmi>"
    },
    "name": "bpe_validar_regras_negocio"
  }
}

Input Schema

NameRequiredDescriptionDefault
cBPNo
cUFNo
nBPNo
icmsNo
UFFimNo
UFIniNo
chBPeNo
dhEmbNoData/hora do embarque
dhEmiYesData/hora de emissão AAAA-MM-DDTHH:MM:SS±HH:MM
modalNo1=Rodoviário, 3=Aquaviário, 4=Ferroviário
serieNo
tpAmbNo
tpBPeNo0=Normal, 3=Substituição
xJustNo
autXMLNo
dhContNo
qrCodeNo
tpEmisYes1=Normal, 2=Contingência Off-line
agenciaNo
cMunFimNo
cMunIniNo
respTecNo
valoresNo
viagensNo
emitenteNo
compradorNo
dhValidadeNo
pagamentosNo
passageiroNo
infTravessiaNotrue se o grupo infTravessia foi preenchido
substituicaoNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses that the rules run 'localmente', implying no SEFAZ call and no server-side side effects, which is meaningful behavioral context. It does not say whether the tool throws, how violations are surfaced, or whether anything is persisted, leaving a notable gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence, front-loaded with the action and the standard, then a parenthetical enumeration. Dense but every element corresponds to a real rule family; the list could be trimmed only slightly without losing coverage information.

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

Completeness3/5

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

For a 31-parameter, deeply nested validation tool with no output schema and no annotations, the description says what is validated but nothing about the response contract (pass/fail shape, list of violations, severity). Missing that, an agent cannot fully anticipate how to consume the result.

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 only 19% against 31 parameters, so the description must compensate. The parenthetical list of rule domains (datas, contingência, chave, viagem/conexões, emitente, comprador, pagamentos, substituição, autXML, QR Code) roughly maps to the top-level parameter groups, but adds no format, conditional-requirement, or optionality detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Executa localmente as regras do Grupo F do MOC') and enumerates the rule families covered, so an agent knows exactly what is being checked. The closing 'antes do envio' implicitly separates it from the transmission siblings such as bpe_autorizar, though no sibling is named outright.

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?

'antes do envio' gives a clear implied timing (run before submitting), which is real usage guidance. However, there is no explicit when-not, no statement of prerequisites, and no named alternative for the case where the caller wants validation after transmission or wants full schema diagnostics.

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