Read a text file from OneDrive
files_read_textRead text-like OneDrive files—plain text, Markdown, CSV, JSON, XML, source code, or config—as a string, truncated to maxChars. Binary formats are refused; parse PDFs and Office files instead.
Instructions
Returns the contents of a text-like OneDrive file (plain text, Markdown, CSV, JSON, XML, source code, config) as a string, truncated to maxChars, which defaults to 20000. Reads the file metadata first and refuses binary formats — PDFs, images, Office documents, archives, media — with an explanation, because their bytes are not readable as text. For .docx, .xlsx, .pptx and .pdf use files_parse_document, which extracts their text as pages, slides or sheets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | Id of the file to read, as returned by files_list_children or files_search. | |
| maxChars | No | Maximum characters of file content to return. Defaults to 20000; longer files are truncated with a marker. |