Skip to main content
Glama

Add page numbers to PDF

pdf_page_numbers
Idempotent

Print page numbers on a PDF using a format template with {n} (page number) and {total} (page count), e.g. "Page {n} of {total}". Default is "{n} / {total}" at bottom-center, 10 pt. Numbers sit upright for any page size or rotation. Standard Helvetica only (WinAnsi characters). Page i always shows start+i-1 even when pages selects only some pages. Returns the result inline as an application/pdf resource; 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_page_numbers"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNoFont size in points, default 10
pagesNo1-based page spec such as "1-3,5"; default all pages
startNoNumber shown on page 1, default 1
formatNoTemplate with {n} and {total}, default "{n} / {total}"
marginNoDistance in points from the page edge, default 24
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: an https:// URL or a data:application/pdf;base64,… URI (this hosted server cannot read local file paths).
positionNoDefault bottom-center

Output Schema

NameRequiredDescriptionDefault
bytesYesSize of the produced PDF in bytes
resource_uriNopdfops:// uri of the inline application/pdf resource

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Goes well past the annotations by disclosing that the source PDF is never modified and the result comes back inline as an application/pdf resource, that numbering is anchored to start+i-1 regardless of the pages selection, and that output is Helvetica/WinAnsi only. The upright-under-rotation behavior is exactly the kind of non-obvious trait that prevents misuse.

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?

Roughly five tight sentences, front-loaded with the purpose and format template, then defaults, then edge cases and return behavior. Nothing is padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter transformation tool with full schema coverage and an output schema, the description covers the remaining unknowns: encoding limits, rotation handling, numbering semantics under partial page selection, and non-destructive delivery.

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 still adds real meaning by explaining the {n}/{total} template variables, the concrete default ('{n} / {total}', bottom-center, 10 pt), and the non-obvious start/pages interaction where only some pages are numbered but the counter still advances.

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?

States a specific verb and resource ("Print page numbers on a PDF") plus the templating mechanism, so the agent can immediately separate it from siblings like pdf_watermark or pdf_fill.

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

Usage Guidelines3/5

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

Usage is implied by the name and description - this is the tool for numbering pages - but nothing says when to prefer it over pdf_watermark (which could also stamp text) or how it relates to pdf_fill. No exclusions or prerequisites are given beyond what the schema's password parameter implies.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.