Skip to main content
Glama

upload_file

Upload a single file to Gemini AI for analysis, with automatic MIME detection and processing monitoring. Returns file URI for chat integration.

Instructions

UPLOAD SINGLE FILE - Standard method for uploading one file to Gemini. BEST FOR: Single documents, images, or code files for immediate analysis. Includes automatic retry and state monitoring until file is ready. WORKFLOW: 1) Upload with auto-detected MIME type, 2) Wait for processing to complete (usually 10-30 seconds), 3) Returns URI for chat tool. RETURNS: fileUri (pass to chat tool), displayName, mimeType, sizeBytes, state. Files auto-delete after 48 hours. For 2+ files, consider upload_multiple_files for efficiency.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to the file to upload
displayNameNoOptional display name for the file
mimeTypeNoOptional MIME type (auto-detected if not provided)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: automatic retry and state monitoring, processing time (10-30 seconds), auto-deletion after 48 hours, and the return of specific data fields. However, it doesn't mention error handling or rate limits, which keeps it from a perfect score.

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?

The description is well-structured with clear sections (BEST FOR, WORKFLOW, RETURNS) and avoids unnecessary fluff. However, it could be slightly more concise by integrating some points more tightly, and the all-caps 'UPLOAD SINGLE FILE' is somewhat redundant with the tool name.

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 tool with no annotations and no output schema, the description does an excellent job covering key aspects: purpose, usage guidelines, behavioral traits, and return values. It compensates well for the lack of structured output schema by explicitly listing return fields. Minor gaps in error handling prevent a perfect score.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description doesn't add any meaningful parameter-specific information beyond what's in the schema (e.g., it mentions auto-detected MIME type but the schema already states this). Baseline 3 is appropriate when the schema does the heavy lifting.

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 description clearly states the specific action ('UPLOAD SINGLE FILE'), target resource ('to Gemini'), and distinguishes it from sibling tools by explicitly mentioning 'upload_multiple_files' as an alternative for 2+ files. It provides a verb+resource+scope combination that is precise and differentiated.

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?

The description provides explicit guidance on when to use this tool ('BEST FOR: Single documents, images, or code files for immediate analysis') and when to consider alternatives ('For 2+ files, consider upload_multiple_files for efficiency'). It also outlines the workflow context, making usage scenarios clear.

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/mintmcqueen/gemini-mcp'

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