pull
Retrieve AI models from a registry using the Ollama MCP Server to integrate and manage local language models with full control and privacy.
Instructions
Pull a model from a registry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/index.ts:90-97 (handler)The handler function that performs the model pull using the Ollama client, serializes the result as JSON, and handles errors appropriately.async ({ name }) => { try { const result = await ollama.pull({ model: name }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true }; } }
- src/index.ts:85-89 (schema)Defines the tool schema including title, description, and inputSchema with a required 'name' string validated by Zod.{ title: "Pull model", description: "Pull a model from a registry", inputSchema: { name: z.string() }, },
- src/index.ts:83-98 (registration)Registers the 'pull' tool with the MCP server using server.registerTool, providing the name, schema, and handler function.server.registerTool( "pull", { title: "Pull model", description: "Pull a model from a registry", inputSchema: { name: z.string() }, }, async ({ name }) => { try { const result = await ollama.pull({ model: name }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true }; } } );