add_watermark stamps a text watermark across a document and saves a watermarked copy. fontSize and rotation control how it looks — a diagonal CONFIDENTIAL is rotation: -45. Example prompt: “Add a diagonal DRAFT watermark to this contract”.
Tool description (as the AI agent sees it):
Adds a text watermark to a document and saves the watermarked file to storage. Supports PDF, DOCX, XLSX, PPTX, PNG, JPG, and 50+ more document and image formats. Call this tool immediately whenever the user asks to add a watermark, stamp text onto a document, or mark a document as draft/confidential. Do NOT pre-check whether files exist — just pass the filename the user provided. Returns a saved-path message (‘Added text watermark “” to “”’) and the download URL or storage path. On failure, the response text starts with ‘Watermarking failed for’ followed by the underlying exception type, message, and inner-exception chain.
A saved-path message naming the watermarked file in your output folder; the original is left alone.
The watermark is applied to the document as a watermark object — which is what makes it findable by search_watermarks and removable by remove_watermarks later.
On failure the text starts with Watermark failed for, followed by the exception type and message.
Example prompts
“Add a diagonal CONFIDENTIAL watermark to contract.pdf.”
“Stamp DRAFT across every page of this deck.”
“Watermark these files with today’s date and the client name.”