Skip to main content
Glama

generate_content

Generate content from text, files, or web search using Gemini. Supports code execution and multiple file types for versatile AI-powered tasks.

Instructions

Generate content using Gemini with optional file inputs, code execution, and Google search. Supports multiple files: images (JPG, PNG, GIF, WebP, SVG, BMP, TIFF), video (MP4, AVI, MOV, WebM, FLV, MPG, WMV), audio (MP3, WAV, AIFF, AAC, OGG, FLAC), documents (PDF), and text files (TXT, MD, JSON, XML, CSV, HTML). MIME type is auto-detected from file extension.

Example usage:

{
  "user_prompt": "Analyze this video",
  "files": [{"path": "/path/to/video.mp4"}]
}

PDF to Markdown conversion:

{
  "user_prompt": "Convert this PDF to well-formatted Markdown",
  "files": [{"path": "/document.pdf"}]
}

With Google Search:

{
  "user_prompt": "What are the latest AI breakthroughs in 2024?",
  "enable_google_search": true
}

With Code Execution:

{
  "user_prompt": "Write and run a Python script to calculate prime numbers",
  "enable_code_execution": true
}

Media Resolution Optimization (save tokens):

{
  "user_prompt": "Describe this image",
  "files": [{"path": "/image.jpg"}],
  "media_resolution": "LOW"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoArray of files to include in generation (optional)
modelNoGemini model to use. Choose from these Gemini 3.x models ONLY: - "gemini-3.5-flash" DEFAULT — best price/perf, fast. Pick this 99% of the time (including video, audio, image, PDF). - "gemini-3.1-pro-preview-thinking" Slow + expensive. ONLY use when you need deep reasoning / a non-trivial `thinking_budget`. - "gemini-3-flash-preview" Cheapest + dumbest. ONLY for high-volume simple classification / extraction. NEVER pass legacy Gemini 2.x ids (gemini-2.5-pro, gemini-2.5-flash, gemini-pro, gemini-flash). They are DEPRECATED for this server. If omitted, the server falls back to the env-configured default (typically "gemini-3.5-flash").gemini-3.5-flash
temperatureNoTemperature (0-2)
user_promptYesUser prompt for generation
system_promptNoSystem prompt to guide the AI behavior (optional)
thinking_budgetNoThinking budget for supported models (-1 for unlimited)
media_resolutionNoMedia resolution: LOW (saves tokens), MEDIUM, HIGHMEDIUM
enable_google_searchNoEnable Google search capability
enable_code_executionNoEnable code execution capability
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses supported file types, MIME auto-detection, model deprecation warnings, default values, and limits (max 10 files). However, output format and error handling are not mentioned, reducing transparency slightly.

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

Conciseness3/5

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

The description is lengthy with multiple examples, making it less concise. However, it is well-structured with sections and code blocks. Some information could be condensed without losing clarity.

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

Completeness3/5

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

Lacks output schema or description of return values, and does not cover error handling or rate limits. For a tool with 9 parameters, the description is moderately complete but missing critical output context.

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%, so baseline is 3. The description adds value by providing detailed model selection guidance (including deprecated models), example usage for parameters like files, enable_google_search, etc., clarifying how parameters interact.

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 generates content using Gemini, listing supported file types and capabilities. The sibling 'generate_content_batch' suggests this is for single generation, differentiating it effectively.

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?

Examples illustrate various use cases (with files, Google search, code execution, media resolution). Model selection guidance advises when to use each model. However, it does not explicitly contrast with the batch sibling, and assumes context from the name.

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/2799662352/apiyi-mcp-server'

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