Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Add Annotation

add_annotation

Add sticky notes, highlights, or rectangles to any PDF page, with coordinates in PDF space. Preserve existing digital signatures using incremental updates when annotating signed documents.

Instructions

Add one annotation to a page: sticky note (text), highlight, or rectangle (square). Coordinates are in PDF space (origin bottom-left, pt). For signed PDFs, preserveSignatures: true appends an incremental update without invalidating existing signatures (in tagged documents the enclosure in an Annot structure element rides the same update, preserving PDF/UA conformance).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
altNoAlt text for assistive technology. In tagged PDFs the annotation is enclosed in an Annot structure element (PDF/UA 7.18.1-1) and this becomes that element's /Alt. Ignored in untagged documents.
iconNoIcon for text notes. Default Note.
openNoWhether the text note starts open. Default false.
pageYesTarget page (1-based).
rectYesAnnotation rectangle in PDF space (origin bottom-left, pt). Must satisfy x1<x2 and y1<y2.
typeYestext = sticky note icon / highlight = highlight / square = rectangle.
colorNo#rrggbb. Defaults per type (text=#ffd400 / highlight=#ffff00 / square=#ff0000).
authorNoAuthor name.
contentsNoAnnotation body text (CJK fine).
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.
interiorColorNoFill colour for square (#rrggbb).
preserveSignaturesNoAdd the annotation to a signed PDF via an incremental update (appending) without invalidating existing signatures. Default false. The original bytes are untouched, so /ByteRange holds. In tagged PDFs the enclosure in an Annot structure element rides the same update, preserving PDF/UA conformance. Under a certification signature (DocMDP), allowed only at P=3.
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.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false, which already signal this is a mutating, non-idempotent operation. The description adds valuable behavioral context: coordinate system (PDF space, origin bottom-left, pt), the incremental-update behavior for signed PDFs, the default error on signed PDFs unless allowBreakingSignatures is set, and the PDF/UA conformance preservation. It does not contradict annotations.

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 two sentences and front-loads the core purpose and annotation types. The second sentence adds important behavioral context about signed PDFs and PDF/UA conformance. It is efficient, though the signed-PDF sentence is dense and could be split for readability. No wasted words.

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?

For a 15-parameter tool with no output schema, the description covers the key behavioral aspects: what the tool does, coordinate system, signed-PDF handling, and PDF/UA conformance. The schema covers all parameter semantics. The description does not explain the return value when outputPath is omitted, but the schema's outputPath description covers that. Overall, the description is complete enough for an agent to select and invoke the tool correctly.

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 description coverage is 100%, so the schema already documents all 15 parameters. The description adds meaning beyond the schema by explaining the coordinate system (PDF space, origin bottom-left, pt), the three annotation types, and the signed-PDF behavior. It also clarifies the relationship between preserveSignatures and allowBreakingSignatures, which is not fully captured in the individual parameter descriptions.

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 ('Add') and resource ('one annotation to a page'), and enumerates the three supported annotation types (sticky note, highlight, rectangle). It also names the coordinate system, which distinguishes it from any other annotation-like tool. The title and description align, and the description clearly differentiates this from sibling tools like add_watermark or stamp_page_numbers.

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 gives clear context for when to use the tool: adding sticky notes, highlights, or rectangles to a page. It does not explicitly name sibling alternatives or state when not to use it, but the sibling list shows no other annotation tool, so the usage context is clear. The signed-PDF guidance (preserveSignatures vs allowBreakingSignatures) provides important conditional usage direction.

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