Skip to main content
Glama
akiojin

Model Hub MCP

by akiojin

get_model

Retrieve detailed specifications for AI models from OpenAI, Anthropic, or Google using a unified interface to access model information.

Instructions

Get details of a specific model from a provider

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerYesThe AI provider
model_idYesThe model ID to fetch details for

Implementation Reference

  • src/index.ts:51-69 (registration)
    Registers the 'get_model' tool with name, description, and input schema in the list_tools response.
    {
      name: 'get_model',
      description: 'Get details of a specific model from a provider',
      inputSchema: {
        type: 'object',
        properties: {
          provider: {
            type: 'string',
            enum: ['openai', 'anthropic', 'google'],
            description: 'The AI provider',
          },
          model_id: {
            type: 'string',
            description: 'The model ID to fetch details for',
          },
        },
        required: ['provider', 'model_id'],
      },
    },
  • Executes the 'get_model' tool by dispatching to the provider-specific getModel method based on the provider input, checks API key configuration, and returns JSON stringified model details.
    case 'get_model': {
      const { provider, model_id } = args as { provider: string; model_id: string };
      
      switch (provider) {
        case 'openai':
          if (!openaiProvider) {
            throw new McpError(ErrorCode.InvalidRequest, 'OpenAI API key not configured');
          }
          const openaiModel = await openaiProvider.getModel(model_id);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(openaiModel, null, 2),
              },
            ],
          };
          
        case 'anthropic':
          if (!anthropicProvider) {
            throw new McpError(ErrorCode.InvalidRequest, 'Anthropic API key not configured');
          }
          const anthropicModel = await anthropicProvider.getModel(model_id);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(anthropicModel, null, 2),
              },
            ],
          };
          
        case 'google':
          if (!googleProvider) {
            throw new McpError(ErrorCode.InvalidRequest, 'Google API key not configured');
          }
          const googleModel = await googleProvider.getModel(model_id);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(googleModel, null, 2),
              },
            ],
          };
          
        default:
          throw new McpError(ErrorCode.InvalidRequest, `Unknown provider: ${provider}`);
      }
    }
  • OpenAI provider helper function that retrieves specific model details by making an API request to OpenAI's models endpoint.
    async getModel(modelId: string): Promise<OpenAIModel> {
      try {
        const response = await axios.get(`${this.baseURL}/models/${modelId}`, {
          headers: {
            'Authorization': `Bearer ${this.apiKey}`,
            'Content-Type': 'application/json'
          }
        });
    
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`OpenAI API error: ${error.response?.data?.error?.message || error.message}`);
        }
        throw error;
      }
    }
  • Anthropic provider helper function that retrieves specific model details by making an API request to Anthropic's models endpoint.
    async getModel(modelId: string): Promise<AnthropicModel> {
      try {
        const response = await axios.get(`${this.baseURL}/models/${modelId}`, {
          headers: {
            'x-api-key': this.apiKey,
            'anthropic-version': '2023-06-01',
            'Content-Type': 'application/json'
          }
        });
    
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Anthropic API error: ${error.response?.data?.error?.message || error.message}`);
        }
        throw error;
      }
    }
  • Google provider helper function that retrieves specific model details by making an API request to Google's Generative Language API models endpoint.
    async getModel(modelId: string): Promise<GoogleModel> {
      try {
        const response = await axios.get(`${this.baseURL}/models/${modelId}`, {
          params: {
            key: this.apiKey
          }
        });
    
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Google AI API error: ${error.response?.data?.error?.message || error.message}`);
        }
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets details' but doesn't describe what details are returned, error handling, authentication needs, rate limits, or other behavioral traits. This leaves significant gaps for an agent to understand how the tool behaves beyond basic functionality.

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 unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what details are returned, potential errors, or other contextual factors needed for effective use. For a tool with 2 parameters and no structured output information, more completeness is required to guide an agent adequately.

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?

Schema description coverage is 100%, with clear descriptions for both parameters, so the baseline is 3. The description adds no additional meaning beyond the schema, such as explaining parameter interactions or providing examples, but it doesn't need to compensate for low 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 action ('Get details') and resource ('specific model from a provider'), making the purpose understandable. It doesn't explicitly distinguish from sibling tools like 'list_all_models' or 'list_models', which appear to be listing operations rather than fetching details for a specific model, so it misses full sibling differentiation.

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 the sibling tools. It implies usage for fetching details of a specific model but doesn't specify prerequisites, exclusions, or contextual factors that would help an agent choose appropriately among available 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/akiojin/model-hub-mcp'

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