Skip to main content
Glama

Read Document Text

read_document
Read-only

Extract 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

NameRequiredDescriptionDefault
pathYesGraph path to the file content endpoint, ending in /content
formatNoOptional conversion format (e.g. 'pdf'), for supported types only
max_charsNoMax characters to return (1000-200000, default 50000); content beyond is truncated
api_versionNoGraph API version

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=true, so the description carries most of the load and does so well: it discloses that extraction is text-only with no OCR, that scanned PDFs yield nothing, and that output is character-capped/truncated. It stops short of describing response shape or how failure looks for an unparseable file, which keeps it off a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with capability and types, then alternatives, then the ID/path mechanics, then the OCR limitation. Every sentence carries distinct operational information with no restatement of the name or title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter read tool with no output schema, the definition covers what comes back (readable text), supported formats, the input path construction, the truncation control, and the failure mode that sends the agent elsewhere. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds meaning by spelling out the expected path shape ('/drives/{driveId}/items/{itemId}/content' or '/me/drive/items/{id}/content') and tying it to the ID source. That is practical guidance the schema's 'Graph path... ending in /content' does not supply.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Download a file from SharePoint or OneDrive and return its readable text content') and immediately bounds the supported types (DOCX, PDF, XLSX, text). It explicitly distinguishes itself from the sibling download_file, so an agent can pick between the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('use instead of download_file when you need document contents'), the prerequisite discovery path via search_site_files or search_files, and a when-not-to-use with the named alternative for scanned PDFs and images (save_attachment). Both the selection condition and the exclusion are spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools