get_file
Returns a file's metadata (never its content — that is download_file/export_file): id, name, mimeType, size, parents, driveId, createdTime/modifiedTime, trashed, starred, description, md5Checksum, webViewLink, webContentLink, exportLinks (for Google-native files), owners, lastModifyingUser, short...
This record as markdown: /tools/a1-x-tech-mcp-google-drive/get-file.md
What get_file does on Mcp Google Drive
AI agents call get_file to retrieve information from Mcp Google Drive without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | string | — | Custom Drive fields projection, e.g. "id,name,permissions(id,role,emailAddress)". Defaults to a rich metadata set. |
file_id | string | Yes | The file id — the long id from the Drive URL (drive.google.com/file/d/<fileId> or docs.google.com/.../d/<fileId>/edit) or from search_files/get_file output. Fol |
Parameters from the server's own tool schema.
Why get_file is rated Low
Even though get_file only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Attacks that exploit this kind of access
The rule that runs get_file safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Mcp Google Drive, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For get_file, this is the rule to start with:
get_file is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Mcp Google Drive, apply this rule, and every get_file call is checked against it from then on.
Questions about get_file
Returns a file's metadata (never its content — that is download_file/export_file): id, name, mimeType, size, parents, driveId, createdTime/modifiedTime, trashed, starred, description, md5Checksum, webViewLink, webContentLink, exportLinks (for Google-native files), owners, lastModifyingUser, shortcutDetails (a shortcut's real target id/mimeType) and capabilities (canEdit/canShare/canTrash/canDelete/canDownload — check before mutating). Google-native files (mimeType application/vnd.google-apps.*) report no size and no md5Checksum. Pass fields to select a custom projection (Drive fields syntax) when the default set is too much or too little. It is categorised as a Read tool in the Mcp Google Drive MCP Server, which means it retrieves data without modifying state.
get_file accepts 2 parameters: fields, file_id. Required: file_id. The full parameter table on this page comes from the server's own tool schema.
Register the Mcp Google Drive MCP server in PolicyLayer and add a rule for get_file: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Mcp Google Drive. Nothing to install.
get_file is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_file rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get_file. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get_file is provided by the Mcp Google Drive MCP server (@a1-x-tech/mcp-google-drive). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Mcp Google Drive, and thousands of servers like it.
This server
Across the catalogue