get_model_info
Query specifications and capabilities of any AI model to verify its parameters and supported features.
Instructions
Get details about a specific model
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes |
Implementation Reference
- src/tool-handlers/get-model-info.ts:6-35 (handler)The main handler function for the 'get_model_info' tool. Extracts the 'model' argument from the request, optionally refreshes the model cache via the API client, validates the cache, looks up the model by ID, and returns its info as JSON text.
export async function handleGetModelInfo( request: { params: { arguments: { model: string } } }, modelCache: ModelCache, apiClient?: OpenRouterAPIClient, ) { const { model } = request.params.arguments ?? { model: '' }; if (!model || typeof model !== 'string') { return toolError(ErrorCode.INVALID_INPUT, 'model is required.'); } if (apiClient) { try { await modelCache.ensureFresh(() => apiClient.getModels()); } catch (error: unknown) { return classifyUpstreamError(error, 'get_model_info'); } } if (!modelCache.isValid()) { return toolError(ErrorCode.INTERNAL, 'No model data available.'); } const info = modelCache.get(model); if (!info) { return toolError(ErrorCode.MODEL_NOT_FOUND, `Model '${model}' not found.`); } return { content: [{ type: 'text' as const, text: JSON.stringify(info, null, 2) }] }; } - src/tool-handlers.ts:239-250 (schema)Registration and input schema for the 'get_model_info' tool. Defines the tool name, description, annotations (readOnlyHint, destructiveHint, idempotentHint), and inputSchema requiring a 'model' string.
{ name: 'get_model_info', description: 'Get details about a specific model', annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, inputSchema: { type: 'object', properties: { model: { type: 'string' } }, required: ['model'], - src/tool-handlers.ts:499-504 (registration)The case branch in the tool dispatcher that routes 'get_model_info' requests to handleGetModelInfo.
case 'get_model_info': return handleGetModelInfo( wrapToolArgs(args as { model: string } | undefined), this.modelCache, this.apiClient, ); - src/tool-handlers.ts:14-15 (helper)Import binding that connects the tool-handlers module to the handleGetModelInfo function.
import { handleGetModelInfo } from './tool-handlers/get-model-info.js'; import { handleValidateModel } from './tool-handlers/validate-model.js';