Skip to main content
Glama

Upload file to Gemini Files API

upload_file

Upload local files to the Gemini Files API to handle large images or reuse content across multiple prompts, returning the file URI and metadata for integration.

Instructions

Upload a local file through the Gemini Files API and return its URI & metadata. Useful when the image is larger than 20MB or reused across prompts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesServer-accessible file path to upload to Gemini Files API.
display_nameNoOptional display name for the uploaded file.
Behavior3/5

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

Annotations already indicate readOnlyHint=false (mutation) and openWorldHint=true (can create new resources). The description adds useful behavioral context about file size limitations (>20MB) and reuse scenarios, which aren't covered by annotations. However, it doesn't mention authentication requirements, rate limits, or what happens if upload fails. With annotations covering basic safety profile, this earns a baseline 3 for adding some value.

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?

Two concise sentences with zero waste. The first sentence states the core functionality and return value. The second sentence provides practical usage guidance. Every word earns its place, and the most important information (what the tool does) comes first.

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 file upload tool with 2 parameters, 100% schema coverage, and annotations covering mutation/open-world aspects, the description provides adequate context. It explains the tool's purpose, gives usage scenarios, and mentions return values. The main gap is lack of output schema, but the description mentions what will be returned (URI & metadata). Given the tool's moderate complexity, this is reasonably complete.

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 fully documents both parameters. The description doesn't add any parameter-specific information beyond what's in the schema. It mentions 'local file' which aligns with the 'path' parameter, but provides no additional syntax, format, or semantic details. Baseline 3 is appropriate when schema does all the parameter documentation work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Upload a local file') and target ('through the Gemini Files API'), and specifies the return value ('return its URI & metadata'). It distinguishes from siblings like 'generate_image' by focusing on file upload rather than image creation. However, it doesn't explicitly differentiate from other potential file-related tools that might exist in a broader context.

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 provides clear usage context: 'Useful when the image is larger than 20MB or reused across prompts.' This gives specific scenarios for when to use this tool. It doesn't explicitly state when NOT to use it or name alternatives among the sibling tools, but the context provided is helpful and practical.

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/zengwenliang416/banana-image-mcp'

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