Parse a document to text
files_parse_documentExtracts text from Word, Excel, PowerPoint or PDF files as page, sheet, slide or section units with paging, so AI can read large documents in parts.
Instructions
Extracts the text of a .docx, .xlsx, .pptx or .pdf as unit ROWS — sections, sheets, slides or pages, never one giant string — plus a manifest accounting for every unit: unitCount, per-unit truncated flags, returnedRange, a reason ("complete" means the document ran out, "maxItems" means units remain), and a cursor to continue with. Give exactly one source: shareUrl (a Teams attachment contentUrl or mail reference-attachment link), driveId+itemId (including remote ids from files_list_shared and teams_get_channel_files_folder), or messageId+attachmentId (a mail file attachment). Spreadsheet formulas come back as their saved values, never evaluated. Friendly errors, never attempts: password/IRM-protected files, scanned PDFs (no OCR here), legacy .doc/.ppt/.xls, files over 16 MiB. Long documents cap at 50 PDF pages and 100k spreadsheet rows per parse.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Continue a previous call: pass its `cursor` verbatim, without any source argument. Carries the source and paging. | |
| itemId | No | Item id within driveId. | |
| driveId | No | Drive id; pass together with itemId. | |
| shareUrl | No | A sharing link to parse (Teams attachment contentUrl, mail reference-attachment sourceUrl). Exactly one source: shareUrl, driveId+itemId, or messageId+attachmentId. | |
| messageId | No | Mail message id; pass together with attachmentId. | |
| unitLimit | No | Most units to return. Defaults to 20. | |
| unitOffset | No | First unit (page/slide/sheet/section) to return. Defaults to 0; prefer `cursor` to continue. | |
| attachmentId | No | File attachment id within messageId. | |
| maxCharsPerUnit | No | Most characters per unit. Defaults to 6000; longer units are cut with a marker and flagged. |