Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Set PDF Metadata

set_metadata
Idempotent

Update an existing PDF's title, author, subject, keywords, or creator while preserving all other metadata. Optionally keep digital signatures valid via incremental update.

Instructions

Update an existing PDF's metadata (the Info dictionary). Only the given fields change; the rest are preserved. At least one of title / author / subject / keywords / creator is required. In documents with XMP (/Metadata), dc:title etc. are synchronized to prevent divergence. For signed PDFs, preserveSignatures: true updates while keeping the signatures intact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoTitle.
authorNoAuthor.
creatorNoCreating application name.
subjectNoSubject.
keywordsNoArray of keywords.
inputPathYesAbsolute path of the PDF to edit.
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 set readOnlyHint=false, destructiveHint=false, and idempotentHint=true. The description adds valuable behavioral context: the partial-update preservation rule, XMP synchronization to prevent divergence, and the two distinct signed-PDF behaviors (preserveSignatures vs allowBreakingSignatures). These details go well beyond the annotations and help an agent predict side effects.

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?

Three sentences, no fluff. The purpose is front-loaded, followed by the non-destructive update nuance, the XMP sync detail, and the signed-PDF handling. Each sentence earns its place, and the structure leads with the core action before edge cases.

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 mutation tool with 10 parameters and no output schema, the description covers the essential behavioral decisions an agent needs: partial updates, input requirement, XMP handling, and signature preservation. It omits the output/return behavior (base64 when outputPath omitted), but that is documented in the schema, so the description does not need to repeat it. Given the complexity, this is adequately complete.

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 100%, so the baseline is 3. The description enriches parameter understanding by stating that omitted fields are preserved, clarifying the effect of not passing title/author/etc. It also explains the interplay between preserveSignatures and allowBreakingSignatures (default error for signed PDFs). This adds meaning beyond the static schema 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 clearly states the tool updates an existing PDF's metadata (the Info dictionary), exactly specifying the resource and action. It also clarifies that only given fields change, distinguishing it from any creation or transformation tools. No ambiguity exists among siblings since none perform metadata updates.

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 implicitly states when to use it (when updating PDF metadata) and gives concrete usage conditions: 'At least one of title / author / subject / keywords / creator is required.' It also addresses the special case of signed PDFs with preserveSignatures. It does not explicitly exclude other tools, but no sibling operates on metadata, so the context is sufficient.

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