Skip to main content
Glama
th3nolo

OpenRouter MCP Server

by th3nolo

list_models

Retrieve available AI models from OpenRouter to select and compare options for your AI tasks.

Instructions

Get list of available OpenRouter models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The listModels() method that implements the tool logic. It fetches available models from the OpenRouter API /models endpoint, formats the response to include id, name, description, context_length, and pricing for each model, and returns the formatted results as MCP content.
    private async listModels() {
      const response = await axios.get(`${OPENROUTER_CONFIG.baseURL}/models`, {
        headers: OPENROUTER_CONFIG.headers,
      });
    
      const models = response.data.data.map((model: any) => ({
        id: model.id,
        name: model.name,
        description: model.description,
        context_length: model.context_length,
        pricing: model.pricing,
      }));
    
      return {
        content: [
          {
            type: "text" as const,
            text: `Found ${models.length} available models:\n\n${JSON.stringify(models, null, 2)}`,
          },
        ],
      };
    }
  • src/server.ts:137-144 (registration)
    Tool registration definition that declares the list_models tool with its name, description, and empty input schema (no parameters required).
    {
      name: "list_models",
      description: "Get list of available OpenRouter models",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/server.ts:227-228 (registration)
    Handler routing that maps the 'list_models' tool name to the listModels() method when a tool call is received.
    case "list_models":
      return await this.listModels();
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe how it behaves - no information about rate limits, authentication requirements, response format, pagination, or whether this is a read-only operation. The description is functional but lacks behavioral context.

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 states exactly what the tool does without any wasted words. It's appropriately sized for a simple list operation and gets straight to the point.

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 list operation with no parameters and no output schema, the description is adequate but minimal. It tells what the tool does but doesn't provide context about the return format, filtering options, or how this differs from similar tools. Given the simplicity of the tool, it's minimally viable but could be more helpful.

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 baseline is 4. The description appropriately doesn't discuss parameters since none exist, and it doesn't need to compensate for any schema gaps.

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 'Get' and resource 'list of available OpenRouter models', making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_model_info' or 'compare_models', which might also involve retrieving model information.

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 like 'get_model_info' or 'compare_models'. There's no mention of prerequisites, context, or specific use cases that would help an agent choose between these sibling tools.

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/th3nolo/openrouter-mcp'

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