pull_model
Download a model from the Ollama registry for local use. Blocks until complete.
Instructions
Download a model from the Ollama registry. Blocks until complete — can take a long time for multi-GB models. For very large pulls, prefer ollama pull in a terminal where you can watch progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Model name to pull (e.g. "llama3.1:8b"). |
Implementation Reference
- server.js:248-263 (handler)The `pullModel` function is the handler for the `pull_model` tool. It validates the required 'name' argument, sends an HTTP POST request to Ollama's /api/pull endpoint with stream:false, and returns the model name, status, and success flag.
async function pullModel(args) { const bad = requireString(args, 'name'); if (bad) return errorResult(bad); // Use stream:false — Ollama buffers and returns a single final event. // For very large models this can block the connection for a long time; // users pulling multi-GB models are better served by `ollama pull` in a // terminal where they can see progress. Documented in the README. const r = await httpRequest('POST', '/api/pull', { name: args.name, stream: false }); if (r.error) return errorResult(r.error); const d = r.data || {}; return textResult({ name: args.name, status: d.status || 'unknown', success: d.status === 'success', }); } - server.js:357-368 (schema)Tool definition/schema for 'pull_model'. Includes name, description, annotations (title: 'Pull model'), and inputSchema requiring a 'name' string (e.g. 'llama3.1:8b').
{ name: 'pull_model', description: 'Download a model from the Ollama registry. Blocks until complete — can take a long time for multi-GB models. For very large pulls, prefer `ollama pull` in a terminal where you can watch progress.', annotations: { title: 'Pull model', readOnlyHint: false, destructiveHint: false, openWorldHint: true }, inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Model name to pull (e.g. "llama3.1:8b").' }, }, required: ['name'], additionalProperties: false, }, - server.js:384-394 (registration)The HANDLERS map at line 392 registers 'pull_model' to the pullModel function, which is looked up during tools/call dispatch in the handle() function.
const HANDLERS = { ollama_status: ollamaStatus, list_models: listModels, list_running: listRunning, show_model: showModel, generate: generate, chat: chat, pull_model: pullModel, delete_model: deleteModel, };