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
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Name of the model to delete | |
| format | No | json |
Implementation Reference
- src/tools/delete.ts:10-20 (handler)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); } - src/tools/delete.ts:22-45 (registration)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); }, }; - src/schemas.ts:176-182 (schema)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'), }); - src/schemas.ts:177-177 (helper)Comment indicating this schema is for the ollama_delete tool.
* Schema for ollama_delete tool