Skip to main content
Glama

Set PDF metadata

pdf_set_metadata
DestructiveIdempotent

Write title, author, subject, creator, or keywords into a PDF to update its document info fields. Save an unencrypted copy without modifying the source file.

Instructions

Write document info fields (title, author, subject, creator, keywords) into a PDF. Give at least one; an empty string sets an empty value. Unicode is fine. Keywords may be a list or a comma-separated string. The output is saved unencrypted. Use pdf_metadata to read the current values. Returns the result written to output_path, or inline as an application/pdf resource when output_path is omitted (results over 7 MB are never returned inline: pass output_path); an existing file at output_path is overwritten. The source is never modified.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pdf_path": "<pdf_path>"
    },
    "name": "pdf_set_metadata"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNo
authorNo
creatorNo
subjectNo
keywordsNoComma-separated string or list of keywords
passwordNoPassword to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it).
pdf_pathYesPDF source: a path to a .pdf file inside the allowed directories (PDFOPS_ROOT, default the working directory), an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist.
output_pathNoPath of a .pdf file to write the result to, inside the allowed directories (PDFOPS_ROOT, default the working directory); an existing file there is overwritten. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save.

Output Schema

NameRequiredDescriptionDefault
bytesYesSize of the produced PDF in bytes
output_pathNoAbsolute path written, when output_path was supplied
resource_uriNopdfops:// uri of the inline application/pdf resource, when output_path was omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only flag destructiveHint=true and idempotentHint=true; the description supplies the concrete consequences: an existing file at output_path is overwritten, the result is saved unencrypted, the source PDF is never modified, and inline returns are capped at 7 MB. Those are exactly the facts an agent needs before invoking a destructive write.

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?

Front-loads the operation, then constraints, alternatives, and return behavior in a tight sequence of short sentences. A couple of clauses echo schema text (keywords list/comma form, output_path overwrite) but they are brief and reinforce rather than pad.

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 an 8-parameter mutation tool this is close to complete: fields, overwrite behavior, encryption state, source integrity, size limit, and the read alternative are all stated, and an output schema exists so return shape needs no elaboration. The one omission is how to handle a password-protected source, which the description never mentions.

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?

With 50% schema coverage, the description carries real weight: it names the five metadata fields, explains empty-string semantics ('an empty string sets an empty value'), states Unicode is acceptable, and covers the output_path-vs-inline return switch. The password parameter for locked inputs is not addressed in the description, leaving one meaningful gap.

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?

Opens with a specific verb and resource: 'Write document info fields (title, author, subject, creator, keywords) into a PDF.' It enumerates exactly which fields are mutated and names the sibling read tool (pdf_metadata) as its counterpart, so an agent can tell it apart from pdf_metadata or pdf_edit without opening schemas.

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?

Gives a concrete precondition ('Give at least one') and an explicit alternative for the read path ('Use pdf_metadata to read the current values'). It does not spell out when this tool is inappropriate (e.g. encryption-protected inputs are only hinted at via the unencrypted-output note), so it is clear context rather than a full when/when-not matrix.

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