pull
Download AI models from registries to run locally with Ollama's MCP server, enabling local LLM management and integration.
Instructions
Pull a model from a registry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the model to pull |
Implementation Reference
- src/index.ts:391-405 (handler)The handler function that executes the 'ollama pull' command using the provided model name and returns the command's output as text content.private async handlePull(args: any) { try { const { stdout, stderr } = await execAsync(`ollama pull ${args.name}`); return { content: [ { type: 'text', text: stdout || stderr, }, ], }; } catch (error) { throw new McpError(ErrorCode.InternalError, `Failed to pull model: ${formatError(error)}`); } }
- src/index.ts:137-147 (schema)The input schema defining the 'name' parameter required for the 'pull' tool.inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the model to pull', }, }, required: ['name'], additionalProperties: false, },
- src/index.ts:264-265 (registration)The switch case that registers and dispatches 'pull' tool calls to the handlePull method.case 'pull': return await this.handlePull(request.params.arguments);
- src/index.ts:134-148 (registration)The tool definition registered in the ListTools response, including name, description, and schema.{ name: 'pull', description: 'Pull a model from a registry', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the model to pull', }, }, required: ['name'], additionalProperties: false, }, },