- Document Retrieval server (Model Context Protocol, MCP): Gives your agent tools to read PDFs, images, and text files from a URL.
- Optical character recognition (OCR) service: Converts documents to markdown. The MCP server calls this service. You can also call it directly over REST.
- Template instructions: A prompt that classifies the document and extracts a requested value with strict formatting rules. See Build an intelligent document processing agent.
Key capabilities
Read any document
Convert PDFs and JPEG, PNG, and TIFF images to markdown, and fetch TXT, JSON, CSV, MD, and XML files.
Classify documents
Sort each document into the types your process expects, such as payslips, balance sheets, IDs, or registry extracts.
Extract exact values
Return the requested value exactly as printed, keeping currency symbols, number separators, and scale.
Two OCR modes with fallback
Use the fast default mode for most documents, or the premium mode for complex layouts. If one mode fails, the service retries with the other.
How it works
The following diagram shows how an IDP agent reads a document:- Your app sends the IDP agent a query, such as “What is the net pay?”, and the URL of the document.
- The agent calls the
convert_file_to_markdowntool on the Document Retrieval MCP server, orfetch_text_contentfor text files. - The OCR service downloads the document, converts it to markdown, and returns the markdown to the agent.
- The agent classifies the document, finds the requested value, checks its formatting, and returns a JSON object such as
{"document_type": "payslips", "extracted_value": "€1.756,20"}. - Your app checks the document type and uses the extracted value, for example to fill in a form or flag a mismatch for review.
Use cases
- Know Your Business (KYB): Read a Chamber of Commerce extract during business onboarding and return the registration number, legal name, or registered address.
- Income verification: Read payslips and return the gross or net pay for a loan or mortgage application.
- Financial analysis: Read balance sheets and return totals such as assets or equity, with the stated scale applied.
- Identity checks: Read an ID document and return the document number, name, or expiry date.
- Document checks: Confirm that a customer uploaded the type of document you asked for before a person reviews it.
Choose how to use the services
The following table compares the two ways to use the document processing services.Related topics
- Build an intelligent document processing agent to connect the MCP server and add the template instructions.
- Use the OCR API and MCP server to call the services directly.
- Reference for request and response fields, limits, and error codes.