Skip to main content
Glama

Arquivix Notas · NFS-e

nfse_substitute

Destructive

Correct an authorized invoice by issuing a substitute. Only the service description, the purchase order and the notes can change: the customer, the competence date and the amount stay as issued (the tax authority refuses a substitute that changes them for MEI and Simples Nacional; to correct those, cancel the invoice and issue another). The original stays authorized until the substitute is authorized and only then becomes cancelled. The substitute uses a credit. Without confirm: true it changes nothing and returns a preview; with confirm: true it runs.

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>",
      "description": "<description>"
    },
    "name": "nfse_substitute"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoNew notes; an empty text removes them
confirmNotrue runs the action. Without it nothing changes and only a preview is returned.
invoice_idYesUUID of the authorized invoice to substitute
descriptionYesWhy the invoice is being substituted (15-255 chars)
purchase_orderNoNew purchase order; an empty text removes it
service_descriptionNoNew service description

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and non-idempotent, and the description adds genuinely new behavior: the original remains authorized until the substitute is authorized, then flips to cancelled, and the operation consumes a credit. It does not discuss failure modes (e.g., what happens to a pending substitute or whether the credit is consumed on a rejected substitute), which keeps it short of a 5.

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?

Front-loaded with the core action and tightly scoped, with no filler sentences. The regulatory parenthetical about MEI and Simples Nacional is dense but earns its place by explaining why the constraint exists.

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

Completeness5/5

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

For a destructive, credit-consuming mutation with no output schema, the description covers field mutability, lifecycle effects on the original invoice, cost, and the confirm gate — everything an agent needs to invoke it without surprise.

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 adds a mutability map (service_description, purchase_order and notes are editable; customer, competence date and amount are not) plus the preview/run meaning of confirm. It does not elaborate on the required 'description' reason field beyond what the schema already states.

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?

States a specific verb and resource ('Correct an authorized invoice by issuing a substitute') and immediately distinguishes itself from the cancel path for non-editable fields. An agent can tell what this tool does and what it is not (a cancellation) 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 Guidelines5/5

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

Explicitly bounds when this tool applies (only service description, purchase order, notes may change) and when it does not (customer, competence date, amount — go cancel and reissue instead). It also specifies the preview default versus confirm: true, so the agent knows the safe invocation path.

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