Skip to main content
Glama

ask_gemini

Analyze large codebases and complex projects using Google Gemini's 1M token context for architecture design, comprehensive code reviews, and extensive context analysis.

Instructions

Use Gemini for large context analysis (1M tokens), architecture design, or whole codebase review. Best for tasks requiring understanding of entire projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoOptional: Large codebase, multiple files, or extensive context to analyze
modelNoModel to use: 'flash' (default, free, fast) or 'pro' (2.5 Pro, 1M tokens, better quality, paid)flash
promptYesThe question or task for Gemini

Implementation Reference

  • The main execution logic for the 'ask_gemini' tool. Parses input arguments, selects Gemini model ('gemini-2.5-flash' or 'gemini-3-pro-preview'), constructs prompt with optional context, generates content via GoogleGenerativeAI, and formats the response.
    if (name === "ask_gemini") { const { prompt, context, model = "flash" } = args; // 모델 선택 const modelName = model === "pro" ? "gemini-3-pro-preview" // Gemini 3 Pro (최신 모델, 2025년 11월 출시) : "gemini-2.5-flash"; // 2.5 Flash (무료) const geminiModel = genAI.getGenerativeModel({ model: modelName }); // 프롬프트 구성 const fullPrompt = context ? `Context/Codebase:\n\`\`\`\n${context}\n\`\`\`\n\nTask: ${prompt}` : prompt; // Gemini 호출 const result = await geminiModel.generateContent(fullPrompt); const response = await result.response; const text = response.text(); return { content: [ { type: "text", text: `[Gemini ${ model === "pro" ? "3.0 Pro" : "2.5 Flash" }]\n\n${text}`, }, ], }; }
  • Input schema and metadata definition for the 'ask_gemini' tool, returned in ListTools response. Defines parameters: prompt (required), context (optional), model (flash/pro, default flash).
    { name: "ask_gemini", description: "Use Gemini for large context analysis (1M tokens), architecture design, or whole codebase review. Best for tasks requiring understanding of entire projects.", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "The question or task for Gemini", }, context: { type: "string", description: "Optional: Large codebase, multiple files, or extensive context to analyze", }, model: { type: "string", description: "Model to use: 'flash' (default, free, fast) or 'pro' (3 Pro, latest model, better quality, paid)", enum: ["flash", "pro"], default: "flash", }, }, required: ["prompt"], }, },
  • index.js:38-145 (registration)
    Registration of the 'ask_gemini' tool via the ListToolsRequestHandler, which lists all available tools including their schemas.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: "ask_gemini", description: "Use Gemini for large context analysis (1M tokens), architecture design, or whole codebase review. Best for tasks requiring understanding of entire projects.", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "The question or task for Gemini", }, context: { type: "string", description: "Optional: Large codebase, multiple files, or extensive context to analyze", }, model: { type: "string", description: "Model to use: 'flash' (default, free, fast) or 'pro' (3 Pro, latest model, better quality, paid)", enum: ["flash", "pro"], default: "flash", }, }, required: ["prompt"], }, }, { name: "gemini_analyze_codebase", description: "Specialized tool for analyzing entire codebases. Gemini will find patterns, duplications, architectural issues, and suggest improvements.", inputSchema: { type: "object", properties: { codebase: { type: "string", description: "The entire codebase or multiple files concatenated", }, focus: { type: "string", description: "What to focus on: 'architecture', 'duplications', 'security', 'performance', or 'general'", enum: [ "architecture", "duplications", "security", "performance", "general", ], }, }, required: ["codebase"], }, }, { name: "generate_image_gemini", description: "Generate images using Gemini 2.5 Flash Image (Nano Banana). Best for contextual understanding, image editing, multi-image composition, and iterative refinement. Free tier available.", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "Description of the image to generate (in English, max 480 tokens)", }, numberOfImages: { type: "number", description: "Number of images to generate (1-4, default: 1)", default: 1, minimum: 1, maximum: 4, }, }, required: ["prompt"], }, }, { name: "generate_image_imagen", description: "Generate images using Imagen 4. Best for photorealistic quality, high-resolution outputs, and professional branding. Paid service.", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "Description of the image to generate (in English, max 480 tokens)", }, numberOfImages: { type: "number", description: "Number of images to generate (1-4, default: 1)", default: 1, minimum: 1, maximum: 4, }, }, required: ["prompt"], }, }, ], }; });

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/Yoon-jongho/claude-to-gemini'

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