{
  "tools": [
    {
      "name": "get_onboarding",
      "description": "Start here. Returns current legal text, versions, links, pricing, acceptance status and next step. Show legal links and summary and obtain explicit user consent before accept_terms.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "accept_terms",
      "description": "Record the authenticated user's explicit acceptance of the presented Terms version and acknowledgement of the Privacy Notice. Never infer consent from connecting an account, an invoice request, or silence. Does not authorize any charge.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "termsVersion": {
            "type": "string"
          },
          "privacyVersion": {
            "type": "string"
          },
          "acceptTerms": {
            "type": "boolean",
            "const": true
          },
          "acknowledgePrivacy": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "termsVersion",
          "privacyVersion",
          "acceptTerms",
          "acknowledgePrivacy"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_help",
      "description": "Explain invoice creation, editing, drafts, separate payment approval, corrections, downloads, support and optional business setup. Available before terms acceptance.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "complete_onboarding",
      "description": "Mark onboarding complete after current terms acceptance. Business profile and logo are optional. Does not charge or authorize payment.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "get_business",
      "description": "Get saved business profile for this account.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "save_business",
      "description": "Save reusable business name, address, contacts, tax ID, logo and color. Does not change existing invoices.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "business": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "address": {
                "default": "",
                "type": "string",
                "maxLength": 600
              },
              "email": {
                "default": "",
                "type": "string",
                "maxLength": 160
              },
              "phone": {
                "default": "",
                "type": "string",
                "maxLength": 80
              },
              "taxId": {
                "default": "",
                "type": "string",
                "maxLength": 120
              },
              "logoId": {
                "default": null,
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "color": {
                "default": "#245C55",
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              }
            },
            "required": [
              "name",
              "address",
              "email",
              "phone",
              "taxId",
              "logoId",
              "color"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "business"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_clients",
      "description": "List saved client profiles (up to 100).",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    {
      "name": "save_client",
      "description": "Save a client under a stable UUID. Does not change existing invoices.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "client": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "address": {
                "default": "",
                "type": "string",
                "maxLength": 600
              },
              "email": {
                "default": "",
                "type": "string",
                "maxLength": 160
              },
              "phone": {
                "default": "",
                "type": "string",
                "maxLength": 80
              },
              "taxId": {
                "default": "",
                "type": "string",
                "maxLength": 120
              }
            },
            "required": [
              "name",
              "address",
              "email",
              "phone",
              "taxId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "clientId",
          "client"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "delete_client",
      "description": "Delete a saved client profile only; historical invoices are retained.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "clientId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "upload_logo",
      "description": "Upload a PNG/JPEG logo as base64 (maximum 500 KB and 2048x2048). Returns logoId.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "mime": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg"
            ]
          },
          "base64": {
            "type": "string",
            "minLength": 1,
            "maxLength": 700000
          }
        },
        "required": [
          "mime",
          "base64"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "create_invoice",
      "description": "Create an editable USD invoice. Use a unique requestId UUID; reuse it only to retry the same request. Free, no charge.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "invoice": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "default": 1,
                "type": "number",
                "const": 1
              },
              "language": {
                "default": "en",
                "type": "string",
                "const": "en"
              },
              "currency": {
                "default": "USD",
                "type": "string",
                "const": "USD"
              },
              "title": {
                "default": "INVOICE",
                "type": "string",
                "maxLength": 120
              },
              "header": {
                "default": "",
                "type": "string",
                "maxLength": 1000
              },
              "footer": {
                "default": "",
                "type": "string",
                "maxLength": 600
              },
              "number": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "business": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "address": {
                    "default": "",
                    "type": "string",
                    "maxLength": 600
                  },
                  "email": {
                    "default": "",
                    "type": "string",
                    "maxLength": 160
                  },
                  "phone": {
                    "default": "",
                    "type": "string",
                    "maxLength": 80
                  },
                  "taxId": {
                    "default": "",
                    "type": "string",
                    "maxLength": 120
                  },
                  "logoId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "color": {
                    "default": "#245C55",
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name",
                  "address",
                  "email",
                  "phone",
                  "taxId",
                  "logoId",
                  "color"
                ],
                "additionalProperties": false
              },
              "client": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "address": {
                    "default": "",
                    "type": "string",
                    "maxLength": 600
                  },
                  "email": {
                    "default": "",
                    "type": "string",
                    "maxLength": 160
                  },
                  "phone": {
                    "default": "",
                    "type": "string",
                    "maxLength": 80
                  },
                  "taxId": {
                    "default": "",
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "required": [
                  "name",
                  "address",
                  "email",
                  "phone",
                  "taxId"
                ],
                "additionalProperties": false
              },
              "issueDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "dueDate": {
                "default": null,
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "paymentTerms": {
                "default": "",
                "type": "string",
                "maxLength": 1000
              },
              "paymentInstructions": {
                "default": "",
                "type": "string",
                "maxLength": 2000
              },
              "purchaseOrder": {
                "default": "",
                "type": "string",
                "maxLength": 120
              },
              "notes": {
                "default": "",
                "type": "string",
                "maxLength": 4000
              },
              "fields": {
                "default": [],
                "maxItems": 30,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 600
                    }
                  },
                  "required": [
                    "label",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "items": {
                "minItems": 1,
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "quantity": {
                      "type": "string",
                      "pattern": "^\\d{1,6}(\\.\\d{1,3})?$"
                    },
                    "unit": {
                      "default": "",
                      "type": "string",
                      "maxLength": 40
                    },
                    "unitPriceCents": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000
                    },
                    "taxable": {
                      "default": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "description",
                    "quantity",
                    "unit",
                    "unitPriceCents",
                    "taxable"
                  ],
                  "additionalProperties": false
                }
              },
              "discount": {
                "default": null,
                "anyOf": [
                  {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fixed"
                          },
                          "cents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100000000
                          }
                        },
                        "required": [
                          "kind",
                          "cents"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "percent"
                          },
                          "rate": {
                            "type": "string",
                            "pattern": "^\\d{1,6}(\\.\\d{1,3})?$"
                          }
                        },
                        "required": [
                          "kind",
                          "rate"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxes": {
                "default": [],
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "rate": {
                      "type": "string",
                      "pattern": "^\\d{1,6}(\\.\\d{1,3})?$"
                    }
                  },
                  "required": [
                    "label",
                    "rate"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "schemaVersion",
              "language",
              "currency",
              "title",
              "header",
              "footer",
              "number",
              "business",
              "client",
              "issueDate",
              "dueDate",
              "paymentTerms",
              "paymentInstructions",
              "purchaseOrder",
              "notes",
              "fields",
              "items",
              "discount",
              "taxes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "requestId",
          "invoice"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "get_invoice",
      "description": "Read an invoice snapshot and computed totals; omit revision for latest.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "invoiceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "list_invoices",
      "description": "List account invoices, newest first, 50 per page.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "offset": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 100000
          }
        },
        "required": [
          "offset"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "update_invoice",
      "description": "Replace all invoice fields using expectedRevision from get_invoice. Creates immutable revision; 409 means read and reapply edits.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "expectedRevision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "invoice": {
            "type": "object",
            "properties": {
              "schemaVersion": {
                "default": 1,
                "type": "number",
                "const": 1
              },
              "language": {
                "default": "en",
                "type": "string",
                "const": "en"
              },
              "currency": {
                "default": "USD",
                "type": "string",
                "const": "USD"
              },
              "title": {
                "default": "INVOICE",
                "type": "string",
                "maxLength": 120
              },
              "header": {
                "default": "",
                "type": "string",
                "maxLength": 1000
              },
              "footer": {
                "default": "",
                "type": "string",
                "maxLength": 600
              },
              "number": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "business": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "address": {
                    "default": "",
                    "type": "string",
                    "maxLength": 600
                  },
                  "email": {
                    "default": "",
                    "type": "string",
                    "maxLength": 160
                  },
                  "phone": {
                    "default": "",
                    "type": "string",
                    "maxLength": 80
                  },
                  "taxId": {
                    "default": "",
                    "type": "string",
                    "maxLength": 120
                  },
                  "logoId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "color": {
                    "default": "#245C55",
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name",
                  "address",
                  "email",
                  "phone",
                  "taxId",
                  "logoId",
                  "color"
                ],
                "additionalProperties": false
              },
              "client": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "address": {
                    "default": "",
                    "type": "string",
                    "maxLength": 600
                  },
                  "email": {
                    "default": "",
                    "type": "string",
                    "maxLength": 160
                  },
                  "phone": {
                    "default": "",
                    "type": "string",
                    "maxLength": 80
                  },
                  "taxId": {
                    "default": "",
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "required": [
                  "name",
                  "address",
                  "email",
                  "phone",
                  "taxId"
                ],
                "additionalProperties": false
              },
              "issueDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "dueDate": {
                "default": null,
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "paymentTerms": {
                "default": "",
                "type": "string",
                "maxLength": 1000
              },
              "paymentInstructions": {
                "default": "",
                "type": "string",
                "maxLength": 2000
              },
              "purchaseOrder": {
                "default": "",
                "type": "string",
                "maxLength": 120
              },
              "notes": {
                "default": "",
                "type": "string",
                "maxLength": 4000
              },
              "fields": {
                "default": [],
                "maxItems": 30,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 600
                    }
                  },
                  "required": [
                    "label",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "items": {
                "minItems": 1,
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "quantity": {
                      "type": "string",
                      "pattern": "^\\d{1,6}(\\.\\d{1,3})?$"
                    },
                    "unit": {
                      "default": "",
                      "type": "string",
                      "maxLength": 40
                    },
                    "unitPriceCents": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000
                    },
                    "taxable": {
                      "default": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "description",
                    "quantity",
                    "unit",
                    "unitPriceCents",
                    "taxable"
                  ],
                  "additionalProperties": false
                }
              },
              "discount": {
                "default": null,
                "anyOf": [
                  {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "fixed"
                          },
                          "cents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100000000
                          }
                        },
                        "required": [
                          "kind",
                          "cents"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "percent"
                          },
                          "rate": {
                            "type": "string",
                            "pattern": "^\\d{1,6}(\\.\\d{1,3})?$"
                          }
                        },
                        "required": [
                          "kind",
                          "rate"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxes": {
                "default": [],
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "rate": {
                      "type": "string",
                      "pattern": "^\\d{1,6}(\\.\\d{1,3})?$"
                    }
                  },
                  "required": [
                    "label",
                    "rate"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "schemaVersion",
              "language",
              "currency",
              "title",
              "header",
              "footer",
              "number",
              "business",
              "client",
              "issueDate",
              "dueDate",
              "paymentTerms",
              "paymentInstructions",
              "purchaseOrder",
              "notes",
              "fields",
              "items",
              "discount",
              "taxes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "invoiceId",
          "expectedRevision",
          "invoice"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "duplicate_invoice",
      "description": "Copy latest invoice into a new unpaid invoice, with new number and stable requestId UUID.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        },
        "required": [
          "invoiceId",
          "requestId",
          "number"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "export_draft",
      "description": "Generate a free PDF with DRAFT watermark on every page.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "invoiceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "quote_final",
      "description": "Quote a final PDF for USD 1.99 or return an existing/free correction entitlement. Present fee and obtain explicit user approval before purchase_final.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "invoiceId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "purchase_final",
      "description": "Charge USD 1.99 for the quoted revision using user-approved Stripe Link SPT. Only call after explicit approval. Never ask for card details. Reuse the same quote and SPT on retry; do not create a new purchase for an uncertain result.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "sharedPaymentToken": {
            "type": "string",
            "maxLength": 512,
            "pattern": "^spt_[A-Za-z0-9_]+$"
          },
          "acceptCharge": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "quoteId",
          "sharedPaymentToken",
          "acceptCharge"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "purchase_status",
      "description": "Check/reconcile a purchase without creating a new charge.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "quoteId"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "export_final",
      "description": "Export an unwatermarked paid PDF. Within 24 hours of purchase, grants free corrections to the same invoice; previously granted revisions stay downloadable.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "invoiceId"
        ],
        "additionalProperties": false
      }
    }
  ]
}
