Skip to main content
Glama
disler
by disler

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
NameRequiredDescriptionDefault
substringNoSubstring 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)
  • 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}
  • 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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions substring matching but fails to describe key behaviors like whether the list is paginated, if it includes metadata, what happens when no substring is provided, or any rate limits. This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a list of model names, full details), behavioral traits like error handling, or usage context relative to the sibling tool. For a tool with no structured support, this leaves too many unknowns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'substring' fully documented in the schema. The description adds minimal value by implying substring matching but doesn't provide additional semantics beyond what the schema already states, such as case sensitivity or matching patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('List') and resource ('available models'), and includes the filtering mechanism ('match the provided substring'). It distinguishes itself from a generic list operation by specifying substring matching, though it doesn't explicitly differentiate from the sibling tool 'aider_ai_code'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as the sibling 'aider_ai_code' or other potential model-related tools. It lacks context about prerequisites, exclusions, or specific scenarios where substring matching is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/disler/aider-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server