list_models
Discover available Gemini AI models and their specific capabilities like thinking, vision, grounding, and JSON mode to select the right model for your task.
Instructions
List all available Gemini models and their capabilities
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filter models by capability |
Implementation Reference
- src/enhanced-stdio-server.ts:786-828 (handler)The primary handler method for the 'list_models' tool. Filters GEMINI_MODELS based on optional 'filter' parameter (all, thinking, vision, grounding, json_mode) and returns formatted JSON list with metadata.private listModels(id: any, args: any): MCPResponse { const filter = args?.filter || 'all'; let models = Object.entries(GEMINI_MODELS); if (filter !== 'all') { models = models.filter(([_, info]) => { switch (filter) { case 'thinking': return 'thinking' in info && info.thinking === true; case 'vision': return info.features.includes('function_calling'); // All current models support vision case 'grounding': return info.features.includes('grounding'); case 'json_mode': return info.features.includes('json_mode'); default: return true; } }); } const modelList = models.map(([name, info]) => ({ name, ...info })); return { jsonrpc: '2.0', id, result: { content: [ { type: 'text', text: JSON.stringify(modelList, null, 2) } ], metadata: { count: modelList.length, filter } } }; }
- src/utils/validation.ts:98-100 (schema)Zod schema for validating 'list_models' tool input parameters in ToolSchemas.listModels: z.object({ filter: z.enum(['all', 'thinking', 'vision', 'grounding', 'json_mode']).optional() }),
- src/enhanced-stdio-server.ts:338-351 (registration)Tool registration in the getTools() method's return array, defining name, description, and inputSchema for MCP tool discovery.{ name: 'list_models', description: 'List all available Gemini models and their capabilities', inputSchema: { type: 'object', properties: { filter: { type: 'string', description: 'Filter models by capability', enum: ['all', 'thinking', 'vision', 'grounding', 'json_mode'] } } } },