Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Add Watermark

add_watermark
Idempotent

Overlay diagonal watermarks like DRAFT or COPY across PDF pages to clearly indicate document status, while preserving tagged PDF/UA compliance and content readability.

Instructions

Overlay a diagonal watermark across the middle of each page ("社外秘" / "DRAFT" / "COPY", etc.). Drawn faintly behind the content by default. In tagged PDFs it is wrapped as an Artifact, preserving PDF/UA conformance. CJK watermarks need fontPath or the PDF_WRITER_FONT environment variable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesWatermark text, e.g. "社外秘" / "DRAFT" / "COPY".
angleNoCounter-clockwise angle (degrees). Default 45. 0 = horizontal.
colorNo#rrggbb. Default #808080 (grey).
pagesNoTarget pages, "1,3-5,8-" (1-based). All when omitted.
behindNoDraw behind the content. Default true. false draws over it (to strengthen the tamper-deterrent claim).
opacityNoOpacity, 0 (transparent) to 1 (opaque). Default 0.15 — faint enough to keep the content readable.
fontPathNoFont to embed (.ttf/.otf). Falls back to the PDF_WRITER_FONT environment variable, then the standard font. Required for CJK watermarks.
fontSizeNoFont size (pt). Default 60. Range 4-96.
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.4/5.0
Behavior4/5

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

Annotations already mark it as non-read-only, non-destructive, and idempotent. The description adds valuable context: default faint behind-content drawing, Artifact wrapping for tagged PDFs, and fontPath dependency for CJK. This goes beyond the annotations and clarifies operational behavior. No contradiction exists.

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

Conciseness5/5

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

The description is compact, with the core action stated first, followed by key behavioral notes. Every sentence earns its place—no redundant phrasing. It is efficiently structured and front-loaded.

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 tool with 13 parameters, the description covers the main purpose, defaults (faint, behind), and special cases (tagged PDFs, CJK fonts). The schema handles parameter-level detail, and there is no output schema to explain. The description is sufficiently complete for an agent to use 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 all parameters are already documented in the schema. The description adds value by pointing out the CJK font requirement, which is a cross-parameter dependency not apparent from individual schema entries. It doesn't need to repeat schema details.

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 clearly states the action ('Overlay a diagonal watermark') and the target resource ('each page'), with concrete examples of typical watermark text. This distinguishes it from sibling tools like add_annotation or stamp_page_numbers, which serve different purposes.

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?

It provides context such as the Artifact wrapping in tagged PDFs for PDF/UA conformance and the fontPath requirement for CJK watermarks, which informs when to use it or what to prepare. However, it doesn't explicitly compare to alternative tools or state when this tool is not appropriate, so it falls short of a 5.

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