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. Use pageRange to return only the pages of interest; full output of a long document is large, and maxChars caps it. To work on one section of a bundle, split_document it first and parse the relevant segment's fileId. rawBlocks returns block-level structure (tables, figures, coordinates). Async: a status: "running" result with a runId is not an error — resume with get_parse_run passing that runId, the same workspaceId and environment, and wait: true, repeating until the status is terminal; never re-submit the document. On UNAUTHORIZED or NOT_FOUND, re-call get_me for the granted targets. Parse runs cannot be cancelled. truncated: true means the markdown was cut at maxChars — re-call with pageRange for the pages you need, or rawBlocks: true for block-level output. pageRange/maxChars/rawBlocks are not remembered between calls; pass them again when resuming with get_parse_run. Output shape is documented at https://docs.extend.ai/parsing/response-format.md (get_documentation).
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 | true when markdown was cut at maxChars; re-call with pageRange or rawBlocks for the rest. | |
| failureReason | No | ||
| failureMessage | No |