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
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional: Large codebase, multiple files, or extensive context to analyze | |
| model | No | Model to use: 'flash' (default, free, fast) or 'pro' (2.5 Pro, 1M tokens, better quality, paid) | flash |
| prompt | Yes | The question or task for Gemini |
Implementation Reference
- index.js:152-183 (handler)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}`, }, ], }; }
- index.js:41-67 (schema)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"], }, }, ], }; });