Parse a document to markdown/text
parse_documentConvert a document (PDF, image, Office doc, spreadsheet) into clean structured text — markdown by default (parse group). Right when the user wants the content of the pages ("OCR this", "what does this document say", feed text to another step); for specific field values — or when values need source citations/provenance — use extract_data instead. No saved resource needed. NEVER pull a whole multi-page document into context when only a section matters: pass pageRange to return just those pages, or split_document the bundle first and parse only the relevant segment's fileId — this applies even when you have not yet located the section. Full output of a long document is large — maxChars caps it; rawBlocks returns block-level structure (tables, figures, coordinates). Creates a parse run: may return status: "running" with a runId — normal, not an error; poll it with get_parse_run. Parse runs cannot be cancelled. Follow any llmContext guidance included in results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Document to parse. Exactly one of id/url — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string. | |
| config | No | Parse config: { target?, chunkingStrategy?, blockOptions?, advancedOptions? } — e.g. blockOptions.tables.targetFormat, advancedOptions.pageRanges, Excel modes. Before authoring a config by hand, call get_documentation with https://docs.extend.ai/parsing/configuration.md and follow it. | |
| maxChars | No | Truncation cap for returned text (default 50000); response sets truncated: true when hit. | |
| metadata | No | Arbitrary key-value metadata stored on the run. | |
| pageRange | No | Return only these 1-indexed pages of the output (post-parse slice; the whole document is still parsed and billed). | |
| rawBlocks | No | Return block-level output (chunks/blocks with types and page metadata) instead of concatenated markdown. Default false. | |
| environment | Yes | "TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment). | |
| waitSeconds | No | Max seconds to block waiting on the run (clamped to the server wait budget). | |
| workspaceId | Yes | Target workspace (ws_...). Must be a granted workspace — get_me lists the accepted values. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| runId | Yes | ||
| chunks | No | Block-level output (rawBlocks: true). | |
| status | Yes | Terminal status, or "running" (resume via the get tool). | |
| runType | No | ||
| markdown | No | Concatenated page-delimited markdown (default output). | |
| pageCount | No | ||
| truncated | No | ||
| llmContext | No | ||
| failureReason | No | ||
| failureMessage | No |