list_models
Find available AI models by matching a substring, enabling selection of appropriate models for specific coding tasks in the Aider MCP Server.
Instructions
List available models that match the provided substring
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| substring | No | Substring to match against available models |
Implementation Reference
- The core implementation of the list_models logic, wrapping the aider model matching functionality.
def list_models(substring: str) -> List[str]: """ List available models that match the provided substring. Args: substring (str): Substring to match against available models. Returns: List[str]: List of model names matching the substring. """ return fuzzy_match_models(substring) - src/aider_mcp_server/server.py:179-197 (handler)The MCP server request handler that extracts parameters and calls the list_models function.
def process_list_models_request(params: Dict[str, Any]) -> Dict[str, Any]: """ Process a list_models request. Args: params (Dict[str, Any]): The request parameters. Returns: Dict[str, Any]: The response data. """ substring = params.get("substring", "") # Log the request details logger.info(f"List Models Request: Substring: '{substring}'") models = list_models(substring) logger.info(f"Found {len(models)} models matching '{substring}'") return {"models": models} - src/aider_mcp_server/server.py:52-64 (registration)Definition of the Tool object for 'list_models' registered in the MCP server.
LIST_MODELS_TOOL = Tool( name="list_models", description="List available models that match the provided substring", inputSchema={ "type": "object", "properties": { "substring": { "type": "string", "description": "Substring to match against available models", } }, }, ) - Data model definitions (Params, Response, Request) for the list_models tool.
class ListModelsParams(BaseModel): """Parameters for the list_models tool.""" substring: str = "" # Tool-specific response models class AICodeResponse(MCPResponse): """Response for the aider_ai_code tool.""" status: str # 'success' or 'failure' message: Optional[str] = None class ListModelsResponse(MCPResponse): """Response for the list_models tool.""" models: List[str] # Specific request types class AICodeRequest(MCPRequest): """Request for the aider_ai_code tool.""" name: str = "aider_ai_code" parameters: AICodeParams class ListModelsRequest(MCPRequest): """Request for the list_models tool.""" name: str = "list_models" parameters: ListModelsParams