Skip to main content
Glama

Rotate PDF pages

pdf_rotate
DestructiveIdempotent

Rotate PDF pages clockwise by 90, 180, or 270 degrees to fix sideways scans. Adds to each page's existing rotation, rotates all pages by default, and never modifies the source.

Instructions

Rotate pages of a PDF clockwise by 90, 180 or 270 degrees (or -90). Rotation adds to each page's existing rotation. Omit pages to rotate every page. Use this to fix sideways scans. 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>",
      "degrees": "<degrees>"
    },
    "name": "pdf_rotate"
  }
}

Input Schema

NameRequiredDescriptionDefault
pagesNo1-based page spec such as "1-3,5"; default all pages
degreesYesClockwise rotation to add
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.3/5.0
Behavior4/5

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

Beyond the annotations (readOnly=false, destructive=true, idempotent=true, openWorld=true) the description discloses the key non-obvious semantics: rotation is additive to existing page rotation, output_path is overwritten, inline results are capped at 7 MB, and the source file is never modified. Together these reconcile the destructive and idempotent hints with actual behavior; only failure modes (e.g., wrong password, non-PDF source) are left unaddressed.

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

Conciseness4/5

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

The core behavior and incrementality are front-loaded in the first two sentences, followed by return/output constraints and a source-safety note. It is efficient overall, though the overwrite warning is stated twice with slight variation (once as output behavior, once inside the schema-facing phrasing), which is minor redundancy.

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 mutating, open-world tool with an output schema, the description covers the facts an agent needs to call it correctly: incremental rotation, page default, write-vs-inline return, size cap, overwrite risk, and source immutability. Only edge behavior for unreadable/protected inputs is absent, which the password parameter's own schema text largely covers.

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, but the description still adds cross-parameter meaning: output_path governs whether the result is written to disk or returned inline, and inline returns are refused above 7 MB, which frames the parameter as a mode switch rather than a plain path. The additive-rotation semantics for `degrees` and the all-pages default for `pages` restate the schema more than they extend it.

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 opens with a specific verb+resource ('Rotate pages of a PDF') and immediately bounds the operation ('clockwise by 90, 180 or 270 degrees (or -90)'). It adds a concrete intended use ('fix sideways scans'), so an agent can distinguish this from general editing tools like pdf_edit without opening either schema.

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 gives clear usage context ('Use this to fix sideways scans'), a default rule ('Omit pages to rotate every page'), and a decision rule for remote runs (omit output_path to get an inline resource). It stops short of naming an alternative tool for cases where absolute page orientation is needed rather than an incremental rotation, so there is no explicit when-not guidance.

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