← Gemini MCP Server

Gemini MCP Server 0.4.0

npm · @mintmcqueen/gemini-mcp · current release

21
Tools
3
Resources
0
Templates
0
Prompts

Observation

Observed 2026-08-22T13:49:03.531Z using mcpSecurity-inventory. Status: partial. Negotiated protocol: 2025-06-18.

Server capabilities
{
  "resources": {},
  "tools": {}
}

Tools 21

ToolCategoryAnnotationsRisk
batch_cancelCANCEL BATCH JOB - Request cancellation of running batch job. WORKFLOW: 1) Sends cancel request to Gemini API, 2) Job transitions to CANCELLED state, 3) Processing stops (may take a few seconds), 4) Partial results may be available. USE CASE: Stop long-running job due to errors, changed requirements, or cost management. NOTE: Cannot cancel SUCCEEDED or FAILED jobs.
Input schema
{
  "type": "object",
  "properties": {
    "batchName": {
      "type": "string",
      "description": "Batch job name/ID to cancel"
    }
  },
  "required": [
    "batchName"
  ]
}
— · —
batch_createCREATE BATCH JOB - Create async content generation batch job with Gemini. COST: 50% cheaper than standard API. TURNAROUND: ~24 hours target. WORKFLOW: 1) Prepare JSONL file with requests (or use batch_ingest_content first), 2) Upload file with upload_file, 3) Call batch_create with file URI, 4) Use batch_get_status to monitor progress, 5) Use batch_download_results when complete. SUPPORTS: Inline requests (<20MB) or file-based (JSONL for large batches). Returns batch job ID and initial status.
Input schema
{
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "enum": [
        "gemini-3-pro-preview",
        "gemini-2.5-pro",
        "gemini-2.5-flash",
        "gemini-2.0-flash-exp"
      ],
      "description": "Gemini model for content generation",
      "default": "gemini-2.5-flash"
    },
    "requests": {
      "type": "array",
      "description": "Inline batch requests (for small batches <20MB). Each request should have 'key' and 'request' fields."
    },
    "inputFileUri": {
      "type": "string",
      "description": "URI of uploaded JSONL file (from upload_file tool). Use for large batches or when requests exceed 20MB."
    },
    "displayName": {
      "type": "string",
      "description": "Optional display name for the batch job"
    },
    "outputLocation": {
      "type": "string",
      "description": "Output directory for results (defaults to current working directory)"
    },
    "config": {
      "type": "object",
      "description": "Optional generation config (temperature, maxOutputTokens, etc.)",
      "properties": {
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2,
          "default": 1
        },
        "maxOutputTokens": {
          "type": "number",
          "minimum": 1,
          "maximum": 500000
        }
      }
    }
  }
}
— · —
batch_create_embeddingsCREATE EMBEDDINGS BATCH JOB - Create async embeddings generation batch job. COST: 50% cheaper than standard API. MODEL: gemini-embedding-001 (1536 dimensions). WORKFLOW: 1) Prepare content (use batch_ingest_embeddings for conversion), 2) Select task type (use batch_query_task_type if unsure), 3) Upload file, 4) Call batch_create_embeddings, 5) Monitor with batch_get_status, 6) Download with batch_download_results. TASK TYPES: See batch_query_task_type for descriptions and recommendations.
Input schema
{
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "description": "Embedding model",
      "default": "gemini-embedding-001",
      "enum": [
        "gemini-embedding-001"
      ]
    },
    "requests": {
      "type": "array",
      "description": "Inline embedding requests (for small batches)"
    },
    "inputFileUri": {
      "type": "string",
      "description": "URI of uploaded JSONL file with embedding requests"
    },
    "taskType": {
      "type": "string",
      "enum": [
        "SEMANTIC_SIMILARITY",
        "CLASSIFICATION",
        "CLUSTERING",
        "RETRIEVAL_DOCUMENT",
        "RETRIEVAL_QUERY",
        "CODE_RETRIEVAL_QUERY",
        "QUESTION_ANSWERING",
        "FACT_VERIFICATION"
      ],
      "description": "Embedding task type (affects model optimization). Use batch_query_task_type for guidance."
    },
    "displayName": {
      "type": "string",
      "description": "Optional display name for the batch job"
    },
    "outputLocation": {
      "type": "string",
      "description": "Output directory for results"
    }
  },
  "required": [
    "taskType"
  ]
}
— · —
batch_deleteDELETE BATCH JOB - Permanently delete batch job and associated data. WORKFLOW: 1) Validates job exists, 2) Deletes job metadata from Gemini API, 3) Removes from internal tracking. USE CASE: Clean up completed/failed jobs, manage job history, free storage. WARNING: Irreversible operation. Results will be lost if not downloaded first. Recommended to download results before deletion.
Input schema
{
  "type": "object",
  "properties": {
    "batchName": {
      "type": "string",
      "description": "Batch job name/ID to delete"
    }
  },
  "required": [
    "batchName"
  ]
}
— · —
batch_download_resultsDOWNLOAD BATCH RESULTS - Download and parse results from completed batch job. WORKFLOW: 1) Checks job status (must be SUCCEEDED), 2) Downloads result file from Gemini API, 3) Parses JSONL results, 4) Saves to local file, 5) Returns parsed results array. RETURNS: Array of results with original keys, responses, and metadata. Also saves to file in outputLocation.
Input schema
{
  "type": "object",
  "properties": {
    "batchName": {
      "type": "string",
      "description": "Batch job name/ID from batch_create"
    },
    "outputLocation": {
      "type": "string",
      "description": "Directory to save results file (defaults to current working directory)"
    }
  },
  "required": [
    "batchName"
  ]
}
— · —
batch_get_statusGET BATCH JOB STATUS - Check status of running batch job with optional auto-polling. STATES: PENDING (queued), RUNNING (processing), SUCCEEDED (complete), FAILED (error), CANCELLED (user stopped), EXPIRED (timeout). WORKFLOW: 1) Call with batch job name/ID, 2) Optionally enable polling to wait for completion, 3) Returns current state, progress stats, and completion info. USAGE: Pass job name from batch_create response. Enable autoPoll for hands-off waiting.
Input schema
{
  "type": "object",
  "properties": {
    "batchName": {
      "type": "string",
      "description": "Batch job name/ID from batch_create"
    },
    "autoPoll": {
      "type": "boolean",
      "description": "Automatically poll until job completes (SUCCEEDED, FAILED, or CANCELLED)",
      "default": false
    },
    "pollIntervalSeconds": {
      "type": "number",
      "description": "Seconds between status checks when autoPoll=true (default: 30)",
      "default": 30,
      "minimum": 10
    },
    "maxWaitMs": {
      "type": "number",
      "description": "Maximum wait time in milliseconds (default: 24 hours)",
      "default": 86400000
    }
  },
  "required": [
    "batchName"
  ]
}
— · —
batch_ingest_contentINTELLIGENT CONTENT INGESTION - Analyzes content file, converts to JSONL for batch processing. WORKFLOW: 1) Detects format (CSV, JSON, TXT, MD), 2) Analyzes structure/complexity, 3) Writes analysis scripts if needed, 4) Converts to proper JSONL format, 5) Validates JSONL structure. SUPPORTS: CSV (converts rows), JSON (wraps objects), TXT/MD (splits by lines/sections). RETURNS: Conversion report with outputFile path, validation status, and any generated scripts.
Input schema
{
  "type": "object",
  "properties": {
    "inputFile": {
      "type": "string",
      "description": "Path to content file to ingest"
    },
    "outputFile": {
      "type": "string",
      "description": "Optional output JSONL path (auto-generated if not provided)"
    },
    "generateScripts": {
      "type": "boolean",
      "description": "Generate analysis/extraction scripts for complex content",
      "default": true
    }
  },
  "required": [
    "inputFile"
  ]
}
— · —
batch_ingest_embeddingsEMBEDDINGS CONTENT INGESTION - Specialized ingestion for embeddings batch processing. WORKFLOW: 1) Analyzes content structure, 2) Extracts text for embedding, 3) Formats as JSONL with proper embedContent structure including task_type, 4) Validates format. OPTIMIZED FOR: Text extraction from various formats (CSV columns, JSON fields, TXT lines, MD sections). RETURNS: JSONL file ready for batch_create_embeddings with task_type embedded in each request.
Input schema
{
  "type": "object",
  "properties": {
    "inputFile": {
      "type": "string",
      "description": "Path to content file"
    },
    "outputFile": {
      "type": "string",
      "description": "Optional output JSONL path"
    },
    "textField": {
      "type": "string",
      "description": "For CSV/JSON: field name containing text to embed (auto-detected if not provided)"
    },
    "taskType": {
      "type": "string",
      "description": "Embedding task type (RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, RETRIEVAL_QUERY, CODE_RETRIEVAL_QUERY, QUESTION_ANSWERING, FACT_VERIFICATION). Use batch_query_task_type if unsure."
    }
  },
  "required": [
    "inputFile",
    "taskType"
  ]
}
— · —
batch_processCOMPLETE BATCH WORKFLOW - End-to-end content generation batch processing. WORKFLOW: 1) Ingests content file (CSV, JSON, TXT, etc.), 2) Converts to JSONL, 3) Uploads to Gemini, 4) Creates batch job, 5) Polls until complete, 6) Downloads and parses results. BEST FOR: Users who want simple one-call solution. RETURNS: Final results with metadata. For more control, use individual tools (batch_ingest_content, batch_create, batch_get_status, batch_download_results).
Input schema
{
  "type": "object",
  "properties": {
    "inputFile": {
      "type": "string",
      "description": "Path to content file (CSV, JSON, TXT, MD, JSONL)"
    },
    "model": {
      "type": "string",
      "enum": [
        "gemini-3-pro-preview",
        "gemini-2.5-pro",
        "gemini-2.5-flash",
        "gemini-2.0-flash-exp"
      ],
      "description": "Gemini model for content generation",
      "default": "gemini-2.5-flash"
    },
    "outputLocation": {
      "type": "string",
      "description": "Output directory for results (defaults to current working directory)"
    },
    "pollIntervalSeconds": {
      "type": "number",
      "description": "Seconds between status checks (default: 30)",
      "default": 30,
      "minimum": 10
    },
    "config": {
      "type": "object",
      "description": "Optional generation config"
    }
  },
  "required": [
    "inputFile"
  ]
}
— · —
batch_process_embeddingsCOMPLETE EMBEDDINGS WORKFLOW - End-to-end embeddings batch processing. WORKFLOW: 1) Ingests content, 2) Queries user for task type (or auto-recommends), 3) Converts to JSONL, 4) Uploads, 5) Creates batch job, 6) Polls until complete, 7) Downloads results. BEST FOR: Simple one-call embeddings generation. RETURNS: Embeddings array (1536-dimensional vectors) with metadata.
Input schema
{
  "type": "object",
  "properties": {
    "inputFile": {
      "type": "string",
      "description": "Path to content file"
    },
    "taskType": {
      "type": "string",
      "enum": [
        "SEMANTIC_SIMILARITY",
        "CLASSIFICATION",
        "CLUSTERING",
        "RETRIEVAL_DOCUMENT",
        "RETRIEVAL_QUERY",
        "CODE_RETRIEVAL_QUERY",
        "QUESTION_ANSWERING",
        "FACT_VERIFICATION"
      ],
      "description": "Embedding task type (omit to get interactive prompt)"
    },
    "model": {
      "type": "string",
      "description": "Embedding model",
      "default": "gemini-embedding-001",
      "enum": [
        "gemini-embedding-001"
      ]
    },
    "outputLocation": {
      "type": "string",
      "description": "Output directory for results"
    },
    "pollIntervalSeconds": {
      "type": "number",
      "description": "Seconds between status checks",
      "default": 30,
      "minimum": 10
    }
  },
  "required": [
    "inputFile"
  ]
}
— · —
batch_query_task_typeINTERACTIVE TASK TYPE SELECTOR - Helps choose optimal embedding task type with recommendations. WORKFLOW: 1) Optionally analyzes sample content, 2) Shows all 8 task types with descriptions, 3) Provides AI recommendation based on context, 4) Returns selected task type. TASK TYPES: SEMANTIC_SIMILARITY (compare text similarity), CLASSIFICATION (categorize text), CLUSTERING (group similar items), RETRIEVAL_DOCUMENT (index for search), RETRIEVAL_QUERY (search queries), CODE_RETRIEVAL_QUERY (code search), QUESTION_ANSWERING (Q&A systems), FACT_VERIFICATION (check claims).
Input schema
{
  "type": "object",
  "properties": {
    "context": {
      "type": "string",
      "description": "Optional context about your use case (e.g., 'building search engine for documentation')"
    },
    "sampleContent": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional sample texts to analyze for recommendation"
    }
  }
}
— · —
chatSEND MESSAGE TO GEMINI (with optional files) - Chat with Gemini, optionally including uploaded files for multimodal analysis. TYPICAL USE: 0-2 files for most tasks (code review, document analysis, image description). SCALES TO: 40+ files when needed for comprehensive analysis. WORKFLOW: 1) Upload files first using upload_file (single) or upload_multiple_files (multiple), 2) Pass returned URIs in fileUris array, 3) Include your text prompt in message. The server handles file object caching and proper API formatting. Supports conversation continuity via conversationId. RETURNS: response text, token usage, conversation ID. Files are passed as direct objects to Gemini (not fileData structures). Auto-retrieves missing files from API if not cached.
Input schema
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "The message to send to Gemini"
    },
    "model": {
      "type": "string",
      "enum": [
        "gemini-3-pro-preview",
        "gemini-2.5-pro",
        "gemini-2.5-flash",
        "gemini-2.0-flash-exp"
      ],
      "description": "The Gemini model to use",
      "default": "gemini-3-pro-preview"
    },
    "fileUris": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Array of file URIs from previously uploaded files"
    },
    "temperature": {
      "type": "number",
      "minimum": 0,
      "maximum": 2,
      "description": "Controls randomness in responses (0.0 to 2.0)",
      "default": 1
    },
    "maxTokens": {
      "type": "number",
      "minimum": 1,
      "maximum": 500000,
      "description": "Maximum tokens in response",
      "default": 15000
    },
    "conversationId": {
      "type": "string",
      "description": "Optional conversation ID to continue a previous chat"
    }
  },
  "required": [
    "message"
  ]
}
— · —
cleanup_all_filesBULK DELETE ALL FILES - Removes ALL files from Gemini File API associated with current API key. Clears entire cache. RETURNS: Count of deleted vs failed deletions with detailed lists. USE CASE: Complete cleanup after batch processing, reset environment, clear storage quota. WARNING: Irreversible operation affecting all uploaded files.
Input schema
{
  "type": "object",
  "properties": {}
}
— · —
clear_conversationCLEAR CONVERSATION HISTORY - Deletes specified conversation session and all associated message history. Frees memory and resets context. USAGE: Pass conversationId from start_conversation or chat response. Returns confirmation or 'not found' message. Use when switching topics or cleaning up after completion.
Input schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Conversation ID to clear"
    }
  },
  "required": [
    "id"
  ]
}
— · —
delete_fileDELETE FILE FROM GEMINI - Permanently removes file from Gemini File API and clears from cache. USAGE: Pass fileUri from upload or list_files. Immediate deletion, cannot be undone. USE CASE: Clean up after processing, manage storage quota, remove sensitive data. NOTE: Files auto-delete after 48 hours if not manually removed.
Input schema
{
  "type": "object",
  "properties": {
    "fileUri": {
      "type": "string",
      "description": "The file URI or name to delete"
    }
  },
  "required": [
    "fileUri"
  ]
}
— · —
generate_imagesGENERATE OR EDIT IMAGES - Create images from text prompts or edit existing images using Gemini image models. CAPABILITIES: Text-to-image generation, image editing with instructions, multiple image generation (1-4 images), configurable aspect ratios. MODELS: gemini-3-pro-image-preview (default, with thinking support) or gemini-2.5-flash-image (faster). WORKFLOW: 1) Provide text prompt, 2) Optionally specify model, aspect ratio, and number of images, 3) For editing: provide inputImageUri from uploaded file, 4) Images auto-saved to outputDir. RETURNS: Array of generated images with file paths. COST: ~1,290 tokens per image. All images include SynthID watermark.
Input schema
{
  "type": "object",
  "properties": {
    "prompt": {
      "type": "string",
      "description": "Text description of image to generate or editing instructions for existing image"
    },
    "model": {
      "type": "string",
      "enum": [
        "gemini-3-pro-image-preview",
        "gemini-2.5-flash-image"
      ],
      "description": "Image generation model (default: gemini-3-pro-image-preview)",
      "default": "gemini-3-pro-image-preview"
    },
    "aspectRatio": {
      "type": "string",
      "enum": [
        "1:1",
        "2:3",
        "3:2",
        "3:4",
        "4:3",
        "4:5",
        "5:4",
        "9:16",
        "16:9",
        "21:9"
      ],
      "description": "Image aspect ratio (default: 1:1 for new, matches input for editing)",
      "default": "1:1"
    },
    "numImages": {
      "type": "number",
      "minimum": 1,
      "maximum": 4,
      "description": "Number of images to generate (default: 1)",
      "default": 1
    },
    "inputImageUri": {
      "type": "string",
      "description": "Optional file URI from uploaded file for image editing (omit for text-to-image)"
    },
    "outputDir": {
      "type": "string",
      "description": "Directory to save generated images (default: ./generated-images)"
    },
    "temperature": {
      "type": "number",
      "minimum": 0,
      "maximum": 2,
      "description": "Controls randomness (0.0-2.0, default: 1.0)",
      "default": 1
    }
  },
  "required": [
    "prompt"
  ]
}
— · —
get_fileGET FILE METADATA & UPDATE CACHE - Retrieves current metadata for specific file from Gemini API and updates cache. USAGE: Pass fileUri from upload response or list_files. RETURNS: Complete file info including uri, displayName, mimeType, sizeBytes, create/update/expiration times, sha256Hash, state. Automatically adds to cache if missing. USE CASE: Verify file state, check expiration, refresh cache entry.
Input schema
{
  "type": "object",
  "properties": {
    "fileUri": {
      "type": "string",
      "description": "The file URI or name returned from upload_file"
    }
  },
  "required": [
    "fileUri"
  ]
}
— · —
list_filesLIST ALL UPLOADED FILES - Retrieves metadata for all files currently in Gemini File API (associated with API key). Updates internal cache with latest file states. RETURNS: Array of files with uri, displayName, mimeType, sizeBytes, createTime, expirationTime, state. Also shows cachedCount indicating files ready for immediate use. USAGE: Check file availability before chat, monitor upload status, audit storage usage (20GB project limit).
Input schema
{
  "type": "object",
  "properties": {
    "pageSize": {
      "type": "number",
      "description": "Number of files to return (default 10, max 100)",
      "default": 10
    }
  }
}
— · —
start_conversationINITIALIZE CONVERSATION SESSION - Creates new conversation context for multi-turn chat with Gemini. Generates unique ID if not provided. Stores message history for context continuity. Returns conversationId to use in subsequent chat calls. USAGE: Call before first chat or to start fresh context. Pass returned ID to chat tool's conversationId parameter for continuation.
Input schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Optional custom conversation ID"
    }
  }
}
— · —
upload_fileUPLOAD 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
{
  "type": "object",
  "properties": {
    "filePath": {
      "type": "string",
      "description": "Absolute path to the file to upload"
    },
    "displayName": {
      "type": "string",
      "description": "Optional display name for the file"
    },
    "mimeType": {
      "type": "string",
      "description": "Optional MIME type (auto-detected if not provided)"
    }
  },
  "required": [
    "filePath"
  ]
}
— · —
upload_multiple_filesUPLOAD MULTIPLE FILES EFFICIENTLY - Handles 2-40+ files with smart parallel processing. TYPICAL USE: 2-10 files for multi-document analysis, code reviews, or comparative tasks. SCALES TO: 40+ files for comprehensive dataset processing. FEATURES: Automatic retry (3 attempts), parallel uploads (5 concurrent default), processing state monitoring (waits for ACTIVE state). WORKFLOW: 1) Provide array of file paths, 2) System uploads in optimized batches, 3) Returns URIs for use in chat tool. PERFORMANCE: 2 files = ~30 seconds, 10 files = ~1-2 minutes, 40 files = ~2-3 minutes. Each successful upload returns: originalPath, file object, URI. Failed uploads include error details. Use upload_file for single files instead.
Input schema
{
  "type": "object",
  "properties": {
    "filePaths": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Array of absolute file paths to upload"
    },
    "maxConcurrent": {
      "type": "number",
      "description": "Maximum concurrent uploads (default: 5, max: 10)",
      "default": 5,
      "minimum": 1,
      "maximum": 10
    },
    "waitForProcessing": {
      "type": "boolean",
      "description": "Wait for all files to be in ACTIVE state before returning",
      "default": true
    }
  },
  "required": [
    "filePaths"
  ]
}
— · —

Resources 3

Resource templates 0

Prompts 0

Let’s talk about MCP security.

Share your details and our security team will contact you.