list_models
Retrieve available Gemini AI models and their specific capabilities to select the appropriate 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:738-778 (handler)The handler function for the list_models tool. Filters the GEMINI_MODELS constant based on an optional 'filter' parameter and returns a formatted MCP response with the list of models as JSON text and 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/enhanced-stdio-server.ts:325-338 (registration)Registration of the list_models tool in the tools array, including name, description, and input schema definition.{ 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'] } } } },
- src/enhanced-stdio-server.ts:328-337 (schema)Input schema definition for the list_models tool, specifying an optional filter parameter with allowed enum values.inputSchema: { type: 'object', properties: { filter: { type: 'string', description: 'Filter models by capability', enum: ['all', 'thinking', 'vision', 'grounding', 'json_mode'] } } }
- src/enhanced-stdio-server.ts:483-484 (registration)Dispatch/registration case in handleToolCall switch statement that routes list_models calls to the listModels handler.case 'list_models': return this.listModels(request.id, args);