Skip to main content
Glama
stabgan

OpenRouter MCP Multimodal Server

by stabgan

get_model_info

Retrieve detailed specifications and capabilities for AI models to determine their suitability for text conversations or image processing tasks.

Instructions

Get details about a specific model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes

Implementation Reference

  • Implementation of the handleGetModelInfo function, which retrieves model details from the cache or API.
    export async function handleGetModelInfo(
      request: { params: { arguments: { model: string } } },
      modelCache: ModelCache,
      apiClient?: OpenRouterAPIClient,
    ) {
      const { model } = request.params.arguments;
    
      if (!modelCache.isValid() && apiClient) {
        modelCache.setModels(await apiClient.getModels());
      }
    
      if (!modelCache.isValid()) {
        return { content: [{ type: 'text', text: 'No model data available.' }], isError: true };
      }
    
      const info = modelCache.get(model);
      if (!info) {
        return { content: [{ type: 'text', text: `Model '${model}' not found.` }], isError: true };
      }
    
      return { content: [{ type: 'text', text: JSON.stringify(info, null, 2) }] };
    }
  • Tool registration for 'get_model_info' in the MCP server setup.
    {
      name: 'get_model_info',
      description: 'Get details about a specific model',
      inputSchema: {
        type: 'object',
        properties: { model: { type: 'string' } },
        required: ['model'],
      },
    },
  • Call site in the CallToolRequestSchema handler that dispatches to handleGetModelInfo.
    case 'get_model_info':
      return handleGetModelInfo(
        wrapToolArgs(args as { model: string } | undefined),
        this.modelCache,
        this.apiClient,
      );

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

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