find_table
Extract tables and their coordinates from PDF documents using a specified URL. Supports public links, password-protected files, and selective page ranges for precise data retrieval.
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 |
|---|---|---|---|
| api_key | No | PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional) | |
| httppassword | No | HTTP auth password if required to access source url. (Optional) | |
| httpusername | No | HTTP auth user name 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) | |
| 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. |
Implementation Reference
- pdfco/mcp/tools/apis/search.py:61-98 (handler)The handler function for the 'find_table' tool, decorated with @mcp.tool(name="find_table"). Defines input schema using Pydantic Field descriptions and handles parameter preparation before delegating to find_table_in_pdf.@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 performs the actual API request to the PDF.co 'pdf/find/table' endpoint using the shared request function.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)