Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

pdf_remove_password

Remove password protection from a PDF file to unlock access. Supports URLs and optional password input.

Instructions

Remove password protection from a PDF file.
Ref: https://developer.pdf.co/api-reference/pdf-password/remove.md

Input Schema

TableJSON 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.
httpusernameNoHTTP auth user name if required to access source url. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
passwordNoPassword of the PDF file to be removed. (Optional)
nameNoFile name for the generated output. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)

Implementation Reference

  • MCP tool handler for 'pdf_remove_password'. Defines the input schema (url, httpusername, httppassword, password, name, api_key) as Pydantic Fields, constructs a ConversionParams object, and calls the remove_pdf_password helper.
    @mcp.tool()
    async def pdf_remove_password(
        url: str = Field(
            description="URL 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."
        ),
        httpusername: str = Field(
            description="HTTP auth user name if required to access source url. (Optional)",
            default="",
        ),
        httppassword: str = Field(
            description="HTTP auth password if required to access source url. (Optional)",
            default="",
        ),
        password: str = Field(
            description="Password of the PDF file to be removed. (Optional)", default=""
        ),
        name: str = Field(
            description="File name for the generated output. (Optional)", default=""
        ),
        api_key: str = Field(
            description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)",
            default="",
        ),
    ) -> BaseResponse:
        """
        Remove password protection from a PDF file.
        Ref: https://developer.pdf.co/api-reference/pdf-password/remove.md
        """
        params = ConversionParams(
            url=url,
            httpusername=httpusername,
            httppassword=httppassword,
            password=password,
            name=name,
        )
    
        return await remove_pdf_password(params, api_key=api_key)
  • Helper function 'remove_pdf_password' that makes the actual API request to 'pdf/security/remove' endpoint via the PDFCoClient.
    async def remove_pdf_password(
        params: ConversionParams, api_key: str | None = None
    ) -> BaseResponse:
        return await request("pdf/security/remove", params, api_key=api_key)
  • Imports: mcp server instance (used for @mcp.tool() decorator which registers the tool), the remove_pdf_password helper, and BaseResponse/ConversionParams models.
    from pdfco.mcp.server import mcp
    from pdfco.mcp.services.pdf import add_pdf_password, remove_pdf_password
    from pdfco.mcp.models import BaseResponse, ConversionParams
  • ConversionParams schema model used by the handler to construct the request payload (url, httpusername, httppassword, password, name, etc.).
    class ConversionParams(BaseModel):
        url: str = Field(
            description="URL to the source file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files.",
            default="",
        )
        httpusername: str = Field(
            description="HTTP auth user name if required to access source url. (Optional)",
            default="",
        )
        httppassword: str = Field(
            description="HTTP auth password if required to access source url. (Optional)",
            default="",
        )
        pages: str = Field(
            description="Comma-separated page indices (e.g., '0, 1, 2-' or '1, 3-7'). Use '!' for inverted page numbers (e.g., '!0' for last page). Processes all pages if None. (Optional)",
            default="",
        )
        unwrap: bool = Field(
            description="Unwrap lines into a single line within table cells when lineGrouping is enabled. Must be true or false. (Optional)",
            default=False,
        )
        rect: str = Field(
            description="Defines coordinates for extraction (e.g., '51.8,114.8,235.5,204.0'). (Optional)",
            default="",
        )
        lang: str = Field(
            description="Language for OCR for scanned documents. Default is 'eng'. See PDF.co docs for supported languages. (Optional, Default: 'eng')",
            default="eng",
        )
        line_grouping: str = Field(
            description="Enables line grouping within table cells when set to '1'. (Optional)",
            default="0",
        )
        password: str = Field(
            description="Password of the PDF file. (Optional)", default=""
        )
        name: str = Field(
            description="File name for the generated output. (Optional)", default=""
        )
        autosize: bool = Field(
  • BaseResponse schema model returned by the tool (status, content, credits_used, credits_remaining, tips).
    class BaseResponse(BaseModel):
        status: str
        content: Any
        credits_used: int | None = None
        credits_remaining: int | None = None
        tips: str | None = None
Behavior2/5

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

No annotations exist, so description must carry full burden. It states only the action without detailing side effects (e.g., creates new file, overwrites, requires specific permissions). Lacks behavioral context.

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

Conciseness3/5

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

Extremely concise (one sentence plus a reference link). While not verbose, it omits critical context. Front-loading is minimal; the reference URL is not actionable inline.

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

Completeness2/5

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

Given no output schema and sibling tools, the description lacks prerequisite info (e.g., file must be password-protected) and return value details. Inadequate for a 6-parameter tool.

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?

All 6 parameters have detailed descriptions in the input schema (100% coverage). The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

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 clearly states the action ('remove password protection') and the resource ('PDF file'), with a specific verb and noun. It distinguishes from sibling tools like pdf_add_password.

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?

No guidance on when to use this tool versus alternatives (e.g., when a PDF is password-protected). No when-not or prerequisite information provided.

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/pdfdotco/pdfco-mcp'

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