Skip to main content
Glama

Read a text file from OneDrive

files_read_text
Read-onlyIdempotent

Reads text-based OneDrive files (Markdown, CSV, JSON, code) and returns their content as a string, truncating long files. Rejects binary formats like PDFs and Office docs with a clear explanation.

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. Word, Excel and PowerPoint files are zip containers and cannot be read here.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYesId of the file to read, as returned by files_list_children or files_search.
maxCharsNoMaximum characters of file content to return. Defaults to 20000; longer files are truncated with a marker.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses meaningful behavior: it reads metadata first, refuses binary formats with an explanation, truncates to maxChars with a default, and explains that Office files are zip containers. This gives the agent an accurate model of what the tool will and will not do.

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?

Three sentences, front-loaded with the core return behavior, then the binary-format refusal and the Office-file explanation. Every sentence contributes actionable guidance with no filler or redundancy.

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 relatively simple read tool with well-documented parameters and strong annotations, the description covers what it returns, how it truncates, what it refuses, and why. The absence of an output schema is compensated by the explicit 'returns a string' statement, making the description complete for invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents itemId and maxChars, including default, range, and truncation marker. The description reinforces the truncation behavior but adds little beyond what the schema provides; the baseline 3 is appropriate.

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?

The description states a precise action — 'returns the contents of a text-like OneDrive file' — and clearly scopes the resource to text-like formats while excluding binaries. This distinguishes it from sibling tools like files_get_item (metadata) and files_upload_text (writing) without ambiguity.

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

Usage Guidelines4/5

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

It gives clear when-to-use context (plain text, Markdown, CSV, JSON, XML, source code, config) and explicit when-not-to-use context (PDFs, images, Office documents, archives, media). It does not name alternative sibling tools, but the exclusion criteria are concrete enough for an agent to select this tool correctly.

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