Skip to main content
Glama

Stackin

validate_invoice_payload

Read-onlyIdempotent

Check invoice data against the field rules without issuing anything.

Nothing is sent to the tax authority and no document is created. The SDK models check field formats, and for nfe the rules the SEFAZ refuses a document over: ncm and cfop on every item, and a complete recipient address. Worth calling before issue_invoice whenever a field was inferred rather than given.

This does not replace issuing: the authorizer's cross-field and fiscal rules are only checked when the document is transmitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
document_typeYes
recipient_addressNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYesTrue when no field rule was broken. It does not promise the authorizer will accept the document.
errorsNo
checkedYesWhat was checked, so the answer is not read as more than it is.
document_typeYes

Schema Changelog

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

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive. The description reinforces this with 'Nothing is sent to the tax authority and no document is created' and adds behavioral context by detailing what is checked (field formats, nfe-specific ncm/cfop and address) and what is not (cross-field/fiscal rules). This exceeds annotation coverage without contradiction.

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 three short paragraphs with the core purpose front-loaded. Each sentence adds value: the summary, the safety reassurance, the specific checks, and the limitation. It is slightly verbose but not padded, and the structure is logical.

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 validation tool with an output schema, the description covers usage context, limitations, and key validation specifics. It doesn't fully enumerate all param requirements or the exact validation rules, but it provides enough for an agent to decide when and why to call it. The presence of an output schema reduces the need to explain return values.

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 has 0% description coverage, so the description must compensate. It references items and recipient_address in the nfe context, implying their significance, and document_type is covered by the enum. However, it doesn't explicitly detail each parameter's format or constraints, leaving some interpretation to the agent. Still, it adds meaningful context beyond the bare schema.

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 clearly states the tool validates invoice data against field rules without issuing anything. It distinguishes itself from issue_invoice and specifically mentions the nfe checks (ncm, cfop, recipient address), making its purpose 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?

It explicitly advises calling this before issue_invoice when a field was inferred, and warns that it does not replace issuing since authorizer rules are only checked on transmission. This gives clear when-to-use and when-not-to-use guidance, differentiating it from sibling tools.

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.