Skip to main content
Glama
PDF.co MCP Server

PDF.co MCP Server

Official
by pdfdotco

Add PDF password

pdf_add_password

Add owner and user passwords to a PDF, apply encryption, and restrict printing, editing, and copying to control access.

Instructions

Add password protection to a PDF file. Ref: https://developer.pdf.co/api/pdf-password/add.md

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": {
      "url": "<url>",
      "owner_password": "<owner_password>"
    },
    "name": "pdf_add_password"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesURL to the source PDF file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files.
nameNoFile name for the generated output. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
passwordNoPassword of the PDF file if it's already password-protected. (Optional)
profilesNoExtra engine options for this endpoint as a JSON object encoded in a string. The options differ per endpoint; see https://developer.pdf.co/api/profiles. (Optional)
expirationNoLifetime of the output link in minutes; the output file is deleted afterwards. API default is 60; the maximum depends on the plan. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
httpusernameNoHTTP auth user name if required to access source url. (Optional)
print_qualityNoAllowed printing quality. Valid values: HighResolution, LowResolution.
user_passwordNoThe optional user password will be asked for viewing and printing document.
owner_passwordYesThe main owner password that is used for document encryption and for setting/removing restrictions.
allow_fill_formsNoAllow or prohibit the filling of interactive form fields (including signature fields) in the PDF documents.
allow_print_documentNoAllow or prohibit printing PDF document.
encryption_algorithmNoEncryption algorithm. Valid values: RC4_40bit, RC4_128bit, AES_128bit, AES_256bit. AES_128bit or higher is recommended.AES_256bit
allow_modify_documentNoAllow or prohibit modification of PDF document.
allow_assembly_documentNoAllow or prohibit assembling the document.
allow_content_extractionNoAllow or prohibit copying content from PDF document.
allow_modify_annotationsNoAllow or prohibit interacting with text annotations and forms in PDF document.
allow_accessibility_supportNoAllow or prohibit content extraction for accessibility needs.

Output Schema

NameRequiredDescriptionDefault
tipsNo
statusYes
contentYes
credits_usedNo
credits_remainingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changedv0.0.12
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / allow_accessibility_support / title
      Removed value: -"Allow Accessibility Support"
    • removedInput schema / properties / allow_assembly_document / title
      Removed value: -"Allow Assembly Document"
    • removedInput schema / properties / allow_content_extraction / title
      Removed value: -"Allow Content Extraction"
    • removedInput schema / properties / allow_fill_forms / title
      Removed value: -"Allow Fill Forms"
    • removedInput schema / properties / allow_modify_annotations / title
      Removed value: -"Allow Modify Annotations"
    • removedInput schema / properties / allow_modify_document / title
      Removed value: -"Allow Modify Document"
    • removedInput schema / properties / allow_print_document / title
      Removed value: -"Allow Print Document"
    • removedInput schema / properties / api_key / title
      Removed value: -"Api Key"
    • removedInput schema / properties / encryption_algorithm / title
      Removed value: -"Encryption Algorithm"
    • removedInput schema / properties / expiration / title
      Removed value: -"Expiration"
    • removedInput schema / properties / httppassword / title
      Removed value: -"Httppassword"
    • removedInput schema / properties / httpusername / title
      Removed value: -"Httpusername"
    • removedInput schema / properties / name / title
      Removed value: -"Name"
    • removedInput schema / properties / owner_password / title
      Removed value: -"Owner Password"
    • removedInput schema / properties / password / title
      Removed value: -"Password"
    • removedInput schema / properties / print_quality / title
      Removed value: -"Print Quality"
    • removedInput schema / properties / profiles / title
      Removed value: -"Profiles"
    • removedInput schema / properties / url / title
      Removed value: -"Url"
    • removedInput schema / properties / user_password / title
      Removed value: -"User Password"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "content": {},
      +    "credits_remaining": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "credits_used": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "tips": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "content"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv0.0.11
    • addedInput schema / properties / expiration
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Lifetime of the output link in minutes; the output file is deleted afterwards. API default is 60; the maximum depends on the plan. (Optional)",
      +  "title": "Expiration"
      +}
    • addedInput schema / properties / profiles
      Added value: +{
      +  "default": "",
      +  "description": "Extra engine options for this endpoint as a JSON object encoded in a string. The options differ per endpoint; see https://developer.pdf.co/api/profiles. (Optional)",
      +  "title": "Profiles",
      +  "type": "string"
      +}
  3. First observed

TDQS

C2.9/5.0
Behavior2/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, so the description is not contradicting them, but it adds essentially no behavioral context of its own. It does not say that the result is a newly generated file rather than an in-place mutation, that the output link expires (a schema-level expiration parameter governs deletion), or anything about plan-dependent limits. For a tool that rewrites a document's encryption, that is a real gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two terse lines with the core action front-loaded and zero padding; the reference URL is a reasonable trailing pointer. Brevity here borders on under-specification rather than waste, but nothing in the text is superfluous.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and annotations carry the safety profile, so the agent is not flying blind. However, with 19 parameters governing permissions, encryption strength, and output lifetime, a single sentence leaves the agent dependent on the schema and the external link to understand the tool's overall effect.

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 every one of the 19 parameters is already documented in the input schema, including the enum-like value lists for print_quality and encryption_algorithm. The description adds no meaning beyond the schema, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Add password protection to a PDF file.' An agent can tell this is the encryption/adding counterpart to pdf_remove_password from the name and title alone. It stops short of explicitly naming the sibling it complements, so it sits just below a 5.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites (e.g. that an owner_password is mandatory, or that the source must be reachable by URL), and no mention of alternatives such as pdf_remove_password or upload_file. The only pointer is a developer docs link, which pushes the burden of inference onto the agent.

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