Skip to main content
Glama

delete_model

Destructive

Delete a locally-installed model to free disk space. The remote registry copy is unaffected, so you can re-download it when needed.

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 actual handler function for the delete_model tool. Validates the 'name' argument is a non-empty string, sends a DELETE request to /api/delete with the model name, and returns a success result indicating the model was deleted.
    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 });
    }
  • The tool registration schema for delete_model. Defines input schema requiring a 'name' (string) parameter and provides description and annotations (destructiveHint: true).
    {
      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)
    The HANDLERS object that maps tool names to handler functions. Maps 'delete_model' 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,
    };
Behavior4/5

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

Annotations already flag destructiveHint=true. The description adds context: it doesn't affect remote registry and frees disk space, providing behavioral clarity beyond annotations.

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 two concise sentences, front-loaded with the primary action. Every sentence adds value: first defines what it does, second clarifies scope and effect.

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?

For a simple tool with one parameter, good annotations, and no output schema, the description is complete. It covers purpose, scope, and consequences without needing extra details.

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 coverage is 100% for the single parameter 'name' with description 'Model name to delete.' The tool description adds no extra parameter info, so baseline 3 is appropriate.

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 clearly states the action 'Delete' and the resource 'locally-installed model', emphasizing that remote registry copy is unaffected. It distinguishes from siblings like pull_model (download) and list_models (listing).

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?

It implicitly suggests using this tool when you want to free disk space for an unneeded model. It clarifies that deletion is local only, aiding in deciding between this and pull_model. No explicit when-not or alternatives, but sufficient.

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