Tool: download_file_content
Call this tool to download the content of a Drive file as raw binary data (bytes).
If the file is a Google Drive first-party mime type, the exportMimeType
field is required and will determine the format of the downloaded file.
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 sample demonstrate how to use curl
to invoke the download_file_content
MCP tool.
| Curl Request |
|---|
curl --location 'https://drivemcp.googleapis.com/mcp' \ --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 tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Defines a request to download a file's content.
DownloadFileRequest
| JSON representation |
|---|
{ "fileId" : string , "exportMimeType" : 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. |
Output Schema
CallToolResponse
| JSON representation |
|---|
{ "common" : { object ( |
| Fields | |
|---|---|
common
|
|
content[]
|
|
structuredContent
|
If the tool defines an output schema, this field will be populated. Clients that support structured output should ignore the content field above if this field is set. |
isError
|
Optional. |
ResponseFields
| JSON representation |
|---|
{
"instructions"
:
string
,
"metadata"
:
{
object
}
,
"dependentRequests"
:
{
string
:
{
object (
|
| Fields | |
|---|---|
instructions
|
Optional. Sent only on the initial response on any RPC. |
metadata
|
Escape hatch for arbitrary side-channel data. |
dependentRequests
|
Dependent requests. The presence of this field tells the client that the request is incomplete and that the client must try its request again with the result of these dependent requests in the dependent_responses field. An object containing a list of |
resumeData
|
State for the client to echo back in subsequent RPCs for the same peristant request. |
Struct
| JSON representation |
|---|
{ "fields" : { string : value , ... } } |
| Fields | |
|---|---|
fields
|
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key" : string , "value" : value } |
| Fields | |
|---|---|
key
|
|
value
|
|
Value
| JSON representation |
|---|
{ "nullValue" : null , "numberValue" : number , "stringValue" : string , "boolValue" : boolean , "structValue" : { object } , "listValue" : array } |
kind
. The kind of value. kind
can be only one of the following:nullValue
null
Represents a JSON null
.
numberValue
number
Represents a JSON number. Must not be NaN
, Infinity
or -Infinity
, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type.
stringValue
string
Represents a JSON string.
boolValue
boolean
Represents a JSON boolean ( true
or false
literal in JSON).
structValue
object (
Struct
format)
Represents a JSON object.
listValue
array (
ListValue
format)
Represents a JSON array.
ListValue
| JSON representation |
|---|
{ "values" : [ value ] } |
| Fields | |
|---|---|
values[]
|
Repeated field of dynamically typed values. |
DependentRequestsEntry
| JSON representation |
|---|
{
"key"
:
string
,
"value"
:
{
object (
|
| Fields | |
|---|---|
key
|
|
value
|
|
ServerInitiatedRequest
| JSON representation |
|---|
{ "samplingCreateMessage" : { object ( |
| Fields | |
|---|---|
samplingCreateMessage
|
Sampling, as per https://modelcontextprotocol.io/specification/2025-03-26/client/sampling . |
listRootsRequest
|
Root list request, as per https://modelcontextprotocol.io/specification/2025-03-26/client/roots . |
notifyOnRootListUpdate
|
|
elicitRequest
|
Elicitations, as per https://modelcontextprotocol.io/specification/2025-06-18/client/elicitation . |
SamplingCreateMessageRequest
| JSON representation |
|---|
{ "messages" : [ { object ( |
| Fields | |
|---|---|
messages[]
|
|
modelPreferences
|
Optional. |
systemPrompt
|
Optional. |
includeContext
|
Optional. |
temperature
|
Optional. |
maxTokens
|
Optional. |
stopSequence[]
|
Optional. |
SamplingMessage
| JSON representation |
|---|
{ "role" : enum ( |
| Fields | |
|---|---|
role
|
Which role is sending the message. |
text
|
Exactly one of these fields must be populated. (Not using "oneof", since that causes forward-compatibility problems.) |
image
|
|
audio
|
|
TextContent
| JSON representation |
|---|
{
"text"
:
string
,
"annotations"
:
{
object (
|
| Fields | |
|---|---|
text
|
|
annotations
|
Optional. |
Annotations
| JSON representation |
|---|
{
"audience"
:
[
enum (
|
| Fields | |
|---|---|
audience[]
|
|
priority
|
Must be in range [0,1]. |
ImageContent
| JSON representation |
|---|
{
"data"
:
string
,
"mimeType"
:
string
,
"annotations"
:
{
object (
|
| Fields | |
|---|---|
data
|
A base64-encoded string. |
mimeType
|
|
annotations
|
Optional. |
AudioContent
| JSON representation |
|---|
{
"data"
:
string
,
"mimeType"
:
string
,
"annotations"
:
{
object (
|
| Fields | |
|---|---|
data
|
A base64-encoded string. |
mimeType
|
|
annotations
|
Optional. |
ModelPreferences
| JSON representation |
|---|
{
"hints"
:
[
{
object (
|
| Fields | |
|---|---|
hints[]
|
|
intelligencePriority
|
|
speedPriority
|
|
costPriority
|
|
ModelHint
| JSON representation |
|---|
{ "name" : string } |
| Fields | |
|---|---|
name
|
Optional. |
ElicitRequest
| JSON representation |
|---|
{
"message"
:
string
,
"requestedSchema"
:
{
string
:
{
object (
|
| Fields | |
|---|---|
message
|
Message to present to user. Required. |
requestedSchema
|
An object containing a list of |
requiredFields[]
|
|
RequestedSchemaEntry
| JSON representation |
|---|
{
"key"
:
string
,
"value"
:
{
object (
|
| Fields | |
|---|---|
key
|
|
value
|
|
PrimitiveSchemaDefinition
| JSON representation |
|---|
{ "stringSchema" : { object ( |
| Fields | |
|---|---|
stringSchema
|
Exactly one of these fields will be present. (Not using "oneof", since that causes forward-compatibility problems.) |
numberSchema
|
|
booleanSchema
|
|
enumSchema
|
|
StringSchema
| JSON representation |
|---|
{
"title"
:
string
,
"description"
:
string
,
"minLength"
:
string
,
"maxLength"
:
string
,
"format"
:
enum (
|
| Fields | |
|---|---|
title
|
|
description
|
|
minLength
|
|
maxLength
|
|
format
|
|
NumberSchema
| JSON representation |
|---|
{ "title" : string , "description" : string , "minimum" : string , "maximum" : string } |
| Fields | |
|---|---|
title
|
|
description
|
|
minimum
|
|
maximum
|
|
BooleanSchema
| JSON representation |
|---|
{ "title" : string , "description" : string , "default" : boolean } |
| Fields | |
|---|---|
title
|
|
description
|
|
default
|
|
EnumSchema
| JSON representation |
|---|
{ "title" : string , "description" : string , "enumList" : [ string ] , "enumNames" : [ string ] } |
| Fields | |
|---|---|
title
|
|
description
|
|
enumList[]
|
|
enumNames[]
|
|
Content
| JSON representation |
|---|
{ "text" : { object ( |
| Fields | |
|---|---|
text
|
Unstructured result contents. At least one will be populated if the tool does not define an output schema. If the tool does define an output schema, the structured_content field will be populated instead, but one of these fields may still be populated for backward compatibility. No more than one of these fields must be populated. (Not using "oneof", since that causes forward-compatibility problems.) |
image
|
|
audio
|
|
embeddedResource
|
|
resourceLink
|
|
EmbeddedResource
| JSON representation |
|---|
{ "contents" : { object ( |
| Fields | |
|---|---|
contents
|
|
annotations
|
Optional. |
ResourceContents
| JSON representation |
|---|
{ "uri" : string , "mimeType" : string , "text" : string , "blob" : string } |
| Fields | |
|---|---|
uri
|
|
mimeType
|
|
text
|
Exactly one of these fields must be populated. (Not using "oneof", since that causes forward-compatibility problems.) |
blob
|
A base64-encoded string. |
Resource
| JSON representation |
|---|
{
"uri"
:
string
,
"name"
:
string
,
"title"
:
string
,
"description"
:
string
,
"mimeType"
:
string
,
"annotations"
:
{
object (
|
| Fields | |
|---|---|
uri
|
|
name
|
|
title
|
|
description
|
Optional. |
mimeType
|
Optional. |
annotations
|
Optional. |
size
|
Optional. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌

