Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Stamp Page Numbers

stamp_page_numbers
Idempotent

Adds page numbers to each page of a PDF, with configurable position, format, and start number. Supports tagged PDF/UA artifact wrapping and CJK fonts, preserving PDF/UA conformance.

Instructions

Stamp a page number on each page. In tagged PDFs the stamp is wrapped as an Artifact, preserving PDF/UA conformance. Formats containing CJK text need fontPath or the PDF_WRITER_FONT environment variable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
colorNo#rrggbb. Default #666666.
pagesNoPages to stamp, "1,3-5,8-" (1-based). All when omitted. Use "2-" to skip a cover page.
formatNoFormat. {n} = current page, {total} = total pages. Default "{n}". Examples: "- {n} -" / "{n} / {total}" / "Page {n}". Must contain {n}.
marginNoMargin from the edge (pt). Default 24. Range 0-300.
startAtNoFirst number to stamp. Default 1. Useful to start at 1 after skipping a cover page.
fontPathNoFont to embed (.ttf/.otf). Falls back to the PDF_WRITER_FONT environment variable, then the standard font. Required for formats containing CJK text.
fontSizeNoFont size (pt). Default 9. Range 4-96.
positionNoPlacement. Default bottom-center. Visual position, taking page /Rotate into account.
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

A3.8/5.0
Behavior4/5

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

Annotations already indicate a non-read-only, idempotent, non-destructive operation. The description adds useful behavioral context beyond those hints: tagged PDFs keep PDF/UA conformance via Artifact wrapping, and CJK formats require a fontPath or environment variable. This does not contradict the annotations.

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?

Two sentences carry the core action first and the key exceptions second. Every sentence adds information without repeating schema defaults or parameter details.

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?

The schema fully documents parameters, defaults, ranges, enum, and base64-output behavior, and the description contributes the non-obvious PDF/UA and CJK caveats. The main missing piece is alternative-selection guidance, but that is more a usage-guidelines gap than an invocation-completeness gap.

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 description coverage is 100%, so the baseline is 3. The description adds no real parameter meaning beyond the schema; the note about CJK and fontPath essentially repeats what the fontPath parameter already states.

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 the specific action and resource: 'Stamp a page number on each page.' This distinguishes the tool from siblings like add_watermark or add_annotation, and the additional tagged-PDF/Artifact detail reinforces its niche.

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

Usage Guidelines2/5

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

There is no guidance on when to choose this tool over sibling tools such as add_watermark or add_annotation, and no when-not-to-use conditions. The CJK font requirement is a prerequisite, not guidance about choosing among alternatives.

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