Skip to main content
Glama

Password-protect PDF (PDFSharp)

api2pdf_add_password
Destructive

Encrypt an existing PDF (given as a URL) with a user password (required to open) and an optional owner password (controls permissions). Returns a { FileUrl } (valid ~24h). BILLED. Api2Pdf API: POST /pdfsharp/password.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the PDF to protect.
inlineNoIf true (Api2Pdf default), the generated file is served inline; if false, as an attachment.
optionsNoEngine-specific render options (page size, margins, orientation, headers/footers, etc.). Passed through verbatim to Api2Pdf.
storageNoCustom storage target, used when useCustomStorage is true.
fileNameNoA name for the generated file, e.g. 'invoice.pdf'.
userpasswordYesPassword required to OPEN the resulting PDF.
output_binaryNoIf true, return the raw file bytes as base64 instead of a FileUrl. Default false (recommended for agents — returns a short-lived link).
ownerpasswordNoOptional owner password controlling permissions (printing, editing, etc.).
extraHTTPHeadersNoExtra HTTP headers Api2Pdf forwards when it fetches a source URL (e.g. auth for a protected page/file).
useCustomStorageNoIf true, Api2Pdf uploads the result to your own storage (see `storage`) instead of hosting it.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses that the operation is billed, returns a FileUrl, and that the link is only valid for ~24 hours. It also identifies the exact API endpoint and engine. These are meaningful behavioral facts not present in the annotations or 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?

The description is two tight sentences plus an endpoint identifier. It front-loads the action with 'Encrypt', then states required vs optional passwords, the output, the validity window, and the billing implication. Every clause earns its place; there is no padding or repetition.

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?

The description covers the core behavior, the required and optional inputs, the return value, the link expiration, and the cost implication. Combined with the fully self-documenting input schema and the destructiveHint annotation, an agent has enough context to invoke the tool correctly.

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 description coverage is 100%, so the schema already documents every parameter. The description restates the key semantics of userpassword and ownerpassword but adds no per-parameter detail beyond what the schema provides. This matches the baseline 3 for high schema coverage.

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 states a specific verb ('Encrypt') and resource ('existing PDF (given as a URL)') and clearly distinguishes the tool from siblings like api2pdf_compress_pdf or api2pdf_extract_pages. It also names the two key password concepts and the PDFSharp API endpoint, leaving no ambiguity about what operation is performed.

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?

The use case is clearly implied: apply password protection to an already-existing PDF available at a URL. It does not explicitly name alternatives or say 'use this instead of X', but the sibling set contains no directly competing password tool, and the description's precise wording supplies enough context. It also flags 'BILLED', which helps an agent weigh when to invoke it.

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.

TDQS

A4.3/5.0
Disambiguation5/5

Each tool targets a distinct operation: conversions, PDF manipulations, file deletion, and account/service info are clearly separated. Even the three HTML-to-PDF tools are distinguished by source type or rendering engine.

Naming Consistency5/5

All tools follow a consistent api2pdf_ prefix with snake_case verb-based names such as add_password, merge_pdfs, and url_to_pdf. The pattern is predictable and makes it easy to infer what each tool does.

Tool Count4/5

Sixteen tools is slightly above the typical 3-15 range, but the count is justified by the breadth of Api2Pdf's functionality spanning creation, manipulation, conversion, deletion, and account management.

Completeness5/5

The surface covers the full PDF lifecycle: generate from multiple sources, manipulate via merge/extract/compress/password, convert to markdown, delete files, plus billing and status checks. No obvious missing operations for the documented purpose.