Skip to main content
Glama

gemini_upload_file

Upload an image, video, or audio file to Gemini Files API and receive a reusable file reference. Avoid sending large base64 data in conversations by using URLs, base64, or local file paths.

Instructions

Upload an image (or video/audio) to the Gemini Files API ONCE and get back a reusable files/<id> reference. Use this instead of pasting base64 into a tool call: the reference is a short string, so no image bytes ever enter the conversation, and it can be reused across many generations until it expires (~48h). Provide exactly one of url (the server downloads it), data_base64, or path (a local file).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic https URL the SERVER downloads and uploads (image/video/audio, up to 100MB). No bytes pass through the conversation.
pathNoPath to a local file (absolute, or resolved against $GEMINI_INPUT_DIR). Confirm-gated like every other local-file input.
confirmNoMust be true to proceed. Without this, the tool returns a preview.
mime_typeNoOverride the detected MIME type (sniffed from the bytes / taken from the server response otherwise)
data_base64NoRaw base64 or a data: URI. Last resort — this is the one form that costs model context (~14k tokens for a modest JPEG).
display_nameNoHuman-readable name recorded against the upload
Behavior4/5

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

The description adds behavioral context beyond annotations: it explains the reusable reference format, expiration (~48h), and token cost of base64. Annotations only indicate mutation and openWorld; the description provides useful lifecycle details. It stops short of discussing error conditions or duplicate uploads, but is largely transparent.

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

Conciseness5/5

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

The description is extremely concise (4 sentences, 106 words) and front-loaded with the most important information. Every sentence earns its place with no redundancy or fluff.

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?

The description covers input methods, output format, reuse, expiration, and token cost. Given no output schema, it adequately describes what to expect. It is missing error handling or rate limit details, but overall sufficient for the tool's purpose.

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?

All six parameters have detailed schema descriptions. The main description adds the crucial 'exactly one of url, data_base64, or path' constraint and warns that data_base64 is a last resort. This adds meaningful value beyond the schema.

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 tool uploads a file to the Gemini Files API and returns a reusable reference. It distinguishes from alternative methods like pasting base64 and from sibling tools, as none of the other tools are file upload tools.

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

Usage Guidelines4/5

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

The description advises using this tool instead of pasting base64 into tool calls, explaining benefits. It specifies the three input methods and that exactly one must be provided. However, it does not explicitly compare to sibling tools or specify when not to use it, but the context is clear enough.

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

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