list_models
Retrieve all available AI models from multiple providers through a unified interface to enable model selection and switching.
Instructions
List all available AI models.
Returns:
List of available model names
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_ai_hub/server.py:247-260 (handler)MCP tool handler for 'list_models'. Registers the tool via @mcp.tool() decorator and implements the logic by calling ai_client.list_models() after checking initialization.@mcp.tool() async def list_models() -> list[str]: """List all available AI models. Returns: List of available model names """ global ai_client if ai_client is None: raise RuntimeError("AI client not initialized") return ai_client.list_models()
- src/mcp_ai_hub/ai_client.py:269-271 (helper)AIClient helper method that lists available models by delegating to the config's list_available_models().def list_models(self) -> list[str]: """List all available models.""" return self.config.list_available_models()