Tool: download_file_content
Call this tool to download the content of a Drive file as a base64 encoded string.
If the file is a Google Drive first-party mime type, the exportMimeType field specifies the desired export mime type. When the field is unset, defaults to plain text types (e.g. text/plain, text/csv).
If the file is not found, try using other tools like search_files to find the file the user is requesting.
If the user wants a natural language representation of their Drive content, use the read_file_content tool (read_file_content should be smaller and easier to parse).
The following code sample shows how to use curl to call the download_file_content MCP tool.
| Curl Request |
|---|
curl --location 'https://drivemcp.googleapis.com/mcp/v1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "download_file_content", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Defines a request to download a file's content.
DownloadFileRequest
| JSON representation |
|---|
{ "fileId": string, "exportMimeType": string, "revisionId": string } |
| Fields | |
|---|---|
fileId |
Required. The ID of the file to retrieve. |
exportMimeType |
Optional. For Google native files, the MIME type to export the file to, ignored otherwise. Defaults to text if not specified. |
revisionId |
Optional. The revision id for the version of the file to download. If not specified, the latest revision will be downloaded. |
Output Schema
Downloaded file metadata and base64-encoded content.
FileContent
| JSON representation |
|---|
{ "id": string, "title": string, "mimeType": string, "content": string } |
| Fields | |
|---|---|
id |
The ID of the file. |
title |
The title of the file. |
mimeType |
The MIME type of the file. |
content |
The base64-encoded content of the file. |
Tool Annotations
Tool annotations are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.
Along with the title string, the following boolean hints are defined as follows:
readOnlyHint: If true, the tool doesn't modify its environment. Default: false.destructiveHint: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.idempotentHint: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: false.openWorldHint: If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.readonly