Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

ai_invoice_parser

Extract structured data from invoices using AI. Input a PDF file URL to process and retrieve key details automatically. Designed for PDF.co MCP Server integration.

Instructions

AI Invoice Parser: Extracts data from invoices using AI. Ref: https://developer.pdf.co/api-reference/ai-invoice-parser.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
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.

Implementation Reference

  • The primary handler function for the 'ai_invoice_parser' tool. Registered via @mcp.tool(), defines input schema using Pydantic Field descriptions, and implements the logic by constructing params and delegating to the parse_invoice helper.
    @mcp.tool() async def ai_invoice_parser( 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." ), api_key: str = Field( description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)", default="", ), ) -> BaseResponse: """ AI Invoice Parser: Extracts data from invoices using AI. Ref: https://developer.pdf.co/api-reference/ai-invoice-parser.md """ # Pass arguments directly; ConversionParams now handles str with default=None params = ConversionParams( url=url, ) return await parse_invoice(params, api_key=api_key)
  • Supporting helper function that wraps the generic API request to the PDF.co 'ai-invoice-parser' endpoint.
    async def parse_invoice(params: ConversionParams, api_key: str | None = None) -> BaseResponse: return await request("ai-invoice-parser", params, api_key=api_key)
  • The @mcp.tool() decorator registers the ai_invoice_parser as an MCP tool.
    @mcp.tool()
  • Input schema defined using Pydantic Field for the tool parameters: url and optional api_key.
    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." ), api_key: str = Field( description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)", default="", ), ) -> BaseResponse:

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