Skip to main content
Glama

list_models

Discover available Gemini AI models and their specific capabilities to select the right one for your task.

Instructions

List all available Gemini models and their capabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFilter models by capability

Implementation Reference

  • The core handler function for the 'list_models' tool. It filters the GEMINI_MODELS object based on the optional 'filter' parameter and returns a formatted list of available models as JSON text.
    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 } } }; }
  • Tool registration in the getAvailableTools() method, which responds to tools/list requests. Defines the tool name, description, and input schema.
    { 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'] } } } },
  • Input schema definition for the 'list_models' tool, specifying the optional 'filter' parameter with allowed values.
    inputSchema: { type: 'object', properties: { filter: { type: 'string', description: 'Filter models by capability', enum: ['all', 'thinking', 'vision', 'grounding', 'json_mode'] } } }
  • Data structure of available Gemini models used by the list_models handler for generating the model list.
    const GEMINI_MODELS = { // Thinking models (2.5 series) - latest and most capable 'gemini-2.5-pro': { description: 'Most capable thinking model, best for complex reasoning and coding', features: ['thinking', 'function_calling', 'json_mode', 'grounding', 'system_instructions'], contextWindow: 2000000, // 2M tokens thinking: true }, 'gemini-2.5-flash': { description: 'Fast thinking model with best price/performance ratio', features: ['thinking', 'function_calling', 'json_mode', 'grounding', 'system_instructions'], contextWindow: 1000000, // 1M tokens thinking: true }, 'gemini-2.5-flash-lite': { description: 'Ultra-fast, cost-efficient thinking model for high-throughput tasks', features: ['thinking', 'function_calling', 'json_mode', 'system_instructions'], contextWindow: 1000000, thinking: true }, // 2.0 series 'gemini-2.0-flash': { description: 'Fast, efficient model with 1M context window', features: ['function_calling', 'json_mode', 'grounding', 'system_instructions'], contextWindow: 1000000 }, 'gemini-2.0-flash-lite': { description: 'Most cost-efficient model for simple tasks', features: ['function_calling', 'json_mode', 'system_instructions'], contextWindow: 1000000 }, 'gemini-2.0-pro-experimental': { description: 'Experimental model with 2M context, excellent for coding', features: ['function_calling', 'json_mode', 'grounding', 'system_instructions'], contextWindow: 2000000 }, // Legacy models (for compatibility) 'gemini-1.5-pro': { description: 'Previous generation pro model', features: ['function_calling', 'json_mode', 'system_instructions'], contextWindow: 2000000 }, 'gemini-1.5-flash': { description: 'Previous generation fast model', features: ['function_calling', 'json_mode', 'system_instructions'], contextWindow: 1000000 } };

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/aliargun/mcp-server-gemini'

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