validate_model
Verify model availability by checking if a specific model ID exists within the OpenRouter MCP Multimodal Server's ecosystem before use.
Instructions
Check if a model ID exists
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes |
Implementation Reference
- src/tool-handlers/validate-model.ts:4-25 (handler)The implementation of the 'validate_model' tool, which checks if a model ID exists using the model cache.
export async function handleValidateModel( request: { params: { arguments: { model: string } } }, modelCache: ModelCache, apiClient?: OpenRouterAPIClient, ) { if (!modelCache.isValid() && apiClient) { modelCache.setModels(await apiClient.getModels()); } if (!modelCache.isValid()) { return { content: [{ type: 'text', text: 'No model data available.' }], isError: true }; } return { content: [ { type: 'text', text: JSON.stringify({ valid: modelCache.has(request.params.arguments.model) }), }, ], }; } - src/tool-handlers.ts:108-116 (registration)The definition/schema registration for the 'validate_model' tool.
{ name: 'validate_model', description: 'Check if a model ID exists', inputSchema: { type: 'object', properties: { model: { type: 'string' } }, required: ['model'], }, }, - src/tool-handlers.ts:160-165 (handler)The handler dispatch logic for 'validate_model' inside the main request handler switch statement.
case 'validate_model': return handleValidateModel( wrapToolArgs(args as { model: string } | undefined), this.modelCache, this.apiClient, );