Skip to main content
Glama
NightTrek

Ollama MCP Server

by NightTrek

rm

Delete local AI models from the Ollama MCP Server to manage storage and organize available models.

Instructions

Remove a model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the model to remove

Implementation Reference

  • The main handler function for the 'rm' tool. It executes the 'ollama rm {name}' command using execAsync and returns the stdout or stderr as text content, or throws an error if it fails.
    private async handleRemove(args: any) {
      try {
        const { stdout, stderr } = await execAsync(`ollama rm ${args.name}`);
        return {
          content: [
            {
              type: 'text',
              text: stdout || stderr,
            },
          ],
        };
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `Failed to remove model: ${formatError(error)}`);
      }
    }
  • src/index.ts:192-206 (registration)
    Registration of the 'rm' tool in the listTools response, including name, description, and input schema.
    {
      name: 'rm',
      description: 'Remove a model',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the model to remove',
          },
        },
        required: ['name'],
        additionalProperties: false,
      },
    },
  • Input schema definition for the 'rm' tool, specifying an object with a required 'name' string property.
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the model to remove',
        },
      },
      required: ['name'],
      additionalProperties: false,
    },
  • Dispatch case in the main CallToolRequestSchema handler that routes 'rm' tool calls to the handleRemove function.
    case 'rm':
      return await this.handleRemove(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Remove' implies a destructive operation, but the description doesn't specify whether this is permanent, reversible, requires confirmation, affects dependencies, or has side effects. For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

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 at just three words, with zero wasted language. It's front-loaded with the core action and resource, making it immediately scannable and efficient for an AI agent.

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?

For a destructive tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'remove' entails (deletion, uninstallation, etc.), what happens after removal, error conditions, or confirmation requirements. The agent lacks crucial context for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'name' documented as 'Name of the model to remove'. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 when schema coverage is high.

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 'Remove a model' clearly states the action (remove) and the resource (model), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential alternatives like 'delete' or explain what type of model is being removed, which prevents a perfect 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. With sibling tools like 'create', 'list', 'show', and 'run', there's no indication whether 'rm' is for local models, remote models, or specific contexts. The agent must 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/NightTrek/Ollama-mcp'

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