Tool: read_file_content
Call this tool to fetch a natural language representation of a Drive file.
The file content may be incomplete for very large files. The text representation will change over time, so don't make assumptions about the particular format of the text returned by this tool.
Supported Mime Types:
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
If the file is not found, try using other tools like search_files to find the file the user is requesting using keywords.
The following sample demonstrate how to use curl to invoke the read_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": "read_file_content", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request to read file content.
ReadFileContentRequest
| JSON representation |
|---|
{ "fileId": string } |
| Fields | |
|---|---|
fileId |
Required. The ID of the file to retrieve. |
Output Schema
Response to read file content.
ReadFileContentResponse
| JSON representation |
|---|
{ "fileContent": string } |
| Fields | |
|---|---|
Union field
|
|
fileContent |
Drive file content returned in text format. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌