sanitize_pdf
Remove hidden PDF data—metadata, scripts, attachments, comments, thumbnails, and prior versions—then assign a new random ID while preserving links, bookmarks, and form fields.
Instructions
Write a copy without hidden data: metadata (incl. comment authors and camera data in images), scripts and risky actions, and attachments (comments too if remove_comments=true), plus application data, thumbnails, earlier saved versions and unused resources; gives it a new random ID. Links, bookmarks, form fields and accessibility structure are kept. Not removed: hidden layers, text hidden by colour or position, form field values, and the second half of an encrypted copy's ID (set by the PDF library from the time). removed is measured on the result; if anything asked for can't be removed, nothing is written. Needs the owner password if the PDF forbids changes, or forbids changing comments and has any. Signed PDFs are refused.
Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_path": "<input_path>"
},
"name": "sanitize_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | No | ||
| overwrite | No | ||
| input_path | Yes | ||
| output_path | No | ||
| remove_scripts | No | ||
| remove_comments | No | ||
| remove_metadata | No | ||
| remove_attachments | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| removed | Yes | ||
| document_id_reset | Yes | ||
| password_protected | Yes | ||
| user_password_changed | Yes | ||
| permissions_restricted | Yes |