ollama_pull
Download models from the Ollama registry to make them available locally for use with MCP-compatible applications.
Instructions
Pull a model from the Ollama registry. Downloads the model to make it available locally.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Name of the model to pull | |
| insecure | No | Allow insecure connections | |
| format | No | json |
Implementation Reference
- src/tools/pull.ts:7-23 (handler)Core handler function that performs the ollama.pull operation to download the specified model./** * Pull a model from the Ollama registry */ export async function pullModel( ollama: Ollama, model: string, insecure: boolean, format: ResponseFormat ): Promise<string> { const response = await ollama.pull({ model, insecure, stream: false, }); return formatResponse(JSON.stringify(response), format); }
- src/schemas.ts:146-153 (schema)Zod schema used for input validation in the ollama_pull tool handler./** * Schema for ollama_pull tool */ export const PullModelInputSchema = z.object({ model: z.string().min(1), insecure: z.boolean().default(false), format: ResponseFormatSchema.default('json'), });
- src/tools/pull.ts:25-53 (registration)Tool definition export that registers the 'ollama_pull' tool, including its description, inline input schema, and handler wrapper that performs validation and delegates to the core pullModel function. Auto-loaded by src/autoloader.ts.export const toolDefinition: ToolDefinition = { name: 'ollama_pull', description: 'Pull a model from the Ollama registry. Downloads the model to make it available locally.', inputSchema: { type: 'object', properties: { model: { type: 'string', description: 'Name of the model to pull', }, insecure: { type: 'boolean', description: 'Allow insecure connections', default: false, }, format: { type: 'string', enum: ['json', 'markdown'], default: 'json', }, }, required: ['model'], }, handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => { const validated = PullModelInputSchema.parse(args); return pullModel(ollama, validated.model, validated.insecure, format); }, };