Skip to main content
Glama

list_models

Retrieve available models by type (ollama, openai, huggingface, ggml) for use as attack or target models in Garak-MCP's LLM vulnerability scanner.

Instructions

List all available models for a given model type.
Those models can be used for the attack and target models.

Args:
    model_type (str): The type of model to list (ollama, openai, huggingface, ggml)

Returns:
    list[str]: A list of available models.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_typeYes

Implementation Reference

  • MCP tool handler for 'list_models'. Decorated with @mcp.tool() to register and execute the tool logic by calling ModelConfig.list_models.
    @mcp.tool()
    def list_models(model_type: str) -> list[str]:
        """
        List all available models for a given model type.
        Those models can be used for the attack and target models.
    
        Args:
            model_type (str): The type of model to list (ollama, openai, huggingface, ggml)
    
        Returns:
            list[str]: A list of available models.
        """
        return GarakServer().config.list_models(model_type)
  • src/server.py:118-118 (registration)
    Registration of the 'list_models' tool using FastMCP's @mcp.tool() decorator.
    @mcp.tool()
  • Helper method in ModelConfig that implements the core logic for listing models by delegating to type-specific model getters.
    def list_models(self, model_type: str) -> List[str]:
        """
        List available models for a given model type.
        
        Args:
            model_type (str): The type of model (ollama, openai, huggingface, ggml)
            
        Returns:
            List[str]: List of available model names
        """
        if model_type not in self.model_types:
            raise ValueError(f"Invalid model type: {model_type}")
        
        return self.model_types[model_type]["models"]()
  • Helper function to fetch Ollama models via API.
    def _get_ollama_models(self) -> List[str]:
        """Get list of installed Ollama models"""
        try:
            response = requests.get('http://localhost:11434/api/tags')
            response.raise_for_status()
            data = response.json()
            return [model['name'] for model in data.get('models', [])]
        except requests.exceptions.RequestException as e:
            print(f"Error fetching Ollama models: {e}")
            return []
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. It discloses that the tool returns a list of strings and hints at a use case (for attack/target models), but fails to mention critical behavioral traits such as whether this is a read-only operation, if there are rate limits, authentication needs, or error conditions. For a tool with zero annotation coverage, this is a significant gap.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first, followed by parameter and return details. Every sentence adds value, but the second sentence could be more integrated or omitted for tighter structure without losing clarity.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but lacks depth. It covers the basic purpose and parameter semantics but omits behavioral transparency aspects like safety or performance, which are important even for simple tools. With no output schema, it does explain the return type, which helps.

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

Parameters4/5

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

With 0% schema description coverage, the description must compensate, which it does by explaining the single parameter 'model_type' with examples (ollama, openai, huggingface, ggml). This adds meaningful context beyond the schema's basic type definition, though it doesn't detail format constraints or validation rules.

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: 'List all available models for a given model type.' It specifies the verb ('list') and resource ('models'), and distinguishes it from siblings like 'list_model_types' by focusing on models within a type rather than types themselves. However, it doesn't fully differentiate from 'get_report' or 'run_attack', which are unrelated but still siblings.

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

Usage Guidelines3/5

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

The description implies usage context by stating 'Those models can be used for the attack and target models,' linking it to 'run_attack' and suggesting when this tool might be preparatory. However, it lacks explicit guidance on when to use this versus alternatives like 'list_model_types' or prerequisites for invoking it, leaving some ambiguity.

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

Related 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/EdenYavin/Garak-MCP'

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