add_comments
Add up to 100 review comments—highlights, underlines, notes, text boxes, or replies—to a PDF copy so feedback displays consistently in viewers and print.
Instructions
Add review comments to a copy of a PDF (default "_commented.pdf"). Each is drawn so it looks the same in every viewer and prints, and carries its text, author (the author argument) and date where viewers show comments. Up to 100 per call:
highlight / underline / strikeout / squiggly: over "text" (found as search_text finds it, ignoring case unless match_case; whole_word optional; every place it is found, up to 100, on "page" or on all pages), or over "rects" on "page" ([[left, bottom, right, top], ...] in PDF points, in the page's own coordinates, as search_text gives rectangles). "comment" adds a note to it.
note: a sticky note with its "comment", beside "text" (where it is first found, on "page" or in the PDF) or at "at" [x, y] (its top-left) on "page".
text_box: "text" drawn in a box at "rect" on "page" (Latin characters; font_size 4-72, default 12; border true by default); "comment" is its subject.
reply: a "comment" answering the comment whose id "to" names (list_comments gives ids; replies show with the comment they answer).
"color" is #rrggbb or a colour name (defaults: yellow highlights and notes, blue underlines, red strikeouts, green squiggles, black text boxes). Returns each comment's new ids. Nothing is written if any comment fails (e.g. text not found). Needs the owner password if the PDF forbids changing comments. Signed PDFs are refused (the change would invalidate the signature).
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>",
"comments": "<comments>"
},
"name": "add_comments"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| author | No | ||
| comments | Yes | ||
| password | No | ||
| overwrite | No | ||
| input_path | Yes | ||
| output_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| added | Yes | ||
| output | Yes | ||
| comments | Yes | ||
| password_protected | Yes | ||
| user_password_changed | Yes | ||
| permissions_restricted | Yes |