Skip to main content
Glama

Arquivix Notas · NFS-e

nfse_review

Destructive

Resolves one invoice stuck in status "manual_review" (the portal did not confirm whether the NFS-e exists). Only valid in that status; otherwise it fails and tells the current status. Actions: "retry" sends the invoice back to reconciliation with the same DPS: the portal is asked for that DPS before anything is sent, so it never issues a second NFS-e; it ends authorized, rejected, or back in review if the portal is still silent. It is safe. "discard" asks the portal about the DPS: if the NFS-e exists the invoice becomes authorized; only when the portal confirms it was never registered is the invoice rejected (credit refunded); otherwise it stays in review. A discarded invoice leaves its number (DPS) skipped. When the invoice error code is DPS_NUMBER_USED_BY_OTHER_NFSE the portal already has that DPS number on ANOTHER NFS-e (error_message says which one): this invoice was never issued, "retry" is refused, and "discard" rejects it and refunds the credit; the sale can then be issued again as a new invoice with a new number. "discard" leaves the invoice number skipped, while "retry" does not. The platform also checks the portal automatically every 30 minutes. The result is asynchronous: the final status shows on the invoice later. With type "nfe" or "nfce": "retry" asks the SEFAZ for the note by its access key (for an NF-e in reconciliation_required or manual_review) and "discard" drops a rejected NF-e so it can be fixed and sent again.

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": {
      "invoice_id": "<invoice_id>",
      "action": "<action>"
    },
    "name": "nfse_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNoKind of invoice: "nfse" (default, services), "nfe" (goods, model 55) or "nfce" (sale to the consumer, model 65). NF-e and NFC-e are homologação only and need their own release for the account. With "nfe" or "nfce" use invoice_id, not access_key.nfse
actionYes"retry" (safe, same DPS) or "discard" (skips the number)
invoice_idYesUUID of the invoice in manual_review

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already disclose a destructive, non-read-only, non-idempotent write against an open world, and the description is consistent with that while adding real value: retry never issues a second NFS-e, discard refunds credit only on portal confirmation, and results are asynchronous. The one odd note is 'It is safe' for retry, which sits in mild tension with destructiveHint=true, though it applies only to that action. Overall strong disclosure beyond the annotations, though the asynchronous/failure semantics for the nfe/nfce branch are thinner.

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

Conciseness3/5

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

The first sentence front-loads scope well, but the remainder is one long unbroken block with redundancy: the skipped-DPS number is stated twice ('A discarded invoice leaves its number (DPS) skipped' and again near the end). The trailing nfe/nfce sentence arrives after a long digression and would read better as its own paragraph.

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?

For a three-parameter mutation with no output schema, this covers the essential ground: valid starting state, per-action outcomes, credit refund rules, async result timing, and the error-code special case. The only thin spot is the nfe/nfce branch, which gets one sentence versus several paragraphs for nfse.

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?

Schema coverage is 100%, so the baseline is 3; the description still adds meaning by explaining what 'retry' versus 'discard' actually do to the invoice and by describing the nfe/nfce-specific behavior. It does not restate the UUID format or enum values, keeping the added text genuinely semantic.

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?

Names a specific verb and resource ('Resolves one invoice stuck in status manual_review') and immediately scopes it with the parenthetical explaining that state. It also carves out the nfe/nfce variant of the same operation, so an agent can tell this apart from issue/cancel/repeat siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when it is valid ('Only valid in that status; otherwise it fails and tells the current status') and gives detailed decision criteria between the two actions, including the special DPS_NUMBER_USED_BY_OTHER_NFSE case where retry is refused. It also notes the platform polls the portal every 30 minutes, which tells the agent when doing nothing is an option.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources