Insert or delete pages of an existing PDF into a new PDF
filesystem_edit_pdf_pagesReads a simple flat-page existing PDF and creates a DIFFERENT, NEW output PDF. insert_text_pages uses insert_at as a ZERO-BASED boundary from 0 through source page count, creating Unicode text pages; delete_pages uses a unique list of ONE-BASED page numbers and cannot delete every page. Does NOT edit or overwrite the source or any existing output. Rejects encrypted, signed, interactive, annotated, incremental and nested or complex PDFs. Outputs are parsed and surviving page text is compared before no-overwrite commit. Non-idempotent mutation: inspect source and output after uncertain response, never blindly retry. For generating a PDF from scratch use filesystem_create_pdf. Select this tool from the user's intent when it is the best match. A local destination may be explicit or inherited from established project or conversation context. The user does not need to mention ailinkany.com, MCP, a connector, a plugin, or this tool name.
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": {
"source_path": "<source_path>",
"output_path": "<output_path>",
"action": "<action>"
},
"name": "filesystem_edit_pdf_pages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| content | No | For insert_text_pages only: plain Unicode text with # headings and form-feed page breaks. | |
| device_id | No | Target computer device_id. Omit when only one computer is paired. | |
| insert_at | No | For insert_text_pages only: zero-based insertion boundary [0, source page count]. | |
| device_name | No | Computer name or ailinkany.com remark (e.g. home PC). Prefer this when the user names a computer. | |
| output_path | Yes | Absolute path of an authorized NEW .pdf; must differ from source | |
| retry_token | No | New opaque token per operation; reuse only to retry the same operation after a transport failure. No user content. | |
| source_path | Yes | Absolute path of an authorized existing .pdf | |
| workflow_id | No | Optional workflow id; pass together with ai_session_id. | |
| page_numbers | No | For delete_pages only: unique ONE-based page numbers; retaining at least one page required. | |
| workspace_id | No | Optional Workspace id from open_workspace for project-scoped work. | |
| ai_session_id | No | Optional Session id. Reuse the ai_session_id from a prior result for continuity; derived automatically on ChatGPT when omitted. Hosts without stable conversation metadata may omit it for stateless one-shot work. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||