set_outline
Replace a PDF's bookmarks with a new reading-order outline of titles, nesting levels, pages or links. Validates every entry before writing, and can clear all bookmarks.
Instructions
Replace a PDF's bookmarks (its outline) with entries, in reading order. Each has a title, a level (default 1, up to 20; at most one deeper than the entry before it, so level 2 nests under the previous level-1 entry) and either a 1-based page or a link (http, https or mailto); with neither it is a heading that goes nowhere. An empty list removes all bookmarks. Everything is checked before anything is written.
To add to existing bookmarks, read them with get_outline first and pass them back with yours (check its truncated flag). Rewriting keeps titles, nesting, pages and links; other actions (scripts and the like), colour and style, open/closed state and exact scroll positions are not kept. The result opens with the bookmarks panel showing. Needs the owner password if the PDF forbids document assembly; signed PDFs are refused because the change would break 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>",
"entries": "<entries>"
},
"name": "set_outline"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entries | Yes | ||
| password | No | ||
| overwrite | No | ||
| input_path | Yes | ||
| output_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| entries | Yes | ||
| replaced | Yes | ||
| password_protected | Yes | ||
| user_password_changed | Yes | ||
| permissions_restricted | Yes |