Skip to main content
Glama
NightTrek

Ollama MCP Server

by NightTrek

list

Retrieve available local AI models from Ollama to manage and run them within MCP-powered applications.

Instructions

List models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list' tool. It runs the 'ollama list' command using execAsync, captures stdout/stderr, and returns it as text content. Errors are thrown as McpError.
    private async handleList() {
      try {
        const { stdout, stderr } = await execAsync('ollama list');
        return {
          content: [
            {
              type: 'text',
              text: stdout || stderr,
            },
          ],
        };
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `Failed to list models: ${formatError(error)}`);
      }
    }
  • The schema/declaration for the 'list' tool in the ListTools response, specifying name, description, and empty inputSchema (no parameters required).
    {
      name: 'list',
      description: 'List models',
      inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false,
      },
    },
  • src/index.ts:268-269 (registration)
    Registration/dispatch in the CallToolRequestSchema handler switch statement, which calls the handleList() method when the tool name is 'list'.
    case 'list':
      return await this.handleList();
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. 'List models' implies a read-only operation but doesn't disclose any behavioral traits such as pagination, sorting, filtering, error handling, or what happens if no models exist. This leaves significant gaps for an agent to understand how to use it effectively.

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 extremely concise with just two words, front-loaded with the action ('List') and object ('models'). There is no wasted text, making it efficient for quick scanning, though this brevity contributes to its lack of detail.

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 complexity of listing models (which could involve various types and contexts), the description is incomplete. With no annotations, no output schema, and minimal description, it fails to provide enough context for an agent to use it correctly, especially compared to siblings that might handle similar data.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it could have mentioned if any implicit parameters (like context or filters) are involved. Baseline is 4 for zero parameters.

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

Purpose2/5

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

The description 'List models' restates the tool name 'list' with a generic object ('models'), making it tautological. It doesn't specify what kind of models (e.g., AI models, data models) or from what context, nor does it differentiate from sibling tools like 'show' or 'run' that might also display information.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, and with siblings like 'show' or 'run' that might overlap in functionality, the lack of differentiation is misleading.

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/NightTrek/Ollama-mcp'

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