Skip to main content
Glama

Password-protect PDF

pdf_protect

Encrypt a PDF with a password. user_password is required to open the result; owner_password lifts the permission restrictions. Give at least one (each 1 to 32 Latin-1 chars). permissions lists what stays ALLOWED from print, copy, modify, annotate, fill-forms (default all, except modify when an owner password is set; an empty list allows none). Restrictions only bind viewers when an owner password is set. Not byte-deterministic (random salts). 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_protect"
  }
}

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: an https:// URL or a data:application/pdf;base64,… URI (this hosted server cannot read local file paths).
permissionsNoActions to ALLOW; omit for the default, [] for none
user_passwordNoPassword required to open the output
owner_passwordNoPassword that lifts the restrictions

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.2/5.0
Behavior3/5

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

Adds genuinely useful behavior beyond the annotations: output is non-byte-deterministic due to random salts (explaining idempotentHint=false), the source file is never modified (consistent with destructiveHint=false), and results return as an inline application/pdf resource. However, it omits permission/authorization prerequisites and the fact that it consumes no local files is only stated in the schema.

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?

Five tight sentences, front-loaded with the core action, then password roles, then permission semantics, then determinism and return shape. Parentheticals are dense but every clause carries decision-relevant information.

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 five-parameter mutation tool the description covers the important semantic cases, and an output schema exists so return details need not be restated. The password length mismatch (32 vs 128) is the one inconsistency an agent could trip on.

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; the description still adds meaning with permission defaults, the empty-list semantics, and the Latin-1 charset restriction absent from the schema. It is undercut by a conflict: the description says passwords are '1 to 32 Latin-1 chars' while the schema allows maxLength 128.

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 ('Encrypt a PDF with a password'), which is unmistakably distinct from siblings such as pdf_unlock (removal) or pdf_set_metadata. An agent can identify the operation without opening the 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?

Gives clear conditional guidance: at least one password must be supplied, user_password gates opening, owner_password lifts restrictions, and restrictions only bind when an owner password is set. It does not name a sibling alternative (e.g. pdf_unlock for the inverse case), so it falls short of full when/when-not routing.

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.

Resources