Skip to main content
Glama
rawveg

Ollama MCP Server

ollama_delete

Remove a locally stored model to free up disk space. Specify the model name and optional output format.

Instructions

Delete a model from local storage. Removes the model and frees up disk space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesName of the model to delete
formatNojson

Implementation Reference

  • The core handler function 'deleteModel' that calls ollama.delete() with the model name, then formats the response.
    export async function deleteModel(
      ollama: Ollama,
      model: string,
      format: ResponseFormat
    ): Promise<string> {
      const response = await ollama.delete({
        model,
      });
    
      return formatResponse(JSON.stringify(response), format);
    }
  • The toolDefinition export that registers the tool name 'ollama_delete', its description, input schema, and handler.
    export const toolDefinition: ToolDefinition = {
      name: 'ollama_delete',
      description:
        'Delete a model from local storage. Removes the model and frees up disk space.',
      inputSchema: {
        type: 'object',
        properties: {
          model: {
            type: 'string',
            description: 'Name of the model to delete',
          },
          format: {
            type: 'string',
            enum: ['json', 'markdown'],
            default: 'json',
          },
        },
        required: ['model'],
      },
      handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => {
        const validated = DeleteModelInputSchema.parse(args);
        return deleteModel(ollama, validated.model, format);
      },
    };
  • The DeleteModelInputSchema Zod schema for ollama_delete, validating 'model' (required string) and 'format'.
    /**
     * Schema for ollama_delete tool
     */
    export const DeleteModelInputSchema = z.object({
      model: z.string().min(1),
      format: ResponseFormatSchema.default('json'),
    });
  • Comment indicating this schema is for the ollama_delete tool.
    * Schema for ollama_delete tool
Behavior3/5

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

With no annotations, the description carries full burden. It states the destructive action and disk space effect, which is adequate but lacks details like irreversibility or any side effects.

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 concise sentences with no fluff. Every word adds value.

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

Completeness3/5

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

Given the low complexity (2 params, no output schema), the description is fairly complete but could mention that deletion is permanent or explain the format parameter's purpose.

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

Parameters2/5

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

Schema description coverage is 50% (only 'model' has a description). The description does not add meaning for the 'format' parameter (enum with defaults) beyond the schema.

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 a model from local storage') and the effect ('removes the model and frees up disk space'). This distinguishes it from siblings like ollama_chat or ollama_list.

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?

No guidance on when to use this tool versus alternatives (e.g., when to delete vs push/pull). No prerequisites or warnings about the model being in use.

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/rawveg/ollama-mcp'

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