Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

read_pdf_forms_info

Extracts field names, types, and values from fillable PDF forms. Provides structured data for form automation or data extraction.

Instructions

Extracts information about fillable PDF fields from an input PDF file.
Ref: https://developer.pdf.co/api-reference/forms/info-reader.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 PDF file. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)

Implementation Reference

  • The service/helper function 'get_pdf_form_fields_info' that makes the actual API call to 'pdf/info/fields' endpoint. Called by the read_pdf_forms_info handler.
    async def get_pdf_form_fields_info(
        params: ConversionParams, api_key: str | None = None
    ) -> BaseResponse:
        return await request("pdf/info/fields", params, api_key=api_key)
  • The HTTP client (PDFCoClient) used to make the API request to PDF.co. Handles API key resolution from parameter or environment variable, and manages the async HTTP session.
    from contextlib import asynccontextmanager
    from httpx import AsyncClient
    import os
    import sys
    from typing import AsyncGenerator
    import importlib.metadata
    
    __BASE_URL = "https://api.pdf.co"
    X_API_KEY = os.getenv("X_API_KEY")
    
    __version__ = importlib.metadata.version("pdfco-mcp")
    print(f"pdfco-mcp version: {__version__}", file=sys.stderr)
    
    
    @asynccontextmanager
    async def PDFCoClient(api_key: str | None = None) -> AsyncGenerator[AsyncClient, None]:
        # Use provided API key, fall back to environment variable
        x_api_key = api_key or X_API_KEY
    
        if not x_api_key:
            raise ValueError("""API key is required. Please provide an API key as a parameter or set X_API_KEY in the environment variables.
            
            To get the API key:
            1. Sign up at https://pdf.co
            2. Get the API key from the dashboard
            3. Either set it as an environment variable or provide it as a parameter
            
            Environment variable setup example (.cursor/mcp.json):
            ```json
            {
                "mcpServers": {
                    "pdfco": {
                        "command": "uvx",
                        "args": [
                            "pdfco-mcp"
                        ],
                        "env": {
                            "X_API_KEY": "YOUR_API_KEY"
                        }
                    }
                }
            }
            ```
            
            Or provide the API key as a parameter when calling the tool.
            """)
    
        client = AsyncClient(
            base_url=__BASE_URL,
            headers={
                "x-api-key": x_api_key,
                "User-Agent": f"pdfco-mcp/{__version__}",
            },
        )
        try:
            yield client
        finally:
            await client.aclose()
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It only states 'extracts information', implying read-only, but does not mention auth requirements, rate limits, or side effects. Reference link is external.

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?

Two concise sentences, front-loaded with key action and resource. No wasted words.

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?

No output schema; description does not mention return format (e.g., field names, types). For a simple extraction tool, it is adequate but lacks error handling or large file guidance.

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 has 100% coverage with descriptions for all 5 parameters. Description adds no extra meaning beyond schema; baseline score 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?

Description clearly states verb 'extracts information about fillable PDF fields' and resource 'input PDF file'. Distinguishes from siblings like 'fill_forms' and 'create_fillable_forms', but does not differentiate from 'pdf_info_reader' which sounds similar.

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 vs alternatives (e.g., pdf_info_reader, fill_forms). Users are not told when not to use it or what prerequisites exist.

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