Skip to main content
Glama

graph_get_file_bytes

Download a file's binary content as base64-encoded bytes (4MB limit) when its download URL cannot be fetched. Use it for OneDrive files needing direct byte access.

Instructions

Download a file as base64-encoded bytes (max 4MB).

Use this for a binary file when you cannot fetch the downloadUrl that graph_get_file_content hands back. The bytes are returned in the 'contentBytes' field. Larger files are rejected, so use the downloadUrl for those.

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_bytes"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_idYes
drive_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A4.8/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and discloses important traits: base64 encoding, a 4MB maximum, rejection of larger files, and the return field 'contentBytes'. It does not mention permission requirements or failure behavior beyond the size limit, which keeps it below a full 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?

The description is short, front-loaded with the main purpose, and then immediately gives the key alternative and size constraint. The Args block is compact and every sentence adds useful information.

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 simple two-parameter read/download tool with no annotations or output schema, the description covers the essential context: purpose, alternative path, size limit, return field, and parameter meaning. Nothing critical needed to invoke it correctly appears to be missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It does: file_id is sourced from graph_list_files or graph_search_files, and drive_id is explained as the target drive with empty meaning the user's own OneDrive.

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 specific verb and resource: download a file as base64-encoded bytes. It also distinguishes this tool from graph_get_file_content by explaining that this is the fallback when the returned downloadUrl cannot be fetched.

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?

It gives explicit when-to-use guidance: use this for binary files when you cannot fetch the downloadUrl from graph_get_file_content. It also gives the inverse condition for large files, saying they are rejected and the downloadUrl should be used instead.

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