delete_model
Delete a locally stored Ollama model to free disk space. Remove unnecessary models from your environment to manage storage effectively.
Instructions
Delete a locally stored Ollama model to free disk space.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/foundry_reverse/server.py:106-111 (handler)The tool handler function that executes the delete_model logic. It accepts a model_name string and delegates to the Ollama client's delete_model method.
async def delete_model(model_name: str) -> dict[str, Any]: """ Args: model_name: The exact name of the model to delete. """ return await oc.delete_model(model_name) - src/foundry_reverse/server.py:102-105 (registration)The tool registration decorator that registers 'delete_model' with the FastMCP server, including a description for the tool.
@mcp.tool( name="delete_model", description="Delete a locally stored Ollama model to free disk space.", ) - The underlying Ollama API client function that performs the actual HTTP DELETE request to '/api/delete' on the Ollama server.
async def delete_model(name: str) -> dict[str, Any]: async with _client() as c: r = await c.request("DELETE", "/api/delete", json={"name": name}) r.raise_for_status() return {"deleted": name, "status": "ok"}