add_appendix
ChatGPTAttach an appendix to a draft contract: a copy of a template (pass templateId; fields it uses are added to the contract), or a new document (pass title and a Markdown body). Appendices are part of what's signed. PDFs can only be attached in Pledge itself. Optional: numbered numbers the appendix's clauses (headings, 1. and 1.1, restarting in each appendix) even when the contract's aren't (a template appendix takes the template's own numbering unless you pass numbered; a new document defaults to off); hideTitle leaves its title out of the document (it's still named in lists, the certificate and get_contract).
confirm_upload
ChatGPTStep 2: checks the uploaded file is a PDF, computes its SHA-256 on the server and returns a fileId for import_historical_contract. If a contract in this workspace already has this exact file, that contract is returned as alreadyImported instead (and no file is kept).
contract_card
ChatGPTData for the contract card shown by preview_contract. Use preview_contract instead.
create_client
ChatGPTAdd a client (a company or a person).
create_contract
ChatGPTCreate a draft contract, blank or from a template, optionally for a client, with field values, properties and a Markdown body (which replaces the template's text). Returns the new contract.
create_template_folder
ChatGPTCreate a template folder (owners and admins). It's added last. Move templates into it with update_template's folderId.
delete_template_folder
ChatGPTDelete a template folder (owners and admins). Its templates are not deleted: they move to no folder, and the result says how many (movedToNoFolder). dryRun reports what would happen without deleting.
find_or_create_client
ChatGPTReturns the existing client with this org number (digits compared, so spacing doesn't matter), else the one with this name (case-insensitive), else creates it. Optionally adds a contact to a company client if it isn't there yet. Use dryRun to only look.
get_client
ChatGPTA client's details, their contacts (primary first), contract history and totals. totals.signedAnnualValueByCurrency keeps the annualised amounts of signed, unarchived contracts separate by currency. The legacy totals.signedAnnualValue is null for multiple currencies.
get_contract
ChatGPTA contract's details: status, client, value and dates, fields and their values, recipients (signers and viewers, with order and status), open feedback, the document body as Markdown (fields shown as {{key}}; on a draft, open suggested changes are shown as {++inserted++} and {--deleted--}, and suggestedChanges is true), and its appendices (document appendices as Markdown with their numbered and hideTitle options, PDFs with a download link). Once signed in Pledge, final is the signed PDF to share or keep: status (ready, pending, failed or missing), version, SHA-256, page count and download links for the PDF and its evidence JSON.
get_template
ChatGPTA template's title, description, folder ({id, name}, or null), fields ({key: "field.x", label, type, default, description}) and body as Markdown — the same shape update_template accepts (pass folder.id as folderId) — plus validation issues, its recent revisions (for restore_template_revision) and its library cover ({type: "preset", preset} or {type: "upload"}; read-only, changed in the app).
import_historical_contract
ChatGPTStep 3: brings in a contract signed outside Pledge from a confirmed PDF (fileId). It's marked Imported, its fingerprint is the file's SHA-256, and the audit trail records the import via MCP. signedBy lists who signed it (shown on the certificate as signed outside Pledge). The client is matched like find_or_create_client and created if missing. Idempotent: a file already imported is skipped and the existing contract returned. Use dryRun: true to see what would happen without changing anything.
list_clients
ChatGPTList the workspace's clients with contract counts and signed annual value. signedAnnualValueByCurrency lists amounts in major units with their currency; currencies are never added together. The legacy signedAnnualValue is 0 with no valued contracts, the annual amount for one currency, or null for multiple currencies.
list_contracts
ChatGPTList contracts, newest activity first. Filter by status, client, and a date range that matches the contract period (start/end date) or, for contracts without dates, when they were created. Signed contracts carry a derived lifecycle (upcoming / active / ended, from their dates and endedOn); filter on it with lifecycle. lifecycle: "active" gives the contracts in force today (started, not past their end date or marked as ended; no end date counts as active), the same ones as the Active view in Pledge.
list_template_folders
ChatGPTThe workspace's template folders in display order, with how many templates each holds, and how many templates are in no folder. Folders are one level deep; file a template with update_template's folderId.
list_templates
ChatGPTList contract templates with their folder ({id, name}, or null when in no folder) and the fields they define. Pass folderId to list one folder's templates, or null for those in no folder.
preview_contract
ChatGPTThe contract as its recipients will read it: a short summary (client, value, billing, dates, recipients) and the document as Markdown with every field filled in, appendices included. Fields still without a value stay {{key}} and are listed in missingFields; toFix lists what to sort out before sending (no client, fields without a value, open suggestions, invalid dates) and readyToSend is true when it's empty. Show this to the user whenever you create or change a draft, and before asking whether to send it. In clients that show apps, the contract also appears in the chat as an editable document where the user can change the text, fill in fields and press Send; then reply with the summary only, not the full text. A message from the user quoting part of the contract with "change this part" comes from that document: make the change with update_contract.
rename_template_folder
ChatGPTRename a template folder (owners and admins). dryRun checks the new name and shows the change without saving.
restore_template_revision
ChatGPTPut a template back to an earlier revision (its title, description, fields and body; its folder stays), owners and admins only. Revision ids are listed by get_template. The state being replaced is itself saved as a revision, so a restore can be undone. dryRun shows the diff without saving.
save_contract_text
ChatGPTSaves the document edited in the contract card. Use update_contract instead.
search
ChatGPTSearch the workspace's contracts (by title, number or client), clients (by name, contact or email) and templates (by name, folder or description).
send_for_signature
ChatGPTLock a draft contract (with its appendices) and send it to its recipients. This can't be undone: only call it after showing the user the contract (preview_contract) and the recipients, and the user has said to send. Signers sign, viewers (CC) get a read-only link and the signed copy. The sender isn't added automatically. With sequential: true, signers sign in the given order and each is asked only after the previous one has signed. When email is set up, recipients are emailed (unless email is false); the result lists each link and who was emailed.
set_contract_end_date
ChatGPTFor signed contracts (including imported ones): change the end date, and/or mark them as ended on a day (or undo that). Ended contracts drop out of active totals, recurring per month, "Largest active contracts" and "Expiring soon". This is lifecycle metadata outside the signed document: the document, its hash, files, value, billing and start date never change, and every change is logged on the contract's audit trail. Owners and admins only. Takes a list of ids so many contracts can be ended at once; each one succeeds or fails on its own.
set_contract_value
ChatGPTSaves a value typed into a field in the contract card. Use update_contract, update_client or the workspace settings instead.
update_appendix
ChatGPTRename a draft contract's appendix, replace a document appendix's text with a Markdown body, or set a document appendix's options: numbered (number its clauses, 1. and 1.1, even when the contract's aren't) and hideTitle (leave its title out of the document; it's still named in lists, the certificate and get_contract). Pass only what changes. A body can't replace text that has suggested changes waiting (get_contract's suggestedChanges).
update_client
ChatGPTChange a client's details. Only the fields you pass are changed.
update_contract
ChatGPTUpdate a draft contract's title, client, value, billing, dates, field values (merged) or Markdown body. Sent and signed contracts are locked and can't be changed; the sender must revise them in Pledge. The one exception: on a signed contract an owner or admin may pass only endDate to change when it ends (same as set_contract_end_date).
update_template
ChatGPTChange a template (owners and admins). Partial: only what you pass changes. folderId files it into a folder (see list_template_folders), or null for no folder. fields is the full list and replaces the existing one, in the shape get_template returns ({key: "field.x", label, type, default, description}). body is Markdown like create_contract's and replaces the whole text; every {{field.x}} it uses must be in fields, other {{…}} must be built-ins ({{client.name}}, {{company.name}}, {{sender.name}}, {{contract.value}}, {{today}}, …; get_template lists them all as builtInVariables); unused fields are warnings. With dryRun: true nothing is saved and you get the diff (changed keys, a unified diff of the body, field changes) and a preview. Saving records the previous state as a revision (see get_template, restore_template_revision). The result includes the previous title, description, folder, body and fields. category is deprecated and ignored (folders replace categories); passing it only adds a warning.
upload_file
ChatGPTStep 1 of bringing in a PDF (e.g. an old signed contract): returns a short-lived URL to PUT the file's bytes to, with the headers and a ready curl command (replace the file path). PDFs only, up to 25 MB; the URL works once and expires in 15 minutes. Then call confirm_upload with the uploadId.
whoami
ChatGPTWhich Pledge workspace this connection acts in (its name and id), as which user and role, with what access (read or read & write) and which modules are on. Use it to answer "which tenant/workspace am I connected to?" and to tell two Pledge connections apart.