Skip to main content
Glama

get_doc_content

Read-only

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

NameRequiredDescriptionDefault
file_idYes
local_pathNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint annotation, the description discloses substantive behavior: results are cached and must be invalidated via refresh_cache, oversized responses raise ValueError unless local_path is set, and the local_path is resolved on the server's filesystem rather than the caller's. It also documents the distinct return shape when writing to disk ({local_path, id, bytes_written}).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded purpose followed by clearly separated Args and Returns sections makes it easy to scan. The local_path paragraph is dense but every clause (trailing slash, replacement, ValueError, server-side resolution) changes how the caller should form the value, so little is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter read tool with caching and a size cap, the definition covers the input semantics, error conditions, cache lifecycle, and both return shapes, and it points to the config doc for the cap's default. An agent has everything needed to call it correctly and recover from the ValueError.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the schema gives only bare titles, so the description carries the full burden and does so: file_id is identified as a Google Drive file ID, and local_path's directory-vs-file semantics, trailing-slash rule, creation of missing directories, replacement of existing files, and ValueError conditions are all spelled out.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line gives a specific verb and resource ('Get the plain text content of a Google Doc'), and the word 'plain text' implicitly separates it from sibling readers like get_doc_as_markdown, get_doc_structure, and get_doc_named_styles that return other representations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by the purpose statement; there is no explicit guidance on when to pick this over get_doc_as_markdown or get_doc_structure, nor any stated preconditions such as required scopes. The only routing it does supply is the follow-up pointer to refresh_cache(doc_id=file_id) to invalidate cached results.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools