{
  "notice": "bxzxxr MCP archive: a record of what public MCP servers declared when we listed them (we never call their tools). It is data, not a rating: nothing here says a server is safe, secure, verified or trustworthy, and a server can change after we looked. Secrets we detected are redacted; redacted tool lists are withheld and only their hash is shown.",
  "infrastructure": {
    "host": "mcp.stackin.io",
    "site": "stackin.io",
    "addresses": [
      {
        "address": "44.209.12.179",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 14618,
          "name": "AMAZON-AES - Amazon.com, Inc.",
          "prefix": "44.192.0.0/11",
          "country": "US"
        }
      },
      {
        "address": "100.27.103.113",
        "endpoints": 1,
        "shared_infrastructure": false,
        "network": {
          "asn": 14618,
          "name": "AMAZON-AES - Amazon.com, Inc.",
          "prefix": "100.24.0.0/13",
          "country": "US"
        }
      }
    ],
    "addresses_recorded": true,
    "address_history": [
      {
        "addresses": [
          "44.209.12.179",
          "100.27.103.113"
        ],
        "first_seen": "2026-11-21T17:11:02.096Z",
        "last_seen": "2026-11-21T17:11:02.096Z",
        "checks": 1
      }
    ],
    "hosting": [],
    "software": [],
    "server_info": {
      "name": "stackin",
      "version": "0.9.0",
      "protocol_version": "2025-06-18"
    },
    "headers": {},
    "auth": null
  },
  "related": {
    "same_address": {
      "total": 0,
      "sample": []
    },
    "same_site": {
      "total": 0,
      "sample": []
    },
    "same_tool_list": {
      "total": 0,
      "sample": []
    },
    "same_publisher": {
      "publisher": "io.github.stackin-io",
      "total": 0,
      "sample": []
    },
    "same_repository": {
      "repository_url": "https://github.com/stackin-io/stackin-mcp-plugin",
      "total": 0,
      "sample": []
    },
    "note": "Shared addresses on big platforms (Cloudflare, Vercel and the like) put unrelated servers together; those are marked shared_infrastructure. A match is a pivot, not a link between operators."
  },
  "endpoint": {
    "id": "39534",
    "server_name": "io.github.stackin-io/stackin",
    "url": "https://mcp.stackin.io/mcp",
    "host": "mcp.stackin.io",
    "transport": "streamable-http",
    "last_checked_at": "2026-11-21T17:11:02.096Z",
    "last_state": "listed",
    "last_detail": null,
    "consecutive_failures": 0,
    "current_sha": "45f2e94e31be1e87fbbd2bca94f14e7997c1edb505f6b6b530d76a2019846c5f",
    "first_listed_at": "2026-11-21T17:11:02.096Z",
    "created_at": "2026-11-21T12:00:05.299Z",
    "resolved_addresses": [
      "44.209.12.179",
      "100.27.103.113"
    ]
  },
  "server": {
    "name": "io.github.stackin-io/stackin",
    "title": "Stackin",
    "description": "Issue and manage Brazilian fiscal documents: NF-e for goods, NFS-e for services.",
    "version": "1.4.0",
    "registry_status": "active",
    "repository_url": "https://github.com/stackin-io/stackin-mcp-plugin",
    "website_url": "https://docs.stackin.io/mcp",
    "published_at": "2026-11-21T22:31:43.745Z",
    "updated_at": "2026-11-21T22:31:43.745Z",
    "first_seen": "2026-11-21T12:00:04.370Z"
  },
  "other_endpoints": [],
  "intel": {
    "capabilities": [
      "takes-payment"
    ],
    "evm_addresses": [],
    "chains": [],
    "tokens": [],
    "computed_at": "2026-11-22T15:51:11.888Z"
  },
  "operator": null,
  "needs_sign_in": false,
  "reachability": {
    "window_days": 30,
    "checks": 1,
    "answered": 1,
    "answered_percent": 100,
    "avg_listing_latency_ms": 3417,
    "first_check_in_window": "2026-11-21T17:11:02.096Z",
    "consecutive_failures_now": 0,
    "days": [
      {
        "day": "2026-11-21",
        "checks": 1,
        "answered": 1,
        "last_state": "listed"
      }
    ]
  },
  "tool_list": {
    "sha256": "45f2e94e31be1e87fbbd2bca94f14e7997c1edb505f6b6b530d76a2019846c5f",
    "tools": 34,
    "resources": 1,
    "prompts": 10,
    "first_seen": "2026-11-21T17:11:05.515Z",
    "tool_names": [
      "issue_invoice",
      "consult_invoice",
      "cancel_invoice",
      "get_invoice_pdf",
      "reissue_invoice",
      "correct_invoice",
      "invalidate_numbering",
      "list_invoices",
      "get_invoice_submissions",
      "invoice_stats",
      "list_invalidations",
      "validate_invoice_payload",
      "list_received_invoices",
      "sync_received_invoices",
      "manifest_received_invoice",
      "lookup_fiscal_code",
      "search_fiscal_codes",
      "list_fiscal_kinds",
      "lookup_taxpayer",
      "search_cities",
      "list_authorized_companies",
      "get_usage",
      "get_company_readiness",
      "list_clients",
      "get_client",
      "save_client",
      "deactivate_client",
      "reactivate_client",
      "explain_rejection",
      "classify_item",
      "list_webhooks",
      "create_webhook",
      "delete_webhook",
      "list_webhook_deliveries"
    ],
    "declared": {
      "tools": [
        {
          "name": "issue_invoice",
          "description": "Issue a Brazilian fiscal document: NFS-e or NF-e.\n\nThis produces a legal fiscal document. Confirm the data with the\nuser before calling when you inferred any field.\n\nSend unit_price with quantity when the user quotes a price per\nunit, amount when they quote the line. Sending both asserts they\nagree and is refused if they do not.\n\nnfse is a service invoice: the address is optional and\nservice_code (LC 116/2003 item.subitem) falls back to the\ncompany's fiscal profile. nfe is for goods, and the SEFAZ rejects\na partial one: ncm and cfop on every item and the full\nrecipient_address. Call validate_invoice_payload first when any of\nthat was inferred rather than given.\n\nA complementary, adjustment or return NF-e sets purpose and names\nthe original in referenced_keys; a return the company receives\nback sets direction in. An export has recipient_address state EX\nwith country_code, the export group, and foreign_id when the\nbuyer has a passport.\n\nLook the recipient up with list_clients first and pass its id as\nclient_id. A new recipient is saved as a client after a\nsuccessful issuance.\n\nPass idempotency_key when a retry is possible: the same key with\nthe same payload replays the first answer instead of issuing a\nsecond document. Without one, a retry after a lost response\nissues again, burning another credit and number that only a\ncancellation within its deadline undoes. One key per business\nevent, not per call; nothing generates it for you.\n\nBefore a company's first document, get_company_readiness says\nwhether it can issue at all.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "document_type",
              "items"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "description"
                  ],
                  "properties": {
                    "ncm": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^(00|\\d{8})$",
                      "description": "The full 8 digits, or 00 for a service line. Any other short code the SEFAZ rejects with 777."
                    },
                    "tax": {
                      "type": "object",
                      "description": "The item's taxes, already computed: icms, icms_uf_dest, ipi, pis, pis_st, cofins, cofins_st and v_tot_trib, each ICMS variant chosen by its cst or csosn. Leave it out unless the user gave the computed values. Validated against the SDK model; full shape in the stackin://schemas/invoice-item resource."
                    },
                    "cest": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^\\d{7}$"
                    },
                    "cfop": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^[123567]\\d{3}$"
                    },
                    "fuel": {
                      "type": "object",
                      "description": "The NF-e fuel group (comb), needed for a fuel CFOP: anp_code (9 digits), anp_description and consumer_state, plus optional GLP percentages. Full shape in the stackin://schemas/invoice-item resource."
                    },
                    "unit": {
                      "type": "string",
                      "default": "UN"
                    },
                    "amount": {
                      "anyOf": [
                        {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    },
                    "barcode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^(SEM GTIN|\\d{8}|\\d{12,14})$",
                      "description": "cEAN: a GTIN-8/12/13/14, or SEM GTIN."
                    },
                    "ex_tipi": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^\\d{2,3}$"
                    },
                    "freight": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "default": null
                    },
                    "ibs_cbs": {
                      "type": "object",
                      "description": "The Reforma Tributaria group (IBS/CBS) for the item, computed: cst (3 digits), classification (cClassTrib, 6 digits), rate_state, rate_city and rate_federal; base, reduction_ibs and reduction_cbs when they apply. Full shape in the stackin://schemas/invoice-item resource."
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "default": null
                    },
                    "quantity": {
                      "type": "number",
                      "default": 1,
                      "exclusiveMinimum": 0
                    },
                    "insurance": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "default": null
                    },
                    "nve_codes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}\\d{4}$"
                      },
                      "default": null
                    },
                    "ind_escala": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "unit_price": {
                      "anyOf": [
                        {
                          "type": "number",
                          "exclusiveMinimum": 0
                        },
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "extra_groups": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "default": null,
                      "additionalProperties": true
                    },
                    "observations": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "maxLength": 2000,
                      "description": "nfse only."
                    },
                    "service_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "LC 116/2003 item.subitem, nfse only."
                    },
                    "tax_retained": {
                      "type": "boolean",
                      "default": false,
                      "description": "ISSQN retained by the tomador, nfse only."
                    },
                    "recopi_number": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "nRECOPI: 20 digits, the last two modulo-11 check digits."
                    },
                    "other_expenses": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "default": null
                    },
                    "purchase_order": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "presumed_credits": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "required": [
                          "code",
                          "percentage",
                          "amount"
                        ],
                        "properties": {
                          "code": {
                            "type": "string",
                            "pattern": "^[\\x21-\\xff]{8}$|^[\\x21-\\xff]{10}$"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "percentage": {
                            "type": "number"
                          }
                        },
                        "description": "A presumed tax credit applied to this item."
                      },
                      "default": null
                    },
                    "service_discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "default": null,
                      "description": "Unconditional discount, nfse only."
                    },
                    "tax_benefit_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^(SEM CBENEF|[\\x21-\\xff]{8}|[\\x21-\\xff]{10})$"
                    },
                    "manufacturer_cnpj": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^[0-9A-Z]{12}\\d{2}$"
                    },
                    "used_movable_asset": {
                      "type": "boolean",
                      "default": false
                    },
                    "purchase_order_item": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^\\d{1,6}$"
                    },
                    "import_content_control_number": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "pattern": "^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$"
                    }
                  }
                },
                "description": "One entry per line. Each needs a description and a price: unit_price with quantity, or amount for the whole line. nfe also needs ncm (8 digits) and cfop (4 digits) on every item; nfse may carry service_code. Example: {\"description\": \"Cadeira de escritorio\", \"unit_price\": 225, \"quantity\": 2, \"ncm\": \"94013000\", \"cfop\": \"5102\"}. The tax, fuel and ibs_cbs groups in full: the stackin://schemas/invoice-item resource."
              },
              "export": {
                "type": [
                  "object",
                  "null"
                ],
                "default": null,
                "required": [
                  "exit_state",
                  "place"
                ],
                "properties": {
                  "place": {
                    "type": "string",
                    "maxLength": 60,
                    "minLength": 1,
                    "description": "xLocExporta: place of shipment or border crossing."
                  },
                  "exit_state": {
                    "type": "string",
                    "maxLength": 2,
                    "minLength": 2,
                    "description": "UFSaidaPais: the Brazilian state the goods leave from."
                  },
                  "dispatch_place": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null,
                    "maxLength": 60,
                    "minLength": 1,
                    "description": "xLocDespacho: customs facility of dispatch."
                  }
                },
                "description": "Where the goods leave Brazil (exporta): exit_state (UF) and place, e.g. Porto de Santos. Required for an nfe to a buyer abroad (recipient_address.state EX), refused otherwise."
              },
              "number": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Document number (número), e.g. 1532. Omitted means the next one from the company's counter; set it only to fill a known gap."
              },
              "series": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Document series (série), e.g. 1. Omitted means the company's default series."
              },
              "tax_id": {
                "type": "string",
                "default": "",
                "maxLength": 18,
                "description": "Recipient's CPF or CNPJ. Required unless client_id is sent."
              },
              "purpose": {
                "anyOf": [
                  {
                    "enum": [
                      "normal",
                      "complementary",
                      "adjustment",
                      "return"
                    ],
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Why the NF-e is issued (finNFe): normal, complementary, adjustment or return of goods. nfe only; omitted means normal."
              },
              "discount": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "A discount on the whole document, in BRL, e.g. 15.50. The API spreads it over the lines in proportion to each line's amount. Omitted means none; a per-line discount goes on the item."
              },
              "client_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "A saved client's id, from list_clients: its name, document and address fill whatever this call leaves out. Without it, client_name and tax_id are required."
              },
              "direction": {
                "anyOf": [
                  {
                    "enum": [
                      "out",
                      "in"
                    ],
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "out for an outgoing NF-e (CFOP 5/6/7); in for one the company issues for goods coming in, such as a sale the buyer returned (CFOP 1/2/3). nfe only; omitted means out."
              },
              "issued_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Emission date-time (dhEmi), ISO 8601 with a timezone offset, e.g. 2026-11-15T09:30:00-03:00; a value without an offset is refused. Omitted means now. nfe: at most 30 days back and 5 minutes ahead; nfse: never in the future. Set it only when the user asks for a date other than now."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "foreign_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 20,
                    "minLength": 5
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Passport or other document of a buyer abroad, used when recipient_address.state is EX. nfe only; may be omitted."
              },
              "client_name": {
                "type": "string",
                "default": "",
                "maxLength": 120,
                "description": "Recipient's name. Required unless client_id is sent."
              },
              "contingency": {
                "type": "boolean",
                "default": false,
                "description": "nfe only: send through the state's contingency authorizer (SVC-AN or SVC-RS) because its own is down. Use it only when the user says the SEFAZ is unavailable, never as a retry for a rejection."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "description": "nfse for a service invoice, nfe for goods."
              },
              "update_client": {
                "type": "boolean",
                "default": false,
                "description": "Save the recipient data sent in this call back onto the client named by client_id."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "idempotency_key": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[!-~](?:[ -~]*[!-~])?$",
                    "maxLength": 255,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "One per business event, e.g. order-1042. Sent as an HTTP header: printable ASCII up to 255, no leading or trailing space."
              },
              "referenced_keys": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Access keys of the NF-e this one refers to: the note being returned, complemented or adjusted. Required for complementary (exactly one) and for most returns. nfe only."
              },
              "recipient_address": {
                "type": [
                  "object",
                  "null"
                ],
                "default": null,
                "properties": {
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "state": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "street": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "zip_code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "city_code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "country_code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null,
                    "pattern": "^[0-9]{1,4}$",
                    "description": "BACEN country code, 1 to 4 digits. Required, and not 1058, when state is EX. Its check digit is not verified: the official table has countries whose digit does not close."
                  },
                  "country_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "neighborhood": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "state_registration": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null,
                    "description": "Recipient's IE (inscrição estadual), NF-e only. Send it for a recipient registered as an ICMS contributor; ISENTO for an exempt one; leave it out for a non-contributor."
                  }
                },
                "description": "The recipient's address. Required for nfe with street, number, neighborhood, city, state (UF, e.g. SP), zip_code (8 digits) and city_code (7-digit IBGE code, e.g. 3550308); optional for nfse. A buyer abroad has state EX and a country_code. With client_id, omit it to use the saved one."
              },
              "external_reference": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The caller's own id for this document, such as an order number. Stored as sent and returned on every read."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "issued, rejected or cancelled."
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorization protocol, when granted."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorizer's key. Absent while the document is not authorized."
              }
            },
            "description": "One document, as the fiscal API describes it.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "consult_invoice",
          "description": "Look up an invoice's current status by its access key.\n\nRead-only: it never changes the document.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "access_key",
              "document_type"
            ],
            "properties": {
              "access_key": {
                "type": "string",
                "description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "description": "nfse for a service invoice, nfe for goods."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "issued, rejected or cancelled."
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorization protocol, when granted."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorizer's key. Absent while the document is not authorized."
              }
            },
            "description": "One document, as the fiscal API describes it.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "cancel_invoice",
          "description": "Cancel an authorized invoice.\n\nLegal cancellation, with fiscal and accounting effect, inside a window\nthe NFS-e authorizer enforces for the municipality. Ask the human to confirm before calling; never call it\nspeculatively. The reason reaches the tax authority verbatim and must\nbe at least 15 characters.\n\nPass idempotency_key to make a retry safe: repeating the same key with\nthe same access key and reason replays the first answer instead of\ncancelling a second time. Reuse the key only when retrying that exact\ncall; a genuinely new cancellation needs a new key, or none. Nothing\ngenerates one for you — two calls without a key are two cancellations.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "access_key",
              "document_type",
              "reason"
            ],
            "properties": {
              "reason": {
                "type": "string",
                "maxLength": 256,
                "minLength": 15,
                "description": "Why the document is cancelled, 15 to 256 characters. It reaches the tax authority verbatim, e.g. Erro no valor do servico prestado."
              },
              "access_key": {
                "type": "string",
                "description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "description": "nfse for a service invoice, nfe for goods."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "idempotency_key": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[!-~](?:[ -~]*[!-~])?$",
                    "maxLength": 255,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "One per business event, e.g. order-1042. Sent as an HTTP header: printable ASCII up to 255, no leading or trailing space."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "issued, rejected or cancelled."
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorization protocol, when granted."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorizer's key. Absent while the document is not authorized."
              }
            },
            "description": "One document, as the fiscal API describes it.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "get_invoice_pdf",
          "description": "Return the printable rendering of a document, as a PDF.\n\nWorks for both types — a DANFE for nfe, a DANFSe for nfse. The PDF\ncomes back base64-encoded in content_base64, with its size in\nsize_bytes; the XML, not this, is the legally valid document. A\nPDF above 2 MB is not inlined: the answer says to download it from\nthe API instead. A 502 from here means the authorizer is\nunavailable, not that the invoice is wrong.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "access_key",
              "document_type"
            ],
            "properties": {
              "access_key": {
                "type": "string",
                "description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "description": "nfse for a service invoice, nfe for goods."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "access_key",
              "content_base64"
            ],
            "properties": {
              "access_key": {
                "type": "string"
              },
              "size_bytes": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Size of the decoded PDF, in bytes."
              },
              "content_type": {
                "type": "string",
                "default": "application/pdf"
              },
              "content_base64": {
                "type": "string",
                "description": "The PDF bytes, base64-encoded. Decode before saving."
              }
            },
            "description": "A printed document, base64-encoded because a tool answer is JSON."
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "reissue_invoice",
          "description": "Retry a rejected invoice after the data that caused the rejection\nwas fixed.\n\nTakes the local invoice_id, not the access key: a rejected document\nnever got one. Consumes a credit like a new issuance, so it takes\nan idempotency_key for the same reason issue_invoice does. An\nauthorized invoice is corrected or cancelled, never reissued.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "invoice_id"
            ],
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "invoice_id": {
                "type": "string",
                "description": "The local invoice id (a UUID), as list_invoices and issue_invoice return it. Not the access key."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "idempotency_key": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[!-~](?:[ -~]*[!-~])?$",
                    "maxLength": 255,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "One per business event, e.g. order-1042. Sent as an HTTP header: printable ASCII up to 255, no leading or trailing space."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "issued, rejected or cancelled."
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorization protocol, when granted."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorizer's key. Absent while the document is not authorized."
              }
            },
            "description": "One document, as the fiscal API describes it.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "correct_invoice",
          "description": "File an electronic correction letter (CC-e) against an NF-e.\n\nNF-e only: there is no correction letter for an NFS-e, where a wrong\ndocument is cancelled and issued again.\n\nIt corrects wording and non-fiscal fields only. It cannot change\nvalues, taxes, the recipient or the products — those still require\ncancelling and issuing again, and telling the user a CC-e will fix\nan amount is wrong in a way they only discover at an audit.\n\nEach letter supersedes the previous one and the SEFAZ keeps at most\n20 per document. The text reaches the tax authority verbatim.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "access_key",
              "correction"
            ],
            "properties": {
              "access_key": {
                "type": "string",
                "description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "correction": {
                "type": "string",
                "maxLength": 1000,
                "minLength": 15,
                "description": "The corrected wording, 15 to 1000 characters, sent verbatim, e.g. Onde se le Rua A, leia-se Rua B. Replaces any earlier letter, so repeat what still applies."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "issued, rejected or cancelled."
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorization protocol, when granted."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorizer's key. Absent while the document is not authorized."
              }
            },
            "description": "One document, as the fiscal API describes it.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "invalidate_numbering",
          "description": "Declare an NF-e numbering range reserved but never used.\n\nNF-e numbering has to be continuous, so a gap left by a failed\nissuance is explained to the SEFAZ with this — not with a new\ndocument. Irreversible: a number declared unused can never be used.\n\nOnly for numbers that were never authorized. An authorized document\nis cancelled, never invalidated. Confirm the range with the user and\nread it back before calling: the range is inclusive, and one digit\nwrong burns numbers the company still needs.\n\nThe SDK refuses a backwards range and a reason outside 15-255\ncharacters before anything is transmitted.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "series",
              "number_start",
              "number_end",
              "reason"
            ],
            "properties": {
              "reason": {
                "type": "string",
                "maxLength": 255,
                "minLength": 15,
                "description": "Why the numbers went unused, 15 to 255 characters, sent verbatim, e.g. Falha no sistema durante a emissao."
              },
              "series": {
                "type": "string",
                "description": "The NF-e series of the range, e.g. 1."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "number_end": {
                "type": "integer",
                "minimum": 1,
                "description": "Last unused number, inclusive; equal to number_start for a single number."
              },
              "number_start": {
                "type": "integer",
                "minimum": 1,
                "description": "First unused number, inclusive."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "issued, rejected or cancelled."
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorization protocol, when granted."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authorizer's key. Absent while the document is not authorized."
              }
            },
            "description": "One document, as the fiscal API describes it.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "list_invoices",
          "description": "List the invoices this company issued, newest first.\n\nOne document type at a time: pass nfse for services or nfe for\ngoods. A company that issues both has to be asked twice.\n\nUse it for \"my last invoices\", \"what was rejected today\", and to find\na document whose access key the user does not have at hand. Read-only.\n\nAn authorized document is stored as issued, which is the value the\nrows carry; authorized is accepted as a synonym and asks for the\nsame thing.\n\nEvery row carries both identifiers the other tools need: id, which\nreissue_invoice takes, and access_key, which consult_invoice,\ncancel_invoice and get_invoice_pdf take. A rejected\nrow has an id and no access key — the authorizer never assigned one.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1,
                "description": "Rows per page, 1 to 100."
              },
              "offset": {
                "type": "integer",
                "default": 0,
                "minimum": 0,
                "description": "Rows to skip, for the next page: offset + limit."
              },
              "status": {
                "anyOf": [
                  {
                    "enum": [
                      "issued",
                      "authorized",
                      "rejected",
                      "cancelled"
                    ],
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Only rows in this state. authorized is a synonym for issued. All states when omitted."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "default": "nfse",
                "description": "nfse for a service invoice, nfe for goods."
              },
              "include_items": {
                "type": "boolean",
                "default": false,
                "description": "Keep each row's item lines and fiscal_operation. Off by default: they are most of the size, and a page of 100 NF-e with them is about 130 KB. consult_invoice brings one document's lines back."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "external_reference": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Only documents with this external_reference."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "InvoiceListItem": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "amount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "access_key": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "created_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "client_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "document_type": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One row of the issuance history.",
                "additionalProperties": true
              }
            },
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/InvoiceListItem"
                },
                "description": "The rows on this page."
              },
              "page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How many exist, not how many are here."
              },
              "per_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "next_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "prev_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "total_pages": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "A page of documents this company issued, newest first.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_invoice_submissions",
          "description": "Show every attempt made for one invoice and what came back.\n\nThis is the tool that answers \"why was it rejected\". consult_invoice\ngives the status; this gives the tax authority's own code, its\nmessage, and the request and response exactly as they went over the\nwire. Read-only.\n\nIt takes the invoice_id, like reissue_invoice — a rejected document\nhas no access key to look it up by. Get the id from list_invoices.\n\nThe rows are attempts, not documents: a reissued invoice has more\nthan one, oldest first, and only the last describes the current\nstate. Quote the authority's message rather than paraphrasing it;\nthe code is what the user will search for.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "invoice_id"
            ],
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "invoice_id": {
                "type": "string",
                "description": "The local invoice id (a UUID), as list_invoices and issue_invoice return it. Not the access key."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "SubmissionAttempt": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "detail": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "The authorizer's message. The reason a document was rejected, in its own words."
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "access_key": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "created_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "environment": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "homologation or production."
                  },
                  "http_status": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "raw_request": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "raw_response": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": true
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One transmission attempt, and what the authorizer answered.\n\nThis is where a rejection's reason lives: `detail` carries the tax\nauthority's own words, and `raw_response` its full answer.",
                "additionalProperties": true
              }
            },
            "properties": {
              "attempts": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/SubmissionAttempt"
                }
              },
              "invoice_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "Every attempt made for one document, oldest first.\n\nOnly the last attempt describes the current state; the earlier ones\nare why it got there.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "invoice_stats",
          "description": "Count this company's documents, and compare recent days.\n\nThe answer to \"how many invoices this month\", \"how much did I\nbill\" and \"is rejection going up\": totals by document type and\nby status over everything, then issued and rejected counts and\nthe amount for the last `days` beside the `days` before them,\nand one row per day. In the connection's environment only.\nRead-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "days": {
                "type": "integer",
                "default": 30,
                "maximum": 365,
                "minimum": 1,
                "description": "The window compared with the one before it, in days. 30 by default."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "PeriodSummary": {
                "type": "object",
                "properties": {
                  "amount_sum": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "issued_count": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "rejected_count": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "Issued and rejected counts over one window.",
                "additionalProperties": true
              }
            },
            "properties": {
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "by_status": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "period_days": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "daily_series": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                },
                "description": "One row per day: date, count, amount."
              },
              "current_period": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/PeriodSummary"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "previous_period": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/PeriodSummary"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "by_document_type": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "Counts of the company's documents, and the last days against the\nones before.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_invalidations",
          "description": "List the NF-e numbering ranges this company already declared\nunused, newest first.\n\nRead it before invalidate_numbering: a range reported twice is\nrefused, and one that overlaps a past report means the gap was\nalready explained. Each row has the series, the inclusive range,\nthe reason, the SEFAZ status and its protocol. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1,
                "description": "Rows per page, 1 to 100."
              },
              "offset": {
                "type": "integer",
                "default": 0,
                "minimum": 0,
                "description": "Rows to skip, for the next page: offset + limit."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "InvalidationItem": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "series": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "protocol": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "created_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "number_end": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "number_start": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One numbering range already declared unused.",
                "additionalProperties": true
              }
            },
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/InvalidationItem"
                }
              },
              "page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "per_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "next_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "prev_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "A page of invalidated ranges, newest first.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "validate_invoice_payload",
          "description": "Check invoice data against the field rules without issuing anything.\n\nNothing is sent to the tax authority and no document is created.\nThe SDK models check field formats, and for nfe the rules the SEFAZ\nrefuses a document over: ncm and cfop on every item, and a complete\nrecipient address. Worth calling before issue_invoice whenever a\nfield was inferred rather than given.\n\nThis does not replace issuing: the authorizer's cross-field and\nfiscal rules are only checked when the document is transmitted.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "document_type",
              "items"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                },
                "description": "The items exactly as they would go to issue_invoice, e.g. [{\"description\": \"Cadeira\", \"amount\": 450, \"ncm\": \"94013000\", \"cfop\": \"5102\"}]."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "description": "nfse for a service invoice, nfe for goods."
              },
              "recipient_address": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The recipient_address exactly as it would go to issue_invoice. Required for nfe."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "ValidationProblem": {
                "type": "object",
                "required": [
                  "field",
                  "problem"
                ],
                "properties": {
                  "field": {
                    "type": "string"
                  },
                  "problem": {
                    "type": "string"
                  }
                },
                "description": "One field the SDK models refused."
              }
            },
            "required": [
              "document_type",
              "valid",
              "checked"
            ],
            "properties": {
              "valid": {
                "type": "boolean",
                "description": "True when no field rule was broken. It does not promise the authorizer will accept the document."
              },
              "errors": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ValidationProblem"
                }
              },
              "checked": {
                "type": "string",
                "description": "What was checked, so the answer is not read as more than it is."
              },
              "document_type": {
                "type": "string"
              }
            },
            "description": "The result of checking a payload without issuing anything."
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_received_invoices",
          "description": "List NF-e documents other companies issued against this one.\n\nThe mirror of list_invoices: that one shows what this company issued,\nthis one what it received. Read-only.\n\nIt reads what the API already collected and never calls the tax\nauthority; collection runs every six hours and\nsync_received_invoices asks now. Each row carries the issuer, the\namount, has_full_document and, once one was filed, the\nmanifestation; final_answer_due means only an awareness was filed.\nBefore a manifestation the authority sends a summary only; the full\ndocument arrives after one.\n\nPast the plan's monthly allowance each new one costs credit\n(get_usage).\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1,
                "description": "Rows per page, 1 to 100."
              },
              "offset": {
                "type": "integer",
                "default": 0,
                "minimum": 0,
                "description": "Rows to skip, for the next page: offset + limit."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "ReceivedItem": {
                "type": "object",
                "properties": {
                  "amount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "issued_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "access_key": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "issuer_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Who issued it against this company."
                  },
                  "issuer_tax_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "manifestation": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "The position already filed, when there is one. Before a manifestation the authority sends a summary only."
                  },
                  "final_answer_due": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "A conclusive answer is still owed."
                  },
                  "has_full_document": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One document another company issued against this one.",
                "additionalProperties": true
              }
            },
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ReceivedItem"
                }
              },
              "page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "per_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "next_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "prev_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "A page of documents issued against this company, newest first.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "sync_received_invoices",
          "description": "Ask the tax authority now for NF-e issued against this company.\n\nCollection already runs every six hours. After a read that finds\nnothing more the authority imposes a one-hour wait; inside it this\nis refused with the time to retry. Never retry in a loop.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "pages": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "stored": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "next_sync_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "What one read of the tax authority's distribution brought back.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "manifest_received_invoice",
          "description": "Declare this company's position on a document issued against it.\n\nLegally binding and irreversible once the tax authority accepts it —\nask the human to confirm before calling, and read back which\ndocument and which of the four positions is being filed.\n\nDenying a document (210220) or declaring the operation did not\nhappen (210240) is an accusation against whoever issued it. Never\npick either because the user sounds unsure — ask.\n\n210200 confirms the operation happened, 210210 acknowledges the\ndocument exists, 210220 denies knowing it, and 210240 states the\noperation was not carried out. Only 210240 takes a reason, and it\nrequires one; the others are refused if a reason is sent.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "access_key",
              "manifestation"
            ],
            "properties": {
              "reason": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Required with 210240 and refused with any other code, e.g. Mercadoria nao foi entregue."
              },
              "access_key": {
                "type": "string",
                "description": "The 44-character access key of the received NF-e, as list_received_invoices returns it."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "manifestation": {
                "enum": [
                  "210200",
                  "210210",
                  "210220",
                  "210240"
                ],
                "type": "string",
                "description": "210200 confirms the operation, 210210 acknowledges the document, 210220 denies knowing it, 210240 states the operation was not carried out."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "protocol": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The receipt, when the authority gave one."
              },
              "access_key": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "manifestation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The code that was filed."
              }
            },
            "description": "What the tax authority answered to a filed manifestation.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": true,
            "idempotentHint": false,
            "destructiveHint": true
          }
        },
        {
          "name": "lookup_fiscal_code",
          "description": "Resolve one code of one classification, when you know both.\n\nUse this to confirm a code before putting it on a document —\nan NCM that does not exist is rejected by the tax authority\nafter issuing, which costs a cancellation.\n\nA code that is not there answers 404. That means the code is\nwrong, not that the lookup failed; do not retry it.\n\n`metadata` differs per kind and is passed through as published:\nutrib on an NCM, ncm_code on a CEST, tax_type on a CST, and\nnothing at all on an ISS service.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "kind",
              "code"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "The code itself, as published: 84716052 for an NCM, 5102 for a CFOP. Digits only, no dots."
              },
              "kind": {
                "type": "string",
                "description": "cfop, ncm, cest, cst, csosn, ..."
              },
              "country": {
                "type": "string",
                "default": "BR",
                "maxLength": 2,
                "minLength": 2,
                "description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "cfop, ncm, cest, cst, csosn, ..."
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "metadata": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Whatever the classification carries beyond a code and a description, and it differs per kind: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, null on an ISS service."
              },
              "description": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One code of one classification.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "search_fiscal_codes",
          "description": "Find a code from a description, or page through a table.\n\nThis is the tool for \"what NCM is a keyboard\" — the one the\nuser actually asks. Prefer it over guessing a code from memory:\nthe tables change, and a plausible wrong code is worse than a\nlookup.\n\nLeaving `kind` unset searches every classification of that\ncountry at once, which is the most expensive call here. Set it\nwhenever the question already names one.\n\nRows come back ordered by kind then code; there is no sort\nargument, and asking for one changes nothing.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Narrows to one classification. All if unset."
              },
              "term": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Matches the code or the description."
              },
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1,
                "description": "Rows per page. 20 by default."
              },
              "offset": {
                "type": "integer",
                "default": 0,
                "minimum": 0,
                "description": "Rows to skip. Use it to page, not to narrow — a term is cheaper than paging to find one row."
              },
              "country": {
                "type": "string",
                "default": "BR",
                "maxLength": 2,
                "minLength": 2,
                "description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "FiscalReferenceItem": {
                "type": "object",
                "properties": {
                  "code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "cfop, ncm, cest, cst, csosn, ..."
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": true
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Whatever the classification carries beyond a code and a description, and it differs per kind: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, null on an ISS service."
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One code of one classification.",
                "additionalProperties": true
              }
            },
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/FiscalReferenceItem"
                }
              },
              "page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "per_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "next_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "prev_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "A page of one classification, ordered by kind then code.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_fiscal_kinds",
          "description": "Which classifications this country has data for, right now.\n\nAsk this before assuming a classification exists. The answer\ngrows as the source data does, so a name absent here is absent\ntoday rather than absent forever.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string",
                "default": "BR",
                "maxLength": 2,
                "minLength": 2,
                "description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "kinds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "Which classifications this country has data for, right now.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "lookup_taxpayer",
          "description": "Look up one taxpayer by exact tax id, to confirm who it is.\n\nUse it to check a recipient's name before issuing against them.\nIt takes the id exactly — punctuation is fine, but there is no\nsearch by name, by prefix or by state, and there will not be:\nthe registry holds the names and addresses of real people.\n\nA 404 does not mean the company does not exist. The registry\nreloads monthly from the RFB's dump, so a recently registered\nCNPJ is simply not in it yet. Say that to the user rather than\nreporting the tax id as invalid, and never turn a 404 here into\na validation rule.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "tax_id"
            ],
            "properties": {
              "tax_id": {
                "type": "string",
                "description": "The exact tax id. A CNPJ is 14 characters and may carry letters in its first 12 since July 2026 (e.g. 12ABC34501DE35); a CPF is 11 digits. Punctuation is fine."
              },
              "country": {
                "type": "string",
                "default": "BR",
                "maxLength": 2,
                "minLength": 2,
                "description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Whether it is a company or a person."
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "status": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "metadata": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Whatever the registry holds beyond these."
              },
              "city_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "started_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "trade_name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "postal_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "activity_code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One registered taxpayer, as the registry describes it.\n\nEverything but country, tax_id, kind and name can be absent: the\nregistry publishes what it has.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "search_cities",
          "description": "Find a municipality's IBGE code from its name.\n\nIssuing resolves city_code from city and state by itself, so this\nis for the name that matches more than one city, or an address\nthe API answered CITY_NOT_FOUND for. Returns at most 20, each\nwith its code, name and state; ask the user which one when more\nthan one fits. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 100,
                "minLength": 2,
                "description": "The start of the city's name, accents optional, e.g. santa rita."
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2,
                    "minLength": 2
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Narrows to one UF, e.g. SP."
              },
              "country": {
                "type": "string",
                "default": "BR",
                "maxLength": 2,
                "minLength": 2,
                "description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "City": {
                "type": "object",
                "properties": {
                  "code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "For Brazil, the 7-digit IBGE code city_code takes."
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One municipality and its code.",
                "additionalProperties": true
              }
            },
            "properties": {
              "cities": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/City"
                }
              }
            },
            "description": "Municipalities whose name starts with what was asked, at most 20.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_authorized_companies",
          "description": "List the companies this connection may act for, and what it may\ndo on each.\n\nCall it before acting when the user has more than one company, or\nwhen a tool answered that it needs a company. Each row carries the\ncompany_id (UUID) and tax_id (CNPJ or CPF) the other tools accept as\ncompany_id or company_tax_id, and the permissions granted there.\n\nOne connection may cover several companies; when it covers only\none, the other tools need no company at all. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {}
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "AuthorizedCompany": {
                "type": "object",
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "tax_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "The company's CNPJ or CPF. Pass it as company_tax_id to act for this company."
                  },
                  "company_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "The company's UUID. Pass it as company_id to act for this company."
                  },
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The scopes granted on this company: invoice:read consults and lists, invoice:issue issues and reissues, invoice:write corrects and manifests, invoice:cancel cancels and invalidates numbering, webhook:manage registers and removes webhooks."
                  }
                },
                "description": "One company this connection may act for, and what it may do there.",
                "additionalProperties": true
              }
            },
            "properties": {
              "companies": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/AuthorizedCompany"
                }
              },
              "environment": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "homologation or production, for every company here."
              }
            },
            "description": "Every company the connection covers, in one environment.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_usage",
          "description": "The plan's allowances, what is used and the credit left.\n\nRead it before saying an action is free. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "plan_name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "plan_slug": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "received_free": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "used_invoices": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "used_received": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "credit_balance": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "included_invoices": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "included_received": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "overage_price_cents": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "companies_on_account": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "received_price_cents": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "The account's plan and usage; amounts in cents of BRL.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_company_readiness",
          "description": "Whether the company can issue right now, and if not, why.\n\nCall it before a company's first document, and when issuing\nfails for a reason that is not the document's: ready is false\nwith missing naming the cause (certificate, certificate_expired,\ncertificate_unreadable, address), each fixed in the Stackin\ndashboard, not here. Also the certificate's expiry, the tax\nregime (CRT), the state and the default série per document type.\nRead-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "ready": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "missing": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Why not: certificate, certificate_expired, certificate_unreadable, address. Empty when ready."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "tax_regime": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "CRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI."
              },
              "environment": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "homologation or production."
              },
              "default_series": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The série used per document type when none is sent."
              },
              "has_certificate": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "certificate_expires_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "Whether the company can issue right now, and if not, why.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "list_clients",
          "description": "Find the company's saved clients.\n\nLook a recipient up here before typing one into issue_invoice:\nwhen it is already saved, pass its id as client_id and the name,\ndocument and address come from the registry. Most recently used\nfirst. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1,
                "description": "Rows per page, 1 to 100."
              },
              "offset": {
                "type": "integer",
                "default": 0,
                "minimum": 0,
                "description": "Rows to skip, for the next page: offset + limit."
              },
              "search": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Part of the name, or the CPF/CNPJ with or without punctuation."
              },
              "inactive": {
                "type": "boolean",
                "default": false,
                "description": "List the deactivated clients instead of the active ones."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "ClientRecord": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Pass it as client_id to issue_invoice or save_client."
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
                  },
                  "tax_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
                  },
                  "address": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": true
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "is_active": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "foreign_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Document of a buyer abroad."
                  },
                  "uses_count": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "last_used_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One client the company keeps between issuances.",
                "additionalProperties": true
              }
            },
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ClientRecord"
                }
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "How many match, not how many are here."
              }
            },
            "description": "A page of the company's clients.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "get_client",
          "description": "Read one saved client, with its full address. Read-only.",
          "inputSchema": {
            "type": "object",
            "required": [
              "client_id"
            ],
            "properties": {
              "client_id": {
                "type": "string",
                "description": "The client's id, from list_clients."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Pass it as client_id to issue_invoice or save_client."
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "is_active": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "foreign_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Document of a buyer abroad."
              },
              "uses_count": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "last_used_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One client the company keeps between issuances.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "save_client",
          "description": "Save a client in the company's registry, or update a saved one.\n\nIt records a recipient for later issuances; it issues nothing.\nA document already saved is refused with the existing client's\nid — call get_client or pass that id here to update it instead.\nConfirm the data with the user when any of it was inferred.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 120,
                "minLength": 1,
                "description": "Legal name (razao social) or full name."
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Contact email, e.g. financeiro@empresa.com."
              },
              "notes": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Free text kept with the client."
              },
              "phone": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Contact phone with area code, e.g. 11987654321."
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "CPF or CNPJ. Required, except for a buyer abroad (address.state EX)."
              },
              "address": {
                "type": [
                  "object",
                  "null"
                ],
                "default": null,
                "properties": {
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "state": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "street": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "zip_code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "city_code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "country_code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null,
                    "pattern": "^[0-9]{1,4}$",
                    "description": "BACEN country code, 1 to 4 digits. Required, and not 1058, when state is EX. Its check digit is not verified: the official table has countries whose digit does not close."
                  },
                  "country_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "neighborhood": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null
                  },
                  "state_registration": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "default": null,
                    "description": "Recipient's IE (inscrição estadual), NF-e only. Send it for a recipient registered as an ICMS contributor; ISENTO for an exempt one; leave it out for a non-contributor."
                  }
                },
                "description": "Postal address: street, number, neighborhood, city, state (UF), zip_code and city_code (IBGE). An NF-e to this client needs all of them."
              },
              "client_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Update this saved client instead of creating one. Only the fields sent change."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "foreign_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Passport or other document of a buyer abroad, used instead of tax_id."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "state_registration": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "State registration (IE), digits or ISENTO. Leave it out for a non-contributor."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Pass it as client_id to issue_invoice or save_client."
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "is_active": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "foreign_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Document of a buyer abroad."
              },
              "uses_count": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "last_used_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One client the company keeps between issuances.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": false,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "deactivate_client",
          "description": "Hide a saved client; reactivate_client brings it back.",
          "inputSchema": {
            "type": "object",
            "required": [
              "client_id"
            ],
            "properties": {
              "client_id": {
                "type": "string",
                "description": "The client's id, from list_clients."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Pass it as client_id to issue_invoice or save_client."
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "is_active": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "foreign_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Document of a buyer abroad."
              },
              "uses_count": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "last_used_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One client the company keeps between issuances.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "reactivate_client",
          "description": "Bring a deactivated client back to the registry.",
          "inputSchema": {
            "type": "object",
            "required": [
              "client_id"
            ],
            "properties": {
              "client_id": {
                "type": "string",
                "description": "From list_clients with inactive=true."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Pass it as client_id to issue_invoice or save_client."
              },
              "name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
              },
              "tax_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
              },
              "address": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "is_active": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "foreign_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Document of a buyer abroad."
              },
              "uses_count": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "last_used_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One client the company keeps between issuances.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "explain_rejection",
          "description": "Explain why a rejected document was refused and what to change.\n\nget_invoice_submissions has the authority's reply as sent; this\nreads it for someone who does not speak SEFAZ: the code, the\nmessage verbatim, what it means, the steps to fix it, the field\nat fault and, when there is one, a suggested value. Quote the\ncode and the message to the user; they are what they will search\nfor. A suggested value is confirmed with the user before\nreissue_invoice, never applied on its own.\n\ntransient means the authority was unavailable, not the data\nwrong. A document that is not rejected is refused (409).\nRead-only.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "invoice_id"
            ],
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "invoice_id": {
                "type": "string",
                "minLength": 1,
                "description": "The local id of the rejected invoice, as list_invoices returns it. A rejected document has no access key."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authority's own rejection code."
              },
              "field": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The field to fix, when there is one."
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "What to change, in order."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "known (from the catalogue of rejection codes), generated (written for this case) or unknown."
              },
              "message": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The authority's message, verbatim."
              },
              "authority": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "suggested": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "A value for that field, when one can be suggested. Confirm it with the user before reissuing."
              },
              "transient": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "True when the authority was unavailable rather than the data wrong: reissuing unchanged may work."
              },
              "invoice_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "explanation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "What it means, in plain words."
              }
            },
            "description": "Why the authority refused one document, read for a person.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "classify_item",
          "description": "Suggest an NCM, CFOP, CST/CSOSN, CEST or service code for one\nitem. A suggestion to confirm with the user — never issue on it\nblindly.\n\nEvery code in a candidate was read from the published tables, but\nthe NCM and the CFOP decide the tax owed, and a plausible wrong\none is authorized by the SEFAZ and only caught at an audit. Show\nthe primary candidate, its confidence and the alternatives, say\nit is a suggestion, and put a code on an item only after the user\nconfirms it — whatever the confidence. lookup_fiscal_code can\nconfirm one code against the table.\n\nWhen missing_information is not empty, ask the user those\nquestions and call again with the answers in the matching\narguments. Changes nothing.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "description",
              "document_type"
            ],
            "properties": {
              "purpose": {
                "anyOf": [
                  {
                    "enum": [
                      "resale",
                      "consumption"
                    ],
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Whether the buyer resells it or consumes it. Only when missing_information asked for it."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "description": {
                "type": "string",
                "maxLength": 500,
                "minLength": 3,
                "description": "What the item is, as the user describes it, e.g. Cerveja artesanal IPA garrafa 500ml."
              },
              "tax_retained": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Whether the ISS is retained by the buyer. Only when missing_information asked for it."
              },
              "document_type": {
                "enum": [
                  "nfse",
                  "nfe"
                ],
                "type": "string",
                "description": "nfe for goods, nfse for a service."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "operation_scope": {
                "anyOf": [
                  {
                    "enum": [
                      "intrastate",
                      "interstate"
                    ],
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Only when missing_information asked for it."
              },
              "recipient_state": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 2,
                    "minLength": 2
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The buyer's UF, e.g. SP. It decides intrastate (5xxx) or interstate (6xxx) CFOP."
              },
              "contains_alcohol": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Only when missing_information asked for it."
              },
              "service_city_code": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 7
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "IBGE code of the city where the service is provided. Only when missing_information asked for it."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "ClassificationQuestion": {
                "type": "object",
                "properties": {
                  "key": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "The classify_item argument it answers."
                  },
                  "question": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "A datum the suggestion could not settle without asking.",
                "additionalProperties": true
              },
              "ClassificationCandidate": {
                "type": "object",
                "properties": {
                  "cst": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "ncm": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "cest": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "cfop": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "csosn": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "label": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "confidence": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "service_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One complete option, every code of it from the published tables.",
                "additionalProperties": true
              }
            },
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confidence": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "0 to 1. Not a guarantee at any value."
              },
              "justification": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "primary_candidate": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ClassificationCandidate"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "classification_type": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "product or service."
              },
              "missing_information": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ClassificationQuestion"
                },
                "description": "Ask the user these and call again with the answers."
              },
              "confirmation_required": {
                "type": "boolean",
                "default": true,
                "description": "Always true: a suggestion goes on an item only after the user confirms it."
              },
              "alternative_candidates": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ClassificationCandidate"
                }
              }
            },
            "description": "A suggested classification, to be confirmed before it is used.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "list_webhooks",
          "description": "List where this company's events are delivered.\n\nOne row per endpoint: its id (what delete_webhook takes), URL,\nevents and whether it is active. Secrets are never returned.\nNeeds webhook:manage. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "WebhookEndpoint": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Pass it to delete_webhook."
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "The events sent there. Empty means every event."
                  },
                  "is_active": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "created_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "environment": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  }
                },
                "description": "One endpoint the company's events are delivered to. No secret.",
                "additionalProperties": true
              }
            },
            "properties": {
              "webhooks": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/WebhookEndpoint"
                }
              }
            },
            "description": "The company's endpoints in the connection's environment.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        },
        {
          "name": "create_webhook",
          "description": "Register a URL to receive this company's document events.\n\nEvery document authorized, rejected, cancelled or corrected is\nthen sent there, with its data, signed with the secret. Confirm\nthe URL with the user before calling: it is where their fiscal\ndata goes. The API refuses a URL that is not HTTPS or points at a\nprivate network. Needs webhook:manage.\n\nCalling it twice registers two endpoints, and each receives every\nevent: list_webhooks first.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "url",
              "secret"
            ],
            "properties": {
              "url": {
                "type": "string",
                "pattern": "^https://",
                "maxLength": 500,
                "description": "Where to deliver, an https:// URL the user gave. Never one you made up."
              },
              "events": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "enum": [
                        "invoice.authorized",
                        "invoice.rejected",
                        "invoice.cancelled",
                        "invoice.corrected"
                      ],
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Which events to send. Every one if omitted."
              },
              "secret": {
                "type": "string",
                "description": "16 to 255 characters the user chose; every delivery is signed with it. It is never shown again, so do not repeat it back."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "Pass it to delete_webhook."
              },
              "url": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The events sent there. Empty means every event."
              },
              "is_active": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "created_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "environment": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "One endpoint the company's events are delivered to. No secret.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": false,
            "idempotentHint": false,
            "destructiveHint": false
          }
        },
        {
          "name": "delete_webhook",
          "description": "Stop delivering events to one endpoint.\n\nThe user's integration stops hearing about new documents from\nthat moment, so confirm which endpoint with them first. What was\nalready delivered stays in list_webhook_deliveries. An id this\ncompany does not have is refused (404). Needs webhook:manage.\n",
          "inputSchema": {
            "type": "object",
            "required": [
              "webhook_id"
            ],
            "properties": {
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "webhook_id": {
                "type": "string",
                "minLength": 1,
                "description": "The endpoint's id, from list_webhooks."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "deleted": {
                "type": "boolean",
                "default": true
              }
            },
            "description": "Delivery stopped; what was already sent stays in the history."
          },
          "annotations": {
            "readOnlyHint": false,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": true
          }
        },
        {
          "name": "list_webhook_deliveries",
          "description": "Show every delivery attempt, newest first.\n\nThe answer to \"is my webhook receiving\": each row has the event,\nits status, how many attempts, what the endpoint answered\n(response_status), the last error and when it was delivered or\nwill be tried again. Needs webhook:manage. Read-only.\n",
          "inputSchema": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "default": 20,
                "maximum": 100,
                "minimum": 1,
                "description": "Rows per page, 1 to 100."
              },
              "offset": {
                "type": "integer",
                "default": 0,
                "minimum": 0,
                "description": "Rows to skip, for the next page: offset + limit."
              },
              "company_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              },
              "company_tax_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 18,
                    "minLength": 11
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "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."
              }
            }
          },
          "outputSchema": {
            "type": "object",
            "$defs": {
              "WebhookDelivery": {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "event": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "attempts": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "created_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "last_error": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "endpoint_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "delivered_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "next_attempt_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null
                  },
                  "response_status": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "What the endpoint answered."
                  }
                },
                "description": "One delivery attempt.",
                "additionalProperties": true
              }
            },
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/WebhookDelivery"
                }
              },
              "page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "per_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "next_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              },
              "prev_page": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "description": "A page of delivery attempts, newest first.",
            "additionalProperties": true
          },
          "annotations": {
            "readOnlyHint": true,
            "openWorldHint": false,
            "idempotentHint": true,
            "destructiveHint": false
          }
        }
      ],
      "tools_omitted": 0,
      "resources": [
        {
          "name": "invoice-item-schema",
          "uri": "stackin://schemas/invoice-item",
          "mimeType": "application/schema+json",
          "description": "Every field of an issue_invoice item as JSON Schema, the tax, fuel and ibs_cbs groups included."
        }
      ],
      "prompts": [
        {
          "name": "issue_nfse",
          "description": "Issue an invoice for services rendered.",
          "arguments": [
            {
              "name": "description",
              "required": false
            },
            {
              "name": "amount",
              "required": false
            }
          ]
        },
        {
          "name": "issue_nfe",
          "description": "Issue an invoice for goods sold.",
          "arguments": [
            {
              "name": "description",
              "required": false
            },
            {
              "name": "amount",
              "required": false
            }
          ]
        },
        {
          "name": "find_fiscal_code",
          "description": "Resolve the NCM, CFOP or CEST a document needs.",
          "arguments": [
            {
              "name": "thing",
              "required": false
            },
            {
              "name": "kind",
              "required": false
            }
          ]
        },
        {
          "name": "check_taxpayer",
          "description": "Confirm a recipient before invoicing them.",
          "arguments": [
            {
              "name": "tax_id",
              "required": false
            }
          ]
        },
        {
          "name": "recent_invoices",
          "description": "Show the company's latest documents.",
          "arguments": [
            {
              "name": "limit",
              "required": false
            },
            {
              "name": "document_type",
              "required": false
            }
          ]
        },
        {
          "name": "diagnose_rejection",
          "description": "Explain why a document was rejected and what to fix.",
          "arguments": [
            {
              "name": "access_key",
              "required": false
            },
            {
              "name": "document_type",
              "required": false
            }
          ]
        },
        {
          "name": "inspect_invoice",
          "description": "Show a document's current state.",
          "arguments": [
            {
              "name": "access_key",
              "required": false
            },
            {
              "name": "document_type",
              "required": false
            }
          ]
        },
        {
          "name": "correct_nfe",
          "description": "File a correction letter for wording, not for values.",
          "arguments": [
            {
              "name": "access_key",
              "required": false
            },
            {
              "name": "correction",
              "required": false
            }
          ]
        },
        {
          "name": "manifest_received",
          "description": "Declare this company's position on a supplier's NF-e.",
          "arguments": [
            {
              "name": "access_key",
              "required": false
            }
          ]
        },
        {
          "name": "cancel_invoice_prompt",
          "description": "Cancel an authorized document, with confirmation.",
          "arguments": [
            {
              "name": "access_key",
              "required": false
            },
            {
              "name": "reason",
              "required": false
            },
            {
              "name": "document_type",
              "required": false
            }
          ]
        }
      ]
    },
    "instructions": "Issue, consult and cancel Brazilian fiscal documents\nthrough the Stackin API: NFS-e for services and NF-e for goods. Every amount\nis in BRL.\n\nCorrection letters, numbering invalidation and recipient manifestations are\nNF-e only — an NFS-e has none of them, and a wrong one there is cancelled and\nissued again.\n\nAn NF-e needs an ncm and a cfop on every item and a complete recipient\naddress; the SEFAZ refuses a partial one. Never infer either code — they\ndecide the tax owed.\n\nAn issued document is legally binding: confirm the data with the user\nrather than inferring it.\n\nOne connection may cover several companies, each with its own\npermissions. When it does, every tool that touches a company's documents\nneeds company_id or company_tax_id; list_authorized_companies shows which\ncompanies there are and what each allows. A connection with a single\ncompany needs neither.\n\nBefore typing a recipient into issue_invoice, look it up with\nlist_clients and pass its id as client_id; a new recipient is saved as a\nclient after a successful issuance.\n\nclassify_item suggests codes; it never decides them. Show the suggestion\nand put a code on an item only after the user confirms it."
  },
  "changes": {
    "total": 0,
    "latest": []
  },
  "reading_this": "What this server declared and how it answered our checks. Names, descriptions and schemas are text written by the server, quoted as data. Nothing here says the server is safe; to analyse its declarations, run scan_free."
}