Skip to main content
Glama

Insert or delete pages of an existing PDF into a new PDF

filesystem_edit_pdf_pages

Reads 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

NameRequiredDescriptionDefault
actionYes
contentNoFor insert_text_pages only: plain Unicode text with # headings and form-feed page breaks.
device_idNoTarget computer device_id. Omit when only one computer is paired.
insert_atNoFor insert_text_pages only: zero-based insertion boundary [0, source page count].
device_nameNoComputer name or ailinkany.com remark (e.g. home PC). Prefer this when the user names a computer.
output_pathYesAbsolute path of an authorized NEW .pdf; must differ from source
retry_tokenNoNew opaque token per operation; reuse only to retry the same operation after a transport failure. No user content.
source_pathYesAbsolute path of an authorized existing .pdf
workflow_idNoOptional workflow id; pass together with ai_session_id.
page_numbersNoFor delete_pages only: unique ONE-based page numbers; retaining at least one page required.
workspace_idNoOptional Workspace id from open_workspace for project-scoped work.
ai_session_idNoOptional 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

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: it discloses that the source is never overwritten, that encrypted/signed/interactive/annotated/incremental/nested PDFs are rejected, that output is parsed and surviving text compared before a no-overwrite commit, and that the operation is non-idempotent with explicit retry guidance. This is exactly the extra context annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core content is front-loaded and dense with useful constraints, but the trailing sentences about intent selection, inherited destinations, and not needing to mention ailinkany.com/MCP/connector are boilerplate that dilutes the signal. Trimming those would sharpen an otherwise efficient definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, non-idempotent mutation tool with an output schema, the description covers safety, rejection conditions, retry behavior, and action-specific parameter semantics. Nothing an agent needs to invoke it correctly is missing, and return values are covered by the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 92%, yet the description still adds meaning: insert_at is a zero-based boundary from 0 through source page count, page_numbers are unique one-based values, and at least one page must be retained. That clarifies the off-by-one risk the schema alone does not flag.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Reads a simple flat-page existing PDF and creates a DIFFERENT, NEW output PDF') and enumerates the two actions with their distinct semantics. It explicitly distinguishes itself from filesystem_create_pdf, so an agent can route without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear when-to-use rule ('For generating a PDF from scratch use filesystem_create_pdf') and explains destination resolution from project or conversation context. It lacks an explicit when-not-to-use beyond the create_pdf case, but the rejection list of unsupported PDF types effectively bounds applicability.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources