Skip to main content
Glama

Remove PDF restrictions

pdf_unlock
DestructiveIdempotent

Save a PDF without encryption to remove print, copy, and modify restrictions; provide the password only for user-password files.

Instructions

Save a PDF without encryption so print/copy/modify restrictions are gone. Works for owner-locked files (empty user password) with no password, and for user-password files when you pass the password. It does NOT crack unknown passwords: a wrong or missing user password fails with encrypted_pdf. A PDF that was not encrypted is returned re-saved, with note "not-encrypted". 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_unlock"
  }
}

Input Schema

NameRequiredDescriptionDefault
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
noteNoPresent as "not-encrypted" when the input had no encryption
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.9/5.0
Behavior5/5

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

Goes well beyond the supplied annotations by naming the failure mode (encrypted_pdf), the pass-through case for unencrypted inputs (re-saved with note 'not-encrypted'), the 7 MB inline return ceiling, the overwrite behavior at output_path, and the guarantee that the source is never modified. These are exactly the side effects an agent needs, and the 'source is never modified' claim is consistent with destructiveHint=true applying to the output file, not the input.

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?

A tight five sentences with the core action front-loaded, followed by supported cases, the explicit non-support, and return semantics. Every sentence carries distinct information; 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 a file-writing tool with an output schema and full annotation coverage, nothing material is missing: input handling, password semantics, failure mode, overwrite risk, inline-size limit, and source-preservation are all addressed.

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 baseline is 3, but the description adds real semantics: the password parameter is conditioned on owner-locked versus user-password files, and output_path omission triggers inline return with a hard 7 MB threshold that the schema does not mention. It largely restates the schema's path/URL guidance, which keeps it from a 5.

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 outcome: 'Save a PDF without encryption so print/copy/modify restrictions are gone.' This is unambiguously the inverse of a protect operation and cannot be confused with any other sibling (merge, split, extract, etc.). The scope of what is removed (print/copy/modify restrictions) is spelled out rather than left as 'unlock' jargon.

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

Usage Guidelines5/5

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

Explicitly covers both usable cases (owner-locked files with an empty user password, no password needed; user-password files when the password is passed) and the excluded case ('It does NOT crack unknown passwords: a wrong or missing user password fails with encrypted_pdf'). That is a when-to-use plus a clearly stated when-it-will-fail with the error name.

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