Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

find_table

Locate tables within PDF documents and retrieve their precise coordinates for data extraction or analysis.

Instructions

Find tables in PDF and get their coordinates.
Ref: https://developer.pdf.co/api-reference/pdf-find/table.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)
pagesNoComma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-'. The first-page index is 0. (Optional)
passwordNoPassword of the PDF file. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)

Implementation Reference

  • The primary handler for the 'find_table' MCP tool. Includes registration via @mcp.tool decorator, input schema definition using pydantic Field descriptions, parameter processing into ConversionParams, and delegation to the find_table_in_pdf helper.
    @mcp.tool(name="find_table")
    async def find_table(
        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="",
        ),
        pages: str = Field(
            description="Comma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-'. The first-page index is 0. (Optional)",
            default="",
        ),
        password: str = Field(
            description="Password of the PDF file. (Optional)", default=""
        ),
        api_key: str = Field(
            description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)",
            default="",
        ),
    ) -> BaseResponse:
        """
        Find tables in PDF and get their coordinates.
        Ref: https://developer.pdf.co/api-reference/pdf-find/table.md
        """
        params = ConversionParams(
            url=url,
            httpusername=httpusername,
            httppassword=httppassword,
            pages=pages,
            password=password,
        )
    
        return await find_table_in_pdf(params, api_key=api_key)
  • Helper function that executes the core logic by making an asynchronous request to the PDF.co API endpoint for finding tables in PDFs.
    async def find_table_in_pdf(
        params: ConversionParams, api_key: str | None = None
    ) -> BaseResponse:
        return await request("pdf/find/table", params, api_key=api_key)

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