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:49-52 (handler)The handler function for the ollama_pull tool. It parses the input arguments using the PullModelInputSchema and delegates to the pullModel helper function.handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => { const validated = PullModelInputSchema.parse(args); return pullModel(ollama, validated.model, validated.insecure, format); },
- src/tools/pull.ts:10-23 (helper)Core implementation logic that performs the actual model pull using the Ollama client's pull method and formats the response.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/tools/pull.ts:25-53 (registration)The toolDefinition export that registers the ollama_pull tool, including its name, description, input schema, and handler reference.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); }, };
- src/schemas.ts:146-153 (schema)Zod input validation schema for ollama_pull tool, imported and used in the handler for parsing arguments./** * Schema for ollama_pull tool */ export const PullModelInputSchema = z.object({ model: z.string().min(1), insecure: z.boolean().default(false), format: ResponseFormatSchema.default('json'), });