MCP Tools Reference: drivemcp.googleapis.com

工具:download_file_content

调用此工具可将云端硬盘文件的内容下载为原始二进制数据(字节)。

如果文件是 Google 云端硬盘第一方 MIME 类型,则必须提供 exportMimeType 字段,该字段将决定下载文件的格式。

如果找不到该文件,请尝试使用其他工具(例如 search_files)查找用户请求的文件。

如果用户想要以自然语言表示其云端硬盘内容,请使用 read_file_content 工具(read_file_content 应该更小且更易于解析)。

以下示例演示了如何使用 curl 调用 download_file_content MCP 工具。

Curl 请求
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
}'
                

输入架构

定义了下载文件内容的请求。

DownloadFileRequest

JSON 表示法
{
  "fileId": string,
  "exportMimeType": string
}
字段
fileId

string

必需。要检索的文件的 ID。

exportMimeType

string

可选。对于 Google 原生文件,要将文件导出到的 MIME 类型,否则会被忽略。如果未指定,则默认为文本。

输出架构

CallToolResponse

JSON 表示法
{
  "common": {
    object (ResponseFields)
  },
  "content": [
    {
      object (Content)
    }
  ],
  "structuredContent": {
    object
  },
  "isError": boolean
}
字段
common

object (ResponseFields)

content[]

object (Content)

structuredContent

object (Struct format)

如果工具定义了输出架构,则此字段将填充。如果设置了此字段,支持结构化输出的客户端应忽略上述内容字段。

isError

boolean

可选。

ResponseFields

JSON 表示法
{
  "instructions": string,
  "metadata": {
    object
  },
  "dependentRequests": {
    string: {
      object (ServerInitiatedRequest)
    },
    ...
  },
  "resumeData": {
    object
  }
}
字段
instructions

string

可选。仅在任何 RPC 的初始响应中发送。

metadata

object (Struct format)

用于任意边信道数据的应急出口。

dependentRequests

map (key: string, value: object (ServerInitiatedRequest))

相关请求。此字段的存在表示请求不完整,客户端必须在 dependent_responses 字段中包含这些相关请求的结果,然后再次尝试发出请求。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

resumeData

object (Struct format)

客户端的状态,用于在后续 RPC 中回显同一持久请求。

结构体

JSON 表示法
{
  "fields": {
    string: value,
    ...
  }
}
字段
fields

map (key: string, value: value (Value format))

无序的动态类型值映射。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

FieldsEntry

JSON 表示法
{
  "key": string,
  "value": value
}
字段
key

string

value

value (Value format)

JSON 表示法
{

  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object
  },
  "listValue": array
}
字段
联合字段 kind。值的类型。kind 只能是下列其中一项:
nullValue

null

表示 JSON null

numberValue

number

表示 JSON 数值。不得为 NaNInfinity-Infinity,因为 JSON 不支持这些值。由于 JSON 格式通常不支持其数字类型中的大型 Int64 值,因此这种格式也无法表示大型 Int64 值。

stringValue

string

表示 JSON 字符串。

boolValue

boolean

表示 JSON 布尔值(JSON 中的 truefalse 字面量)。

structValue

object (Struct format)

表示 JSON 对象。

listValue

array (ListValue format)

表示 JSON 数组。

ListValue

JSON 表示法
{
  "values": [
    value
  ]
}
字段
values[]

value (Value format)

动态类型值的重复字段。

DependentRequestsEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (ServerInitiatedRequest)
  }
}
字段
key

string

value

object (ServerInitiatedRequest)

ServerInitiatedRequest

JSON 表示法
{
  "samplingCreateMessage": {
    object (SamplingCreateMessageRequest)
  },
  "listRootsRequest": {
    object (ListRootsRequest)
  },
  "notifyOnRootListUpdate": boolean,
  "elicitRequest": {
    object (ElicitRequest)
  }
}
字段
samplingCreateMessage

object (SamplingCreateMessageRequest)

采样,如 https://modelcontextprotocol.io/specification/2025-03-26/client/sampling 中所述。

listRootsRequest

object (ListRootsRequest)

根列表请求,如 https://modelcontextprotocol.io/specification/2025-03-26/client/roots 中所述。

notifyOnRootListUpdate

boolean

elicitRequest

object (ElicitRequest)

根据 https://modelcontextprotocol.io/specification/2025-06-18/client/elicitation 中的规定,征求意见。

SamplingCreateMessageRequest

JSON 表示法
{
  "messages": [
    {
      object (SamplingMessage)
    }
  ],
  "modelPreferences": {
    object (ModelPreferences)
  },
  "systemPrompt": string,
  "includeContext": enum (IncludeContext),
  "temperature": number,
  "maxTokens": integer,
  "stopSequence": [
    string
  ]
}
字段
messages[]

object (SamplingMessage)

modelPreferences

object (ModelPreferences)

可选。

systemPrompt

string

可选。

includeContext

enum (IncludeContext)

可选。

temperature

number

可选。

maxTokens

integer

可选。

stopSequence[]

string

可选。

SamplingMessage

JSON 表示法
{
  "role": enum (Role),
  "text": {
    object (TextContent)
  },
  "image": {
    object (ImageContent)
  },
  "audio": {
    object (AudioContent)
  }
}
字段
role

enum (Role)

发送消息的角色。

text

object (TextContent)

必须且只能填充以下字段中的一个。(未使用“oneof”,因为这会导致向前兼容性问题。)

image

object (ImageContent)

audio

object (AudioContent)

TextContent

JSON 表示法
{
  "text": string,
  "annotations": {
    object (Annotations)
  }
}
字段
text

string

annotations

object (Annotations)

可选。

注释

JSON 表示法
{
  "audience": [
    enum (Role)
  ],
  "priority": number
}
字段
audience[]

enum (Role)

priority

number

必须介于 [0,1] 之间。

ImageContent

JSON 表示法
{
  "data": string,
  "mimeType": string,
  "annotations": {
    object (Annotations)
  }
}
字段
data

string (bytes format)

使用 base64 编码的字符串。

mimeType

string

annotations

object (Annotations)

可选。

AudioContent

JSON 表示法
{
  "data": string,
  "mimeType": string,
  "annotations": {
    object (Annotations)
  }
}
字段
data

string (bytes format)

使用 base64 编码的字符串。

mimeType

string

annotations

object (Annotations)

可选。

ModelPreferences

JSON 表示法
{
  "hints": [
    {
      object (ModelHint)
    }
  ],
  "intelligencePriority": number,
  "speedPriority": number,
  "costPriority": number
}
字段
hints[]

object (ModelHint)

intelligencePriority

number

speedPriority

number

costPriority

number

ModelHint

JSON 表示法
{
  "name": string
}
字段
name

string

可选。

ElicitRequest

JSON 表示法
{
  "message": string,
  "requestedSchema": {
    string: {
      object (PrimitiveSchemaDefinition)
    },
    ...
  },
  "requiredFields": [
    string
  ]
}
字段
message

string

要向用户显示的消息。必填。

requestedSchema

map (key: string, value: object (PrimitiveSchemaDefinition))

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

requiredFields[]

string

RequestedSchemaEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (PrimitiveSchemaDefinition)
  }
}
字段
key

string

value

object (PrimitiveSchemaDefinition)

PrimitiveSchemaDefinition

JSON 表示法
{
  "stringSchema": {
    object (StringSchema)
  },
  "numberSchema": {
    object (NumberSchema)
  },
  "booleanSchema": {
    object (BooleanSchema)
  },
  "enumSchema": {
    object (EnumSchema)
  }
}
字段
stringSchema

object (StringSchema)

这些字段中只会存在一个。(未使用“oneof”,因为这会导致向前兼容性问题。)

numberSchema

object (NumberSchema)

booleanSchema

object (BooleanSchema)

enumSchema

object (EnumSchema)

StringSchema

JSON 表示法
{
  "title": string,
  "description": string,
  "minLength": string,
  "maxLength": string,
  "format": enum (Format)
}
字段
title

string

description

string

minLength

string

maxLength

string

format

enum (Format)

NumberSchema

JSON 表示法
{
  "title": string,
  "description": string,
  "minimum": string,
  "maximum": string
}
字段
title

string

description

string

minimum

string

maximum

string

BooleanSchema

JSON 表示法
{
  "title": string,
  "description": string,
  "default": boolean
}
字段
title

string

description

string

default

boolean

EnumSchema

JSON 表示法
{
  "title": string,
  "description": string,
  "enumList": [
    string
  ],
  "enumNames": [
    string
  ]
}
字段
title

string

description

string

enumList[]

string

enumNames[]

string

内容

JSON 表示法
{
  "text": {
    object (TextContent)
  },
  "image": {
    object (ImageContent)
  },
  "audio": {
    object (AudioContent)
  },
  "embeddedResource": {
    object (EmbeddedResource)
  },
  "resourceLink": {
    object (Resource)
  }
}
字段
text

object (TextContent)

非结构化结果内容。如果工具未定义输出架构,则至少会填充一个。如果工具定义了输出架构,则会填充 structured_content 字段,但为了实现向后兼容性,系统可能仍会填充其中一个字段。

这些字段中最多只能填充一个。(未使用“oneof”,因为这会导致向前兼容性问题。)

image

object (ImageContent)

audio

object (AudioContent)

embeddedResource

object (EmbeddedResource)

resourceLink

object (Resource)

EmbeddedResource

JSON 表示法
{
  "contents": {
    object (ResourceContents)
  },
  "annotations": {
    object (Annotations)
  }
}
字段
contents

object (ResourceContents)

annotations

object (Annotations)

可选。

ResourceContents

JSON 表示法
{
  "uri": string,
  "mimeType": string,
  "text": string,
  "blob": string
}
字段
uri

string

mimeType

string

text

string

必须且只能填充以下字段中的一个。(未使用“oneof”,因为这会导致向前兼容性问题。)

blob

string (bytes format)

使用 base64 编码的字符串。

资源

JSON 表示法
{
  "uri": string,
  "name": string,
  "title": string,
  "description": string,
  "mimeType": string,
  "annotations": {
    object (Annotations)
  },
  "size": string
}
字段
uri

string

name

string

title

string

description

string

可选。

mimeType

string

可选。

annotations

object (Annotations)

可选。

size

string

可选。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌