Skip to main content
Glama

list_supported_models

Discover available Gemini models compatible with the generateContent method for analyzing YouTube videos through the YouTube Vision MCP server.

Instructions

Lists available Gemini models that support the 'generateContent' method.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_supported_models' tool. It fetches the list of Gemini models from the REST API endpoint, filters for those supporting 'generateContent', and returns a formatted text list or an error response.
    case "list_supported_models": {
        try {
          console.error(`[INFO] Received request to list supported models.`);
    
          // Call the Gemini REST API to list models
          const listModelsUrl = `https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey}`;
          const response = await fetch(listModelsUrl);
    
          if (!response.ok) {
            let errorDetail = await response.text();
            let errorMessage = `Failed to fetch models from API (${response.status} ${response.statusText}).`;
            switch (response.status) {
              case 401:
              case 403:
                errorMessage = `Invalid API Key or permission denied for model listing.`;
                break;
              case 404:
                errorMessage = `Model listing API endpoint not found.`;
                break;
              case 429:
                errorMessage = `API quota exceeded for model listing.`;
                break;
              default:
                if (response.status >= 400 && response.status < 500) {
                  errorMessage = `Invalid request to model listing API (${response.status}).`;
                } else if (response.status >= 500) {
                   errorMessage = `Gemini API server error during model listing (${response.status}).`;
                }
            }
            throw new Error(`${errorMessage} Details: ${errorDetail}`);
          }
    
          const data = await response.json();
    
          // Ensure data.models is an array before filtering
          const allModels: any[] = Array.isArray(data?.models) ? data.models : [];
    
          const supportedModels = allModels
            .filter(model => model.supportedGenerationMethods?.includes('generateContent'))
            .map(model => model.name);
    
          console.error(`[INFO] Found ${supportedModels.length} models supporting generateContent via REST API.`);
    
          if (supportedModels.length === 0) {
             return {
               content: [{ type: "text", text: "No models found supporting 'generateContent' via REST API." }],
             };
          }
    
          return {
            content: [{ type: "text", text: `Models supporting 'generateContent' (fetched via REST API):\n- ${supportedModels.join('\n- ')}` }],
          };
    
        } catch (error: any) {
          // Catch errors from fetch itself or the re-thrown error from response check
          console.error(`[ERROR] Failed during list_supported_models tool execution:`, error);
          let errorMessage = `Failed to list supported models.`; // Default message
          if (error.message) {
            errorMessage += ` Details: ${error.message}`;
          }
          return {
            content: [{ type: "text", text: errorMessage }],
            isError: true,
          };
        }
      }
  • src/index.ts:86-90 (registration)
    Tool registration within the ListToolsRequestSchema handler, defining the tool's name, description, and empty input schema.
    {
      name: "list_supported_models",
      description: "Lists available Gemini models that support the 'generateContent' method.",
      inputSchema: zodToJsonSchema(z.object({})), // No input needed
    },
  • Input schema definition for the tool: an empty object schema since no parameters are required.
    inputSchema: zodToJsonSchema(z.object({})), // No input needed
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It lacks details on permissions, rate limits, output format, or whether it's a read-only operation. 'Lists' implies a safe read, but this isn't explicitly confirmed, leaving behavioral gaps.

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 redundancy. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, with no wasted verbiage.

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 simplicity (0 parameters, no output schema), the description is minimally adequate but incomplete. It explains what the tool does but lacks context on why to use it, output details, or behavioral traits. For a list operation, this is the bare minimum, scoring a 3.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds no parameter information, which is appropriate here. Baseline is 4 for zero parameters, as no compensation is needed.

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 ('Lists') and resource ('available Gemini models'), specifying they support the 'generateContent' method. It distinguishes from sibling tools (YouTube-related) by focusing on model listing rather than video processing. However, it doesn't explicitly differentiate from hypothetical model-related siblings, keeping it at 4 rather than 5.

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. It doesn't mention prerequisites, context for selecting models, or relationships to sibling tools. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

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/minbang930/Youtube-Vision-MCP'

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