get_model
Retrieve detailed information about a specific AI model by providing its model slug, including pricing, context limits, and capabilities.
Instructions
Get detailed info for one model.
Args: model_id: Model slug, e.g. 'anthropic/claude-sonnet-4.6'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/openrouter_mcp/server.py:121-136 (handler)The get_model tool handler: fetches models, looks up by exact ID, falls back to fuzzy match, and returns formatted model details.
@mcp.tool() def get_model(model_id: str) -> str: """Get detailed info for one model. Args: model_id: Model slug, e.g. 'anthropic/claude-sonnet-4.6' """ models = fetch_models() for m in models: if m["id"] == model_id: return _format_model(m, detail=True) # Fuzzy matches = [m for m in models if model_id.lower() in m["id"].lower()] if matches: return _format_model(matches[0], detail=True) return f"Model '{model_id}' not found on OpenRouter." - src/openrouter_mcp/server.py:121-121 (registration)Registration of get_model as an MCP tool via @mcp.tool() decorator.
@mcp.tool() - src/openrouter_mcp/__init__.py:5-5 (helper)Re-export of get_model from the package __init__.
from .server import main, fetch_models, list_models, get_model, search_models, compare_models, refresh_cache