Skip to main content
Glama
Nizoka

pdfnative-mcp

Encrypt / re-secure a PDF

encrypt_pdf

Encrypt a PDF with AES-128 or AES-256 security. Set owner and optional user passwords, and configure permissions. Also supports password rotation for already encrypted files.

Instructions

Re-secure an existing PDF with the PDF Standard Security Handler (pdfnative v1.6.0): AES-128 (V4/R4, default) or AES-256 (V5/R6). RC4 is never emitted. Set ownerPassword (required) and optionally userPassword (open password), algorithm, and permissions { print, copy, modify, extractText }. Re-encrypt an already-encrypted source under a NEW password by passing its current password (password rotation in one call). CAVEAT: encryption rebuilds the page tree, so existing signatures and the interactive AcroForm are DROPPED and only self-contained URI links are kept — encrypt BEFORE signing, not after.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
passwordNoCurrent password of an already-encrypted source (enables password rotation). Omit for an unencrypted source.
algorithmNoContent cipher: aes128 (V4/R4, widest compatibility) or aes256 (V5/R6, strongest).aes128
pdfBase64YesBase64-encoded source PDF to encrypt. NOTE: existing signatures and AcroForm are dropped (page-tree rebuild).
outputModeNobase64
outputPathNoRequired when outputMode='file'. Relative path inside the sandbox; must end with .pdf.
permissionsNoAccess permission flags (enforced by conforming readers). Each defaults to allowed when omitted.
userPasswordNoUser (open) password. Omitted or empty string means the document opens without a password prompt.
ownerPasswordYesOwner password (required, non-empty). Controls permissions and full access.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
filePathNoAbsolute sandboxed file path (when mode='file').
sizeBytesYes
Behavior1/5

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

Annotation contradiction: destructiveHint is false but description states encryption drops existing signatures and AcroForm (destructive effects). This inconsistency undermines transparency. Annotation says not destructive, but description details destructive consequences.

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?

Single paragraph with front-loaded main purpose and key details. Every sentence adds value: algorithm options, password roles, permission details, and critical caveat. No wasted words.

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?

Given 8 parameters, nested objects, and existing output schema, the description covers essential behaviors, parameter semantics, and the ordering caveat. It addresses password rotation and permission flags comprehensively. The output schema handles return value details, so description is complete.

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

Parameters5/5

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

Adds significant meaning beyond input schema: explains password rotation, algorithm defaults, permissions structure, and the caveat about dropping signatures on pdfBase64. Schema coverage is 88%, so the description compensates well with additional context for parameters like ownerPassword, userPassword, and algorithm.

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?

Clearly states the tool re-secures a PDF with specific encryption algorithms (AES-128/256) and password options. Distinguished from siblings like decrypt_pdf and split_pdf by focusing on encryption and password rotation.

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?

Provides explicit guidance on when to use (encrypting/re-encrypting PDFs, password rotation) and a crucial caveat about ordering (encrypt before signing). While it doesn't explicitly list when not to use, the context of sibling tools implies alternatives. The description gives clear context for usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Nizoka/pdfnative-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server