工具:read_file_content
调用此工具以获取 Google 云端硬盘文件的自然语言表示形式。
对于非常大的文件,文件内容可能不完整。文本表示形式会随时间变化,因此请勿对该工具返回的文本的特定格式做出假设。
支持的 MIME 类型:
application/vnd.google-apps.documentapplication/vnd.google-apps.presentationapplication/vnd.google-apps.spreadsheetapplication/pdfapplication/mswordapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.openxmlformats-officedocument.presentationml.presentationapplication/vnd.oasis.opendocument.spreadsheetapplication/vnd.oasis.opendocument.presentationapplication/x-vnd.oasis.opendocument.textimage/pngimage/jpegimage/jpg
如果找不到文件,请尝试使用其他工具(例如 search_files)通过关键字查找用户请求的文件。
以下示例演示了如何使用 curl 调用 read_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": "read_file_content", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
输入架构
请求读取文件内容。
ReadFileContentRequest
| JSON 表示法 |
|---|
{ "fileId": string } |
| 字段 | |
|---|---|
fileId |
必需。要检索的文件的 ID。 |
输出架构
读取文件内容的响应。
ReadFileContentResponse
| JSON 表示法 |
|---|
{ "fileContent": string } |
| 字段 | |
|---|---|
联合字段
|
|
fileContent |
以文本格式返回的云端硬盘文件内容。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌