Skip to main content
Glama

list_models

List all locally available Ollama models on your system, providing a clear view of your local AI assets for selection and management without cloud dependencies.

Instructions

List all locally available Ollama models.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'list_models'. Fetches models via ollama_client.list_models() and transforms results into a simplified format with name, size_gb, modified_at, and digest fields.
    async def list_models() -> list[dict[str, Any]]:
        models = await oc.list_models()
        return [
            {
                "name": m.get("name"),
                "size_gb": round(m.get("size", 0) / 1_073_741_824, 2),
                "modified_at": m.get("modified_at"),
                "digest": m.get("digest", "")[:12],
            }
            for m in models
        ]
  • The @mcp.tool decorator registering 'list_models' as an MCP tool with FastMCP, including the description 'List all locally available Ollama models.'
    @mcp.tool(
        name="list_models",
        description="List all locally available Ollama models.",
    )
  • The low-level async helper that calls the Ollama REST API endpoint /api/tags to fetch all locally available models and returns the raw JSON list.
    async def list_models() -> list[dict[str, Any]]:
        async with _client() as c:
            r = await c.get("/api/tags")
            r.raise_for_status()
            return r.json().get("models", [])
Behavior4/5

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

With no annotations, the description accurately conveys a simple read operation. It adds no extra behavioral details, but the output schema provides return structure, making it adequate.

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?

Single sentence, front-loaded verb and resource, no wasted words.

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

Completeness5/5

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

Given zero parameters, an output schema, and a straightforward purpose, the description is fully adequate.

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?

No parameters exist, and schema coverage is 100%. The description adds no extra parameter info, but the baseline is 4 for zero parameters.

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

Purpose5/5

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

The description clearly states the action (list) and resource (locally available Ollama models), effectively distinguishing from sibling tools like list_running_models.

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

Usage Guidelines4/5

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

The tool has no parameters and a trivial purpose, so usage is self-explanatory. No explicit when-to-use or alternatives are needed, but the description provides clear context.

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/deadSwank001/Nexus-MCP'

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