Skip to main content
Glama
gurveeer

MCP Server Gemini

by gurveeer

list_models

Discover available Gemini AI models and their capabilities to select the right one for tasks like reasoning, vision processing, or JSON generation.

Instructions

List all available Gemini models and their capabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFilter models by capability

Implementation Reference

  • Main execution logic for the list_models tool. Filters GEMINI_MODELS based on optional 'filter' parameter and returns JSON-formatted list.
    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
          }
        }
      };
    }
  • Dispatch case in handleToolCall method that routes list_models tool calls to the handler.
    case 'list_models':
      return this.listModels(request.id, args);
  • Tool registration in getAvailableTools() - defines name, description, and input schema advertised in tools/list response.
    {
      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']
          }
        }
      }
    },
  • Zod validation schema for list_models parameters (defined but not explicitly used in handler).
    listModels: z.object({
      filter: z.enum(['all', 'thinking', 'vision', 'grounding', 'json_mode']).optional()
    }),
  • Data structure of available models used by the list_models handler to generate the response.
    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. It states what the tool does but doesn't describe key behaviors such as whether it's a read-only operation, if it requires authentication, rate limits, or what the output format looks like (e.g., list structure, pagination). This leaves significant gaps for an agent to understand how to interact with it effectively.

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 unnecessary words. It's front-loaded and appropriately sized for a simple tool, 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?

Given the tool's low complexity (one optional parameter) and rich schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it doesn't fully compensate by explaining return values or behavioral traits, leaving the agent with incomplete context for proper usage.

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 a clear enum for the 'filter' parameter. The description mentions 'capabilities', which aligns with the schema's 'filter by capability', but doesn't add meaningful semantics beyond what the schema already provides (e.g., explaining what each enum value means in context). This meets the baseline for high schema coverage.

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 verb ('List') and resource ('all available Gemini models and their capabilities'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_help' or 'analyze_image', which might also involve model information, so it doesn't reach the highest 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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this should be used for discovery before calling 'generate_text' or how it relates to 'get_help'. The description lacks context about usage scenarios or exclusions.

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

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