get_model_info
Retrieve detailed specifications and pricing information for any AI model available through OpenRouter to evaluate capabilities and costs.
Instructions
Get detailed information about a specific model
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model ID to get information about |
Implementation Reference
- src/server.ts:415-434 (handler)The actual implementation of get_model_info tool. This method fetches all models from OpenRouter API, finds the requested model by ID, and returns its detailed information. Throws an error if the model is not found.
private async getModelInfo(params: { model: string }) { const response = await axios.get(`${OPENROUTER_CONFIG.baseURL}/models`, { headers: OPENROUTER_CONFIG.headers, }); const model = response.data.data.find((m: any) => m.id === params.model); if (!model) { throw new Error(`Model ${params.model} not found`); } return { content: [ { type: "text" as const, text: JSON.stringify(model, null, 2), }, ], }; } - src/server.ts:203-216 (registration)Tool registration in ListToolsRequestSchema handler. Defines the tool name 'get_model_info', its description, and the inputSchema specifying a required 'model' string parameter.
{ name: "get_model_info", description: "Get detailed information about a specific model", inputSchema: { type: "object", properties: { model: { type: "string", description: "Model ID to get information about", }, }, required: ["model"], }, }, - src/server.ts:233-234 (registration)Tool invocation handler in CallToolRequestSchema switch statement. Routes 'get_model_info' requests to the getModelInfo method with the model parameter.
case "get_model_info": return await this.getModelInfo(args as { model: string });