Skip to main content
Glama

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

Implementation Reference

  • 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 } } }; }
  • 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'] } } } },
  • 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'] } } }
  • 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);

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