API Reference

February 14, 2026 · View on GitHub

Overview

Complete reference for the Gemini MCP Server tools and interfaces.

This server implements the MCP 2025-11-25 specification, including tool annotations and progress notifications.

MCP Protocol Features

Tool Annotations

All tools include annotations that provide hints to MCP clients about tool behavior:

AnnotationTypeDescription
titlestringHuman-readable tool name
readOnlyHintbooleanTool doesn't modify state
destructiveHintbooleanTool may modify files or external state
idempotentHintbooleanMultiple calls produce same result
openWorldHintbooleanTool interacts with external services

Tool Annotation Matrix

ToolTitlereadOnlyHintdestructiveHintidempotentHintopenWorldHint
geminiQuery Gemini AIfalsetruefalsetrue
web-searchWeb Searchtruefalsefalsetrue
analyze-mediaAnalyze Mediatruefalsefalsetrue
shellShell Commandsfalsetruefalsetrue
brainstormBrainstorm Ideastruefalsefalsetrue
fetch-chunkFetch Response Chunktruefalsetruefalse
pingPing Servertruefalsetruefalse
helpGet Helptruefalsetruefalse
timeout-testTest Timeouttruefalsetruefalse

Progress Notifications

For long-running operations, the server sends notifications/progress messages when the client includes a progressToken in the request _meta.

Supported Tools: gemini, web-search, analyze-media, shell, brainstorm


Tools

gemini - File Analysis & Questions

Analyze files and codebases using Gemini's large context window with the @ syntax.

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Your question or analysis request. Use @ syntax for file references
modelstringNogemini-3-pro-previewModel to use
sandboxbooleanNofalseEnable sandbox mode for safe execution
yolobooleanNofalseAuto-approve all tool executions (required for Google Workspace)
changeModebooleanNofalseEnable structured edit mode
chunkIndexnumberNo-Chunk to retrieve (1-based) for large responses
chunkCacheKeystringNo-Cache key from previous chunked response

Model Options

  • gemini-3-pro-preview (default) - Most capable, complex reasoning
  • gemini-3-flash-preview - Fast responses, good quality
  • gemini-2.5-flash-lite - Fastest, lightweight

YOLO Mode

When yolo: true is set, Gemini auto-approves all tool executions without confirmation prompts. Required for Gemini CLI extensions that need tool approval (e.g., Google Workspace, custom extensions).

{
  "prompt": "Search my Google Drive for budget spreadsheets",
  "yolo": true
}

Installing Extensions:

# Install from full GitHub URL
gemini extensions install https://github.com/gemini-cli-extensions/workspace

# Install from local path
gemini extensions install /path/to/your-extension

⚠️ Security: Without yolo: true, extension tools will hang waiting for approval. YOLO bypasses all confirmations—use with trusted inputs only.

Examples

Basic Usage:

{
  "prompt": "Analyze @src/main.js and explain what it does"
}

With Model Selection:

{
  "prompt": "Quickly summarize @package.json",
  "model": "gemini-3-flash-preview"
}

Change Mode:

{
  "prompt": "Refactor @src/utils.ts for better error handling",
  "changeMode": true
}

Google Workspace:

{
  "prompt": "Read the 'Sales Q4' spreadsheet and summarize the data",
  "yolo": true
}

Search the web using Gemini with Google Search grounding for real-time information.

Parameters

ParameterTypeRequiredDefaultDescription
querystringYes-Search query
summarizebooleanNotrueSummarize results
modelstringNogemini-3-flash-previewModel to use

Examples

Basic Usage:

{
  "query": "latest React 19 features"
}

Raw Results:

{
  "query": "kubernetes security best practices 2025",
  "summarize": false
}

analyze-media - Multimodal Analysis

Analyze images, PDFs, screenshots, and diagrams using Gemini's multimodal capabilities.

Parameters

ParameterTypeRequiredDefaultDescription
filePathstringYes-Path to media file (use @ syntax)
promptstringYes-What to analyze or extract
modelstringNogemini-3-pro-previewModel to use
detailedbooleanNofalseProvide detailed analysis

Supported Formats

  • Images: PNG, JPG, GIF, WebP
  • Documents: PDF
  • Screenshots: Any image format

Examples

Basic Usage:

{
  "filePath": "@screenshot.png",
  "prompt": "describe this UI"
}

Detailed Analysis:

{
  "filePath": "@architecture.pdf",
  "prompt": "explain the system design",
  "detailed": true
}

shell - Shell Command Generation

Generate and optionally execute shell commands using Gemini.

Parameters

ParameterTypeRequiredDefaultDescription
taskstringYes-Description of the shell task
dryRunbooleanNotrueExplain commands without executing
workingDirectorystringNo-Working directory for execution
modelstringNogemini-3-flash-previewModel to use

Examples

Dry Run (default):

{
  "task": "find all TypeScript files larger than 100KB"
}

Execute:

{
  "task": "run the test suite",
  "dryRun": false
}

brainstorm - Creative Ideation

Generate ideas using various brainstorming methodologies.

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-The brainstorming topic
methodologystringNoautoFramework to use
domainstringNo-Domain context for specialized ideas
constraintsstringNo-Known limitations or requirements
ideaCountnumberNo-Target number of ideas
includeAnalysisbooleanNofalseInclude feasibility analysis

Methodology Options

  • auto - Automatically select best methodology
  • divergent - Generate many diverse ideas
  • convergent - Focus and refine ideas
  • SCAMPER - Substitute, Combine, Adapt, Modify, Put to other uses, Eliminate, Reverse
  • design-thinking - Empathize, Define, Ideate, Prototype, Test
  • lateral - Lateral thinking techniques

Examples

Basic Usage:

{
  "prompt": "ideas for improving user onboarding"
}

With Methodology:

{
  "prompt": "improve the checkout flow",
  "methodology": "SCAMPER",
  "includeAnalysis": true
}

fetch-chunk - Retrieve Cached Chunks

Retrieve cached chunks from large changeMode responses.

Parameters

ParameterTypeRequiredDefaultDescription
cacheKeystringYes-Cache key from previous response
chunkIndexnumberYes-Chunk index to retrieve (1-based)

Notes

  • Cache TTL: 10 minutes
  • Used for retrieving large structured edit responses

ping - Connection Test

Test if the MCP server is working properly.

Parameters

None.

Response

Returns server status and version information.


help - Gemini CLI Help

Get information about Gemini CLI capabilities and commands.

Parameters

None.

Response

Returns Gemini CLI help output.


Advanced Features

Large File Handling

  • Gemini's massive context window handles large files exceeding other models' limits
  • Use @ syntax: @src/main.js, @. (current directory)
  • Automatic chunking for very large responses

Change Mode (Structured Edits)

When changeMode is enabled:

  • Responses formatted as structured edits
  • Parses **FILE: path:line** format with OLD/NEW blocks
  • Chunks large responses for manageable processing
  • 10-minute cache TTL for chunk retrieval

Model Fallback

  • Automatic fallback from gemini-3-pro-preview to gemini-3-flash-preview on quota exceeded
  • Transparent retry with status notification