Skip to main content
Glama

Stackin

correct_invoice

Destructive

File an electronic correction letter (CC-e) against an NF-e.

NF-e only: there is no correction letter for an NFS-e, where a wrong document is cancelled and issued again.

It corrects wording and non-fiscal fields only. It cannot change values, taxes, the recipient or the products — those still require cancelling and issuing again, and telling the user a CC-e will fix an amount is wrong in a way they only discover at an audit.

Each letter supersedes the previous one and the SEFAZ keeps at most 20 per document. The text reaches the tax authority verbatim.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_keyYes
correctionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoLocal id. Use it for reissue and for submissions, and when a document was rejected and has no key.
statusNoissued, rejected or cancelled.
protocolNoThe authorization protocol, when granted.
access_keyNoThe authorizer's key. Absent while the document is not authorized.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, so the mutation aspect is covered. The description adds significant behavioral context: each letter supersedes the previous one, SEFAZ keeps at most 20 per document, and the text reaches the tax authority verbatim. It also explains the limitation on fiscal fields, which is not evident from annotations. This goes well beyond what annotations provide.

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?

The description is concise and front-loaded with the core purpose, followed by essential limitations and side effects. Each sentence adds value, and it avoids redundant phrasing. It is slightly longer than strictly necessary but well-organized, making it easy to scan. A score of 4 reflects strong structure with minor room for tightening.

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 mutation tool with destructiveHint, the description covers the key operational details: NF-e only, field limitations, supersession, 20-letter cap, and verbatim transmission. It also distinguishes from cancellation/reissue. It does not describe the output schema (which is provided separately) or mention authentication or error conditions, but those are less critical given the existing output schema and the thoroughness of the description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for parameter meaning. It does not explicitly explain 'access_key' or the 'correction' field beyond the general context. The term 'correction' is implicitly the letter text, but there is no mention of format, length constraints (minLength 15), or what access_key represents (e.g., the NF-e access key). This is a notable gap given zero schema documentation.

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 precise action: 'File an electronic correction letter (CC-e) against an NF-e.' It immediately distinguishes from NFS-e and explicitly states it corrects wording and non-fiscal fields only, setting it apart from cancel_invoice and reissue_invoice siblings. The verb and resource are specific, and the scope is unambiguous.

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?

The description gives explicit when-to-use guidance (for wording and non-fiscal field corrections) and when-not-to-use guidance (cannot change values, taxes, recipient, or products; those require cancelling and reissuing). It also clarifies NF-e only, not NFS-e, and warns that using it for amounts is wrong and only discovered at audit. This is thorough routing to alternatives.

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.