Skip to main content
Glama
hyzhak

Ollama MCP Server

by hyzhak

List models

list

View available local AI models to select and manage them for private, controlled AI interactions.

Instructions

List all models in Ollama

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the 'list' tool: fetches models using ollama.list(), formats as JSON, or returns formatted error.
    async () => {
      try {
        const result = await ollama.list();
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } catch (error) {
        return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
      }
    }
  • Input schema and metadata (title, description) for the 'list' tool. No input parameters required.
    {
      title: "List models",
      description: "List all models in Ollama",
      inputSchema: {},
    },
  • src/index.ts:29-44 (registration)
    Registration of the 'list' tool using server.registerTool, including name, schema, and handler.
    server.registerTool(
      "list",
      {
        title: "List models",
        description: "List all models in Ollama",
        inputSchema: {},
      },
      async () => {
        try {
          const result = await ollama.list();
          return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
        }
      }
    );
  • Helper function used in the 'list' handler (and others) to format errors.
    const formatError = (error: unknown): string =>
      error instanceof Error ? error.message : String(error);
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, or what the output format might be (e.g., list format, pagination).

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 wasted words. It's front-loaded and appropriately sized for a simple tool with no parameters.

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 simplicity (0 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It doesn't explain the return values or behavioral context, which is important even for a list operation, making it minimally viable but not fully helpful.

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 0 parameters, and the schema description coverage is 100%, so there's no need for parameter details in the description. The baseline for this scenario is 4, as the description appropriately doesn't add unnecessary parameter information.

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 verb ('List') and resource ('all models in Ollama'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'show' which might also display model information, so it doesn't reach the highest score.

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 'show' or 'run'. It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage from the tool name alone.

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

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