Skip to main content
Glama

graph_get_file_content

Retrieves file content from OneDrive or SharePoint: returns text files directly and provides a temporary download URL for binary files, enabling access by file ID.

Instructions

Get the content of a file from OneDrive or a SharePoint document library.

For text-based files (txt, csv, json, etc.), returns the file content directly. For binary files (images, docx, pdf, etc.), returns a temporary download URL instead. Use graph_get_file_bytes when you have no way to fetch that URL yourself.

Args: file_id: The file ID (from graph_list_files or graph_search_files). drive_id: Drive ID to act on. Empty targets your own OneDrive.

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": {
      "file_id": "<file_id>"
    },
    "name": "graph_get_file_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_idYes
drive_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does disclose the most consequential behavior: text files come back inline while binary files come back as a temporary download URL, which is a non-obvious and failure-prone distinction. It says nothing about permissions, size limits, URL expiry, or error cases, which are the remaining gaps for a read tool with zero annotation coverage.

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

Conciseness4/5

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

The core behavior is front-loaded in the first two sentences, and the conditional fallback to the sibling follows immediately. The docstring-style Args block is slightly heavy relative to two parameters but is not wasted text.

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

Completeness4/5

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

For a two-parameter read tool with no output schema and no annotations, the description supplies the essential return-shape distinction and parameter origins. It is not fully complete — access requirements and the lifecycle of the temporary URL are unstated — but an agent can invoke it correctly from what is given.

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 0%, so the description must compensate, and it largely does: file_id is given provenance ('from graph_list_files or graph_search_files') and drive_id's empty-string default is explained as targeting your own OneDrive. That is meaningful semantics the bare schema does not convey, though neither parameter's expected format is fully specified.

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 ('Get the content of a file') and immediately scopes it to OneDrive/SharePoint document libraries. The dual-mode behavior (text returns content, binary returns a URL) makes it clearly distinguishable from graph_get_file_bytes, which is named explicitly.

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?

Gives an explicit routing rule: prefer this tool, and fall back to graph_get_file_bytes only 'when you have no way to fetch that URL yourself.' That is a real when-to-use condition rather than an implied one. It does not address other reading siblings such as graph_get_transcript_content, so it stops short of full alternative coverage.

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