Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Add Bookmarks (Outline)

add_bookmarks
Idempotent

Replace a PDF's outline with custom, nested bookmarks (titles and page numbers). For signed PDFs, use preserveSignatures to keep signatures valid.

Instructions

Set the bookmarks (outline) of a PDF. Existing bookmarks are replaced. Nest with children. For signed PDFs, preserveSignatures: true sets them while keeping the signatures intact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookmarksYesArray of bookmarks, each { title, page, open?, children? }. page is 1-based. Nest via children — up to 8 levels and 2000 entries in total.
inputPathYesAbsolute path of the target PDF.
outputPathNoDestination file path (absolute). When omitted, a base64 string is returned instead.
returnBase64NoWhen true, include a base64 string in the result in addition to saving.
preserveSignaturesNoEdit a signed PDF via an incremental update (appending) without invalidating existing signatures. Default false. The original bytes are untouched, so /ByteRange holds. Changes beyond the certification (DocMDP) permission level are refused.
allowBreakingSignaturesNoWhen the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.21.2

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only indicate non-readonly, not idempotent, and non-destructive. The description adds valuable behavior: existing bookmarks are replaced, signed PDFs can be edited incrementally without invalidating signatures, and breaking signatures is an opt-in behavior. These go beyond annotation hints and set proper expectations about destructive/replacement semantics.

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

Conciseness4/5

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

The description is concise but a bit dense. It front-loads the core action and replacement behavior, then covers nested children and the signed-PDF edge case in two sentences. Every clause is informative, but the signed-PDF detail could be clearer for agents unfamiliar with PDF signature semantics.

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

Completeness4/5

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

With a complete schema (100% coverage), no output schema, and clear annotations, the description sufficiently covers the tool's purpose, key behavioral semantics (replacement, signatures, nesting limits are in schema), and defaults. Missing only an explicit note that outputPath omission returns base64, but that is present in the schema, so the description need not repeat it.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all parameters. The description adds minimal extra parameter meaning beyond what the schema provides, though it clarifies the overall bookmark hierarchy and replacement behavior. Baseline 3 is appropriate given the schema already carries the burden.

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?

The description states a specific verb ('Set') and resource ('bookmarks (outline) of a PDF'), clearly distinguishes its replace-existing-bookmarks behavior, and mentions nesting and the signed-PDF preservation option. This is sufficient to differentiate it from sibling tools like stamp_page_numbers or set_metadata.

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?

The description conveys when to use it: for setting PDF bookmarks/outlines, including for signed PDFs when preserveSignatures is used, and it notes existing bookmarks are replaced. It doesn't explicitly name sibling alternatives or state when not to use it, but the context is clear enough for a tool that is semantically unique among siblings.

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