Skip to main content
Glama

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
NameRequiredDescriptionDefault
modelYesName of the model to pull
insecureNoAllow insecure connections
formatNojson

Implementation Reference

  • 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); },
  • 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); }
  • 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); }, };
  • 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'), });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rawveg/ollama-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server