Skip to main content
Glama

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
NameRequiredDescriptionDefault
filterNoFilter models by capability

Implementation Reference

  • 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 } } }; }
  • Zod schema for validating 'list_models' tool input parameters in ToolSchemas.
    listModels: z.object({ filter: z.enum(['all', 'thinking', 'vision', 'grounding', 'json_mode']).optional() }),
  • 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'] } } } },

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

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