Skip to main content
Glama
emgeee

MCP Ollama Server

list_models

Retrieve all downloaded Ollama models available for use through the MCP Ollama Server integration.

Instructions

List all downloaded Ollama models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_models' tool. Decorated with @mcp.tool() for registration. Uses the ollama Client to list models, formats name, size, and modified time for each, returns formatted string or error.
    @mcp.tool()
    async def list_models() -> str:
        """List all downloaded Ollama models"""
        try:
            models = ollama.list()
            if not models.get('models'):
                return "No models found"
    
            formatted_models = []
            for model in models['models']:
                formatted_models.append(
                    f"Name: {model.get('model', 'Unknown')}\n"
                    f"Size: {model.get('size', 'Unknown')}\n"
                    f"Modified: {model.get('modified_at', 'Unknown')}\n"
                    "---"
                )
            return "\n".join(formatted_models)
        except Exception as e:
            return f"Error listing models: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't mention any side effects, permissions needed, rate limits, or what the output format looks like (e.g., list structure, pagination). This leaves significant gaps for a tool with zero 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 purpose without any fluff or unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 tool has no annotations, no output schema, and the description lacks behavioral details (e.g., output format, side effects), it's incomplete. For a list operation, the agent needs to know what the return looks like, but this isn't addressed, making it inadequate despite the simplicity.

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?

The tool has zero parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter details, so it meets the baseline of 4 for tools with no parameters, as there's nothing to compensate for.

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 action ('List all') and resource ('downloaded Ollama models'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'show_model' (which might display details of a specific model), so it doesn't achieve the highest score for sibling distinction.

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 like 'ask_model' or 'show_model'. It doesn't mention prerequisites, context for usage, or any exclusions, leaving the agent without direction on tool selection.

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/emgeee/mcp-ollama'

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