Skip to main content
Glama
aliargun

Gemini MCP Server

by aliargun

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
      }
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't specify whether this is a read-only operation, if it requires authentication, what the output format looks like, or if there are rate limits. While 'List' implies a safe read operation, the lack of explicit behavioral details is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized for a simple listing tool and front-loads the essential information, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple listing tool with one well-documented parameter and no output schema, the description is minimally adequate. However, the lack of annotations means behavioral aspects like safety or output format are undocumented, and no usage guidelines are provided. This leaves gaps that could hinder an agent's ability to use the tool effectively in complex scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'filter' well-documented via its enum values. The description adds no additional parameter semantics beyond what's in the schema, such as explaining the meaning of capabilities like 'grounding' or 'json_mode'. However, with high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('all available Gemini models and their capabilities'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'get_help' or 'analyze_image' beyond the obvious domain difference, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, typical use cases, or comparison with sibling tools like 'get_help' for model information or 'generate_text' for model interaction, leaving the agent with minimal context for decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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