Skip to main content

Module drive

Module drive 

Source
Expand description

The Drive tool’s read actions (G2), named after Google’s Drive MCP tools (SPEC_GOOGLE_CONNECTORS_GMAIL_CALENDAR_DRIVE_2026_10_14.md §5): search_files, get_file_metadata, read_file_content. On drive.file an account reaches only the files the person picked (Google’s desktop picker, §3.3) and the ones AgentMux made, so a search is over those and nothing else.

As with Calendar, each action is a plan (the request, from the agent’s arguments) and a shape (Google’s answer, trimmed and capped); neither touches the network or a token. read_file_content takes two requests: the file’s metadata decides whether it is exported (content_plan).

Structs§

DriveArgs
The arguments the read actions take. Unknown fields are ignored.

Constants§

READ_ACTIONS
The read actions, in the order the tool lists them. pick_files is not one: it asks the person, and srv answers it itself.

Functions§

content_plan
How a file is read as text: Google’s native documents are exported, plain text is downloaded, anything else can’t be.
granted_for
Whether granted (full scope URLs, or bare names) covers action.
logged_ids
The ids a read touched, for the account’s log (D7): file ids, never what was in them.
needs
The scopes an action can run with: any one is enough. drive.readonly and drive are never asked for here, but an account connected with them still works.
plan
The request to Google for a read action; for read_file_content, the file’s metadata, which content_plan turns into the request for its text.
shape
Google’s answer to search_files or get_file_metadata, trimmed for the agent.
shape_content
read_file_content’s answer: the file’s details and its text, as far as it was read.