get_doc_content
Retrieve the plain text content of a Google Doc by file ID, with an option to write output to a server-side path and bypass response-size limits.
Instructions
Get the plain text content of a Google Doc.
Args: file_id: The Google Drive file ID of the document. local_path: Optional local filesystem path (file or directory) to write the result to instead of returning it inline. Bypasses the response-size cap. A path ending in '/' is a directory, created if missing. A file in place of a parent directory, or at a path ending in '/', raises ValueError; an existing file at a plain file path is replaced. Same caveat as download_file/download_folder: this path is resolved on the server's filesystem, not the caller's.
Returns: Dictionary with the document's text content and metadata. Results are cached; call refresh_cache(doc_id=file_id) to invalidate, or refresh_cache() to clear all caches. Raises ValueError if the response exceeds a safety cap (see MAX_TOOL_RESPONSE_CHARS in docs/configuration.md for the configured default) and local_path is not set. If local_path is set, returns {local_path, id, bytes_written} instead.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_id": "<file_id>"
},
"name": "get_doc_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_id | Yes | ||
| local_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||