delete_model
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Model name to delete. |
Implementation Reference
- server.js:266-272 (handler)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 }); } - server.js:370-382 (schema)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, };