Skip to main content
Glama

delete_model

Destructive

Remove a locally installed Ollama model to free up disk space. Specify the model name to delete it from your local system without affecting the remote copy.

Instructions

Delete a locally-installed model. Does not affect the remote registry copy. Free the disk space of a model you no longer need.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesModel name to delete.

Implementation Reference

  • The deleteModel function: validates the 'name' argument, sends a DELETE /api/delete request to Ollama, and returns a success response.
    async function deleteModel(args) {
      const bad = requireString(args, 'name');
      if (bad) return errorResult(bad);
      const r = await httpRequest('DELETE', '/api/delete', { name: args.name });
      if (r.error) return errorResult(r.error);
      return textResult({ name: args.name, deleted: true });
    }
  • Tool registration entry for delete_model: name, description, annotations (destructiveHint: true), and inputSchema requiring 'name' as a non-empty string.
    {
      name: 'delete_model',
      description: 'Delete a locally-installed model. Does not affect the remote registry copy. Free the disk space of a model you no longer need.',
      annotations: { title: 'Delete model', readOnlyHint: false, destructiveHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          name: { type: 'string', description: 'Model name to delete.' },
        },
        required: ['name'],
        additionalProperties: false,
      },
    },
  • server.js:385-394 (registration)
    HANDLERS map: maps the 'delete_model' string to the deleteModel function for JSON-RPC dispatch.
    const HANDLERS = {
      ollama_status: ollamaStatus,
      list_models: listModels,
      list_running: listRunning,
      show_model: showModel,
      generate: generate,
      chat: chat,
      pull_model: pullModel,
      delete_model: deleteModel,
    };
  • errorResult helper: formats an error response object.
    function errorResult(message) {
      return { content: [{ type: 'text', text: message }], isError: true };
    }
  • requireString helper: validates that a field in args is a non-empty string.
    function requireString(args, field) {
      if (typeof args[field] !== 'string' || !args[field].trim()) {
        return `${field} is required (non-empty string)`;
      }
      return null;
    }
Behavior4/5

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

Annotations already indicate destructive and non-read-only nature. The description adds valuable context: 'Does not affect the remote registry copy' and 'Free the disk space', which goes beyond the annotation hints.

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?

Two sentences, efficiently front-loaded with purpose and key behavioral constraints. 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 the simple tool (one required param, no output schema), the description fully covers purpose, scope, and side effect. Annotations provide safety profile. No gaps.

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?

Schema description coverage is 100% for the single parameter 'name', so the tool description adds no additional meaning beyond what the schema already provides.

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 explicitly states the verb 'Delete' and the resource 'locally-installed model', and distinguishes from sibling tools like pull_model, list_models, etc. by specifying local scope and effect (freeing disk space).

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

Usage Guidelines4/5

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

The description implies usage when you no longer need a model and want to free disk space, but does not explicitly state when not to use or mention alternatives among siblings.

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