Skip to main content
Glama

Password protect PDF

protect_pdf

Save a password-protected copy of a PDF using AES-256 encryption so it requires a password to open, while leaving the original file unchanged.

Instructions

Save a password-protected copy of a PDF, encrypted with AES-256, so it needs that password to open. Use unlock_pdf for the reverse. Returns the saved path; the original file is left unprotected and unchanged. Give the current password if the PDF is already encrypted.

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": {
      "file": "<file>",
      "new_password": "<new_password>"
    },
    "name": "protect_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to the file (absolute, or relative to the working directory).
outputNoWhere to save the result. Defaults to a new file next to the input.
passwordNoThe PDF's current password, if it has one.
new_passwordYesThe password to set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the annotations, it discloses that a copy is written, that the original stays unprotected and unchanged, that the return value is the saved path, and the encryption strength. The one gap is idempotency: with idempotentHint=false, it could state that repeated calls produce new files rather than overwriting, but the copy semantics largely imply it.

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?

Four short sentences, front-loaded with the core action and encryption detail, followed by sibling routing and edge-case handling. No sentence is redundant.

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 four-parameter, non-destructive file-writing tool with full schema coverage and no output schema, the description covers action, output (saved path), original-file safety, sibling alternative, and pre-encrypted input handling. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all four parameters are already documented, making a 3 the baseline. The description adds only a small amount: it clarifies that the current-password field applies only to already-encrypted PDFs, and that output defaults to a new file next to the input is left entirely to the schema.

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?

"Save a password-protected copy of a PDF, encrypted with AES-256" gives a specific verb (save/encrypt) and resource (PDF) plus the key attribute (AES-256, password-to-open). It explicitly contrasts with the sibling unlock_pdf, so an agent can distinguish the two 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 names the complementary tool ("Use unlock_pdf for the reverse") and gives a conditional instruction for already-encrypted inputs ("Give the current password if the PDF is already encrypted"). What is missing is an explicit when-not-to-use case, but the routing context is clear.

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