Skip to main content
Glama

list_models

Read-only

Retrieve details of locally-installed Ollama models, including name, size, family, parameter size, and quantization level.

Instructions

List locally-installed models: name, size in bytes, digest, modified timestamp, family (e.g. llama), parameter size (e.g. 8.0B), and quantization level (e.g. Q4_K_M).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the list_models tool logic. It calls Ollama's GET /api/tags endpoint, maps the response to include model name, size, digest, modified_at, family, parameter_size, and quantization_level, then returns the results as text.
    async function listModels() {
      const r = await httpRequest('GET', '/api/tags');
      if (r.error) return errorResult(r.error);
      const models = (r.data?.models || []).map((m) => ({
        name: m.name,
        size_bytes: m.size,
        digest: m.digest,
        modified_at: m.modified_at,
        family: m.details?.family || null,
        parameter_size: m.details?.parameter_size || null,
        quantization_level: m.details?.quantization_level || null,
      }));
      return textResult({ count: models.length, models });
    }
  • The tool registration definition in the TOOLS array for list_models, including its name, description, annotations (readOnlyHint: true), and inputSchema (no parameters required, empty properties object).
    {
      name: 'list_models',
      description: 'List locally-installed models: name, size in bytes, digest, modified timestamp, family (e.g. llama), parameter size (e.g. 8.0B), and quantization level (e.g. Q4_K_M).',
      annotations: { title: 'List installed models', readOnlyHint: true, destructiveHint: false, openWorldHint: false },
      inputSchema: { type: 'object', properties: {}, additionalProperties: false },
    },
  • server.js:385-394 (registration)
    The HANDLERS mapping object that maps the string 'list_models' to the listModels function, used at dispatch time in the tools/call handler.
    const HANDLERS = {
      ollama_status: ollamaStatus,
      list_models: listModels,
      list_running: listRunning,
      show_model: showModel,
      generate: generate,
      chat: chat,
      pull_model: pullModel,
      delete_model: deleteModel,
    };
  • server.js:410-410 (registration)
    The tools/list handler that serves the TOOLS array (including list_models) to clients during MCP capability negotiation.
    if (method === 'tools/list') { respond(id, { tools: TOOLS }); return; }
  • The textResult helper function used by listModels to wrap the response in the standard MCP content format.
    function textResult(obj) {
      return { content: [{ type: 'text', text: JSON.stringify(obj, null, 2) }] };
    }
    function errorResult(message) {
      return { content: [{ type: 'text', text: message }], isError: true };
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds value by detailing the exact fields returned (size, digest, family, params, quantization), providing context beyond annotations without contradiction.

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, front-loaded sentence that efficiently communicates purpose and return fields with 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 no output schema, the description fully documents the return fields. Combined with annotations, it provides complete context for a simple list operation.

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 zero parameters and 100% schema coverage, the baseline is 4. The description correctly avoids adding redundant parameter info.

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 'List locally-installed models' and enumerates the specific fields returned. This distinguishes it from sibling tools like list_running (running models) and show_model (single model details).

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 for viewing all installed models but provides no explicit guidance on when to use this tool versus alternatives (e.g., show_model for details, list_running for active models).

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

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