Skip to main content
Glama
hyzhak

Ollama MCP Server

by hyzhak

Remove model

rm

Delete a local AI model from your Ollama environment to manage storage and organize available models.

Instructions

Remove a model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The handler function for the 'rm' tool that executes ollama.delete({ model: name }) to remove the model and handles errors using formatError.
    async ({ name }) => {
      try {
        const result = await ollama.delete({ model: name });
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } catch (error) {
        return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
      }
    }
  • Input schema defining the required 'name' parameter as a string using Zod.
    inputSchema: { name: z.string() },
  • src/index.ts:137-152 (registration)
    Full registration of the 'rm' tool, including schema and handler function.
    server.registerTool(
      "rm",
      {
        title: "Remove model",
        description: "Remove a model",
        inputSchema: { name: z.string() },
      },
      async ({ name }) => {
        try {
          const result = await ollama.delete({ model: name });
          return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
        }
      }
    );
Behavior1/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 of behavioral disclosure. 'Remove a model' implies a destructive mutation, but it doesn't specify if this is permanent, requires confirmation, affects related resources, or has side effects. The description fails to add any behavioral context beyond the basic action.

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 three words, front-loading the core action. There is zero waste or redundancy, making it efficient for quick parsing, though this brevity contributes to its inadequacy in other dimensions.

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

Completeness1/5

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

Given the complexity of a destructive tool with no annotations, 0% schema coverage, and no output schema, the description is completely inadequate. It lacks essential details like behavioral risks, parameter meaning, or usage context, leaving the agent ill-equipped to invoke it correctly.

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

Parameters1/5

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

Schema description coverage is 0%, meaning the single parameter 'name' is undocumented in the schema. The description 'Remove a model' adds no information about the parameter, such as what 'name' refers to, format expectations, or examples. It doesn't compensate for the lack of schema documentation.

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 'Remove a model' restates the title 'Remove model' almost verbatim, making it tautological. While it does specify the verb 'remove' and resource 'model', it lacks specificity about what type of model or what removal entails. It doesn't distinguish from siblings like 'create' or 'list', which is a missed opportunity for clarity.

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 prerequisites (e.g., needing an existing model), exclusions, or comparisons to siblings like 'create' or 'list'. This leaves the agent without context for appropriate tool selection.

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