Read Document Text
read_documentExtract readable text from SharePoint or OneDrive DOCX, PDF, XLSX, and text files via Microsoft Graph, returning document contents instead of downloading the binary.
Instructions
Download a file from SharePoint or OneDrive and return its readable text content. Supports DOCX, PDF, XLSX, and text-based files. Use instead of download_file when you need document contents. Pair with search_site_files (SharePoint) or search_files (OneDrive) to get IDs, then pass /drives/{driveId}/items/{itemId}/content or /me/drive/items/{id}/content. Text extraction only, no OCR: scanned PDFs return no text — for those, and for images, use save_attachment and read the file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "read_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Graph path to the file content endpoint, ending in /content | |
| format | No | Optional conversion format (e.g. 'pdf'), for supported types only | |
| max_chars | No | Max characters to return (1000-200000, default 50000); content beyond is truncated | |
| api_version | No | Graph API version |