Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

pdf_make_unsearchable

Remove the text layer from PDF documents to make them non-searchable and protect sensitive information from text extraction.

Instructions

Make existing PDF document non-searchable by removing the text layer from it.
Ref: https://developer.pdf.co/api-reference/pdf-change-text-searchable/unsearchable.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL 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.
httpusernameNoHTTP auth user name if required to access source url. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
pagesNoComma-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)
passwordNoPassword of the PDF file. (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

  • The primary MCP tool handler for 'pdf_make_unsearchable'. Decorated with @mcp.tool() for registration, defines the input schema via Pydantic Fields, constructs ConversionParams, and calls the service helper.
    @mcp.tool()
    async def pdf_make_unsearchable(
        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."
        ),
        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="",
        ),
        password: str = Field(
            description="Password of the PDF file. (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:
        """
        Make existing PDF document non-searchable by removing the text layer from it.
        Ref: https://developer.pdf.co/api-reference/pdf-change-text-searchable/unsearchable.md
        """
        params = ConversionParams(
            url=url,
            httpusername=httpusername,
            httppassword=httppassword,
            pages=pages,
            password=password,
            name=name,
        )
    
        return await make_pdf_unsearchable(params, api_key=api_key)
  • Import statement that loads the 'searchable' module, triggering the @mcp.tool() decorator to register the 'pdf_make_unsearchable' tool with the MCP server.
    from pdfco.mcp.tools.apis import (
        conversion,
        job,
        file,
        modification,
        form,
        search,
        searchable,
        security,
        document,
        extraction,
        editing,
    )
  • Helper service function that performs the core logic by calling the PDF.co API endpoint '/v1/pdf/makeunsearchable' via the generic 'request' utility.
    async def make_pdf_unsearchable(
        params: ConversionParams, api_key: str | None = None
    ) -> BaseResponse:
        return await request("pdf/makeunsearchable", params, api_key=api_key)
  • Pydantic model for the tool's output response schema.
    class BaseResponse(BaseModel):
        status: str
        content: Any
        credits_used: int | None = None
        credits_remaining: int | None = None
        tips: str | None = None
  • Pydantic model defining the common input parameters used by the tool, including fields mapped in the handler.
    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(
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool modifies a PDF by removing the text layer, implying a destructive mutation, but doesn't mention whether this is reversible, what permissions are required, or what the output looks like (e.g., a new file vs. in-place modification). The reference link adds some context but isn't integrated into the description itself.

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?

The description is concise and front-loaded with the core purpose in the first sentence. The second sentence provides a reference link, which is useful but could be integrated more seamlessly. There's minimal waste, though it could be slightly more structured (e.g., explicitly noting it's a mutation tool).

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?

Given the tool's complexity (destructive mutation with 7 parameters) and lack of annotations or output schema, the description is minimally adequate. It states what the tool does but lacks details on behavioral implications, output format, or error handling. For a mutation tool with no structured safety hints, more context would be helpful to ensure safe usage.

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 all 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, such as clarifying how 'pages' interacts with text layer removal or explaining the 'name' parameter's role in output generation. Baseline 3 is appropriate when the schema does the heavy lifting.

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 specific action ('Make existing PDF document non-searchable') and the mechanism ('by removing the text layer from it'). It distinguishes this tool from sibling tools like 'pdf_make_searchable' by specifying the opposite operation, providing clear differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. While it references a sibling tool ('pdf_make_searchable') in the context signals, the description itself doesn't mention when to choose one over the other, nor does it discuss prerequisites or use cases for making a PDF unsearchable.

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