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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | 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 | No | HTTP auth user name if required to access source url. (Optional) | |
| httppassword | No | HTTP auth password if required to access source url. (Optional) | |
| pages | No | 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) | |
| password | No | Password of the PDF file. (Optional) | |
| api_key | No | PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional) |
Implementation Reference
- pdfco/mcp/tools/apis/search.py:61-98 (handler)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)
- pdfco/mcp/services/pdf.py:79-82 (helper)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)