> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/mistral_parse.md).

# mistral\_parse

The Mistral Parse tool provides a powerful way to extract and process content from PDF documents using [Mistral's OCR API](https://mistral.ai/). This tool leverages advanced optical character recognition to accurately extract text and structure from PDF files, making it easy to incorporate document data into your agent workflows.

With the Mistral Parse tool, you can:

* **Extract text from PDFs**: Accurately convert PDF content to text, markdown, or JSON formats
* **Process PDFs from URLs**: Directly extract content from PDFs hosted online by providing their URLs
* **Maintain document structure**: Preserve formatting, tables, and layout from the original PDFs
* **Extract images**: Optionally include embedded images from the PDFs
* **Select specific pages**: Process only the pages you need from multi-page documents

The Mistral Parse tool is particularly useful for scenarios where your agents need to work with PDF content, such as analyzing reports, extracting data from forms, or processing text from scanned documents. It simplifies the process of making PDF content available to your agents, allowing them to work with information stored in PDFs just as easily as with direct text input.

### Usage Instructions

Extract text and structure from PDF documents using Mistral's OCR API. Configure processing options and get the content in your preferred format. For URLs, they must be publicly accessible and point to a valid PDF file. Note: Google Drive, Dropbox, and other cloud storage links are not supported; use a direct download URL from a web server instead.

### Tools

#### `mistral_parser`

Parse PDF documents using Mistral OCR API

**Input**

| Parameter            | Type    | Required | Description                                                            |
| -------------------- | ------- | -------- | ---------------------------------------------------------------------- |
| `filePath`           | string  | Yes      | URL to a PDF document to be processed                                  |
| `fileUpload`         | object  | No       | File upload data from file-upload component                            |
| `resultType`         | string  | No       | Type of parsed result (markdown, text, or json). Defaults to markdown. |
| `includeImageBase64` | boolean | No       | Include base64-encoded images in the response                          |
| `pages`              | array   | No       | Specific pages to process (array of page numbers, starting from 0)     |
| `imageLimit`         | number  | No       | Maximum number of images to extract from the PDF                       |
| `imageMinSize`       | number  | No       | Minimum height and width of images to extract from the PDF             |
| `apiKey`             | string  | Yes      | Mistral API key (MISTRAL\_API\_KEY)                                    |

**Output**

| Parameter  | Type   | Description         |
| ---------- | ------ | ------------------- |
| `content`  | string | Extracted content   |
| `metadata` | json   | Processing metadata |

### Notes

* Category: `tools`
* Type: `mistral_parse`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/mistral_parse.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
