Skip to main content
Glama

reissue_invoice

Destructive

Retry a rejected invoice after the data that caused the rejection was fixed.

Takes the local invoice_id, not the access key: a rejected document never got one. Consumes a credit like a new issuance, so it takes an idempotency_key for the same reason issue_invoice does. An authorized invoice is corrected or cancelled, never reissued.

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

Input Schema

NameRequiredDescriptionDefault
company_idNoUUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both.
invoice_idYesThe local invoice id (a UUID), as list_invoices and issue_invoice return it. Not the access key.
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.
idempotency_keyNoOne per business event, e.g. order-1042. Printable ASCII up to 255, no leading or trailing space.

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. Changed3 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."
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"One per business event, e.g. order-1042. Sent as an HTTP header: printable ASCII up to 255, no leading or trailing space."New value: +"One per business event, e.g. order-1042. Printable ASCII up to 255, no leading or trailing space."
  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. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / anyOf
      Previous value: -[
      -  {
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 255,
      +    "minLength": 1,
      +    "pattern": "^[!-~](?:[ -~]*[!-~])?$",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"One per business event. An empty key protects nothing, so it is refused rather than ignored."New value: +"One per business event, e.g. order-1042. Sent as an HTTP header: printable ASCII up to 255, no leading or trailing space."
  4. Changed13 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"
    • removedInput schema / properties / idempotency_key / title
      Removed value: -"Idempotency Key"
    • addedInput schema / properties / invoice_id / description
      Added value: +"The local invoice id (a UUID), as list_invoices and issue_invoice return it. Not the access key."
    • removedInput schema / properties / invoice_id / title
      Removed value: -"Invoice Id"
    • removedInput schema / title
      Removed value: -"reissue_invoiceArguments"
    • 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"
  5. 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"
      +}
  6. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / idempotency_key / description
      Added value: +"One per business event. An empty key protects nothing, so it is refused rather than ignored."
  7. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the annotations, it discloses two important behaviors: a reissue consumes a credit like a new issuance, and it requires an idempotency_key for that reason. It also clarifies that a rejected document has no access key, so only the local invoice_id applies. It does not say what happens to the original rejected document or whether the credit is refunded if the retry fails.

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 purpose is front-loaded in the first sentence, followed by the two non-obvious constraints (local id only, credit consumption) and the exclusion. The text is tight, though the final sentence could name the sibling tools directly rather than only their concepts.

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?

With annotations covering the safety profile and an output schema covering returns, the description supplies the operational context an agent needs: when a reissue is valid, that it consumes a credit, and which identifier to pass. It stops short of describing failure or refund behavior for a destructive, credit-consuming mutation.

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 all four parameters are already documented in the schema, including the local-invoice-id versus access-key distinction and the idempotency_key format. The description reinforces the invoice_id semantics and gives a rationale for the idempotency_key but adds little parameter detail the schema does not already contain.

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 first sentence names a specific verb and resource: retrying a rejected invoice after the underlying data is fixed. It distinguishes the operation from issuance, correction, and cancellation in the final sentence, so an agent can tell it apart from issue_invoice and correct_invoice without opening either 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?

It states the trigger condition (a rejected invoice whose rejection cause has been fixed) and an explicit exclusion (an authorized invoice is corrected or cancelled, never reissued), which routes the agent to the correct sibling behavior. No prerequisite is left to inference.

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.