Skip to main content
Glama

invalidate_numbering

Destructive

Declare an NF-e numbering range reserved but never used.

NF-e numbering has to be continuous, so a gap left by a failed issuance is explained to the SEFAZ with this — not with a new document. Irreversible: a number declared unused can never be used.

Only for numbers that were never authorized. An authorized document is cancelled, never invalidated. Confirm the range with the user and read it back before calling: the range is inclusive, and one digit wrong burns numbers the company still needs.

The SDK refuses a backwards range and a reason outside 15-255 characters before anything is transmitted.

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": {
      "series": "<series>",
      "number_start": "<number_start>",
      "number_end": "<number_end>",
      "reason": "<reason>"
    },
    "name": "invalidate_numbering"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYesWhy the numbers went unused, 15 to 255 characters, sent verbatim, e.g. Falha no sistema durante a emissao.
seriesYesThe NF-e series of the range, e.g. 1.
company_idNoUUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both.
number_endYesLast unused number, inclusive; equal to number_start for a single number.
number_startYesFirst unused number, inclusive.
company_tax_idNoCNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both.

Output 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.

  1. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
  2. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
  3. Changed18 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for, as list_authorized_companies shows it. Omit it when the connection covers a single company: that company is used. Required when the connection covers several — call list_authorized_companies to see them, with their ids and what each one allows. Give company_id or company_tax_id, never both."New value: +"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."
    • removedInput schema / properties / company_id / title
      Removed value: -"Company Id"
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for — the company using Stackin, never the recipient or a taxpayer being looked up. Punctuation is ignored. Omit it when the connection covers a single company: that company is used. Required when the connection covers several — call list_authorized_companies to see them, with their ids and what each one allows. Give company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."
    • removedInput schema / properties / company_tax_id / title
      Removed value: -"Company Tax Id"
    • addedInput schema / properties / number_end / description
      Added value: +"Last unused number, inclusive; equal to number_start for a single number."
    • removedInput schema / properties / number_end / title
      Removed value: -"Number End"
    • addedInput schema / properties / number_start / description
      Added value: +"First unused number, inclusive."
    • removedInput schema / properties / number_start / title
      Removed value: -"Number Start"
    • addedInput schema / properties / reason / description
      Added value: +"Why the numbers went unused, 15 to 255 characters, sent verbatim, e.g. Falha no sistema durante a emissao."
    • removedInput schema / properties / reason / title
      Removed value: -"Reason"
    • addedInput schema / properties / series / description
      Added value: +"The NF-e series of the range, e.g. 1."
    • removedInput schema / properties / series / title
      Removed value: -"Series"
    • removedInput schema / title
      Removed value: -"invalidate_numberingArguments"
    • removedOutput schema / properties / access_key / title
      Removed value: -"Access Key"
    • removedOutput schema / properties / id / title
      Removed value: -"Id"
    • removedOutput schema / properties / protocol / title
      Removed value: -"Protocol"
    • removedOutput schema / properties / status / title
      Removed value: -"Status"
    • removedOutput schema / title
      Removed value: -"InvoiceResult"
  4. Changed2 schema fields changed
    • addedInput schema / properties / company_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 64,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "UUID of the company this call acts for, as list_authorized_companies shows it. Omit it when the connection covers a single company: that company is used. Required when the connection covers several — call list_authorized_companies to see them, with their ids and what each one allows. Give company_id or company_tax_id, never both.",
      +  "title": "Company Id"
      +}
    • addedInput schema / properties / company_tax_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 18,
      +      "minLength": 11,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "CNPJ or CPF of the company this call acts for — the company using Stackin, never the recipient or a taxpayer being looked up. Punctuation is ignored. Omit it when the connection covers a single company: that company is used. Required when the connection covers several — call list_authorized_companies to see them, with their ids and what each one allows. Give company_id or company_tax_id, never both.",
      +  "title": "Company Tax Id"
      +}
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructive and non-idempotent, but the description goes well beyond them: it states the effect is irreversible and that a burned number can never be reused, explains the SEFAZ rationale, and pre-announces client-side validation failure modes (backwards range, reason outside 15-255 characters) that occur before transmission.

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?

Risk and irreversibility are front-loaded, then the exclusion rule, then the safety check, then the validation note — a sensible order. A few lines are slightly redundant (the irreversibility point is made twice in adjacent sentences), costing a perfect score.

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?

An output schema exists, so return values need no explanation, and the description covers the remaining burden for a destructive, irreversible fiscal operation: purpose, precondition, irreversible consequence, correct-alternative routing, and validation limits. Nothing needed to call this safely is missing.

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 coverage is 100%, so the schema already documents inclusivity, the 15-255 character reason bound, and the company identifier options. The description restates the inclusive range and the length constraint rather than adding format, default, or edge-case meaning beyond them, so the baseline 3 applies.

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?

Opens with a specific verb and resource ('Declare an NF-e numbering range reserved but never used') and immediately frames the tool against its nearest sibling by stating that an authorized document is cancelled, never invalidated. An agent can distinguish this from cancel_invoice or issue_invoice 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?

Gives an explicit when ('a gap left by a failed issuance'), an explicit when-not ('Only for numbers that were never authorized'), and names the correct alternative operation ('cancelled, never invalidated'). It also adds an operational precondition: confirm and read back the range with the user before calling.

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.