Skip to main content
Glama

Upload file content

upload_file

Upload a file to Google Drive using inline text or a local path, create a new file or replace an existing one, and return its metadata. Supports optional conversion to Google Docs, Sheets, or Slides.

Instructions

Uploads content to Drive and returns the file's metadata. Without file_id it CREATES a new file (name required; parent_id places it); with file_id it REPLACES that file's content in place (same id, new bytes) — name/parent_id are ignored then. The bytes come from exactly one of content (inline UTF-8 text) or local_path (absolute path to a local file). mime_type describes the uploaded bytes (default: text/plain for content, guessed from the extension for local_path). convert_to=document|spreadsheet|presentation imports the bytes into an editable Google Doc/Sheet/Slides (e.g. a .docx or .csv becomes native; export back with export_file). Cap: 5 MB per upload (multipart) — larger files need a resumable session via raw_request. A retry after an ambiguous failure without file_id would create a duplicate — search_files first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoFile name in Drive — required when creating (no file_id).
contentNoInline UTF-8 text content — for small text files. Exactly one of content/local_path.
file_idNoExisting file whose CONTENT to replace (omit to create a new file).
mime_typeNomimeType of the uploaded bytes (default: text/plain for content, extension-based for local_path).
parent_idNoFolder for the new file (create only; omitted = My Drive root).
convert_toNoImport into a Google-native editable file: document (Doc), spreadsheet (Sheet), presentation (Slides).
local_pathNoAbsolute local path to read the bytes from. Exactly one of content/local_path.
Behavior5/5

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

Annotations only convey readOnly=false, idempotent=false, openWorld=true. The description adds substantial context beyond that: the dual create/replace behavior, the retry-duplicate hazard, the 5 MB multipart cap, the precedence rule that name/parent_id are ignored in replace mode, and the convert_to-to-export_file round trip — all behavioral traits the agent could not infer from annotations alone.

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 with the core action and near-zero waste: five sentences cover the split modes, byte source constraint, mime defaults, conversion, size cap, and retry safety. Small deduction because a few phrases (mime defaults, exactly-one constraint) restate what the input schema already documents rather than adding new information.

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

Completeness4/5

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

For a complex dual-mode tool with 7 params, zero required params in the schema, and no output schema, the description covers all invocation risks: mode disambiguation, conditional requirements, size limit, conversion semantics, and duplicate prevention. The only gap is the return contract — 'returns the file's metadata' names the payload but not its fields, notably the file id, which matters because no output schema exists.

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

Parameters4/5

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

Schema coverage is 100% and the schema's per-parameter descriptions already state 'required when creating' and 'Exactly one of content/local_path'. The description adds interaction-level semantics the flat schema cannot express — name/parent_id ignored when file_id is present, convert_to producing native Google files, and the 5 MB bound — though some mime_type default text duplicates the schema, so it stops short of a 5.

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?

Opens with a specific verb+resource: 'Uploads content to Drive and returns the file's metadata.' It then discretely separates the create mode (no file_id, name required) from the replace mode (file_id, same id, new bytes), which clearly distinguishes it from siblings like download_file, export_file, copy_file, and update_file_metadata.

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

Usage Guidelines5/5

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

Explicit routing to alternatives is present: 'export back with export_file' for converted files, 'larger files need a resumable session via raw_request' past the 5 MB cap, and 'search_files first' before retrying an ambiguous create. Naming the sibling and the condition that selects it leaves nothing to inference.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-drive'

If you have feedback or need assistance with the MCP directory API, please join our Discord server