Skip to main content
Glama
rawveg

Ollama MCP Server

ollama_pull

Downloads a model from the Ollama registry, making it available for local execution.

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

  • Core handler function that calls ollama.pull() to download 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);
    }
  • Cloud handler function that validates args via PullModelInputSchema and delegates to pullModel().
    handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => {
      const validated = PullModelInputSchema.parse(args);
      return pullModel(ollama, validated.model, validated.insecure, format);
    },
  • Tool definition export (toolDefinition) with name 'ollama_pull', description, inputSchema, and handler. Auto-discovered by 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);
      },
  • Zod schema (PullModelInputSchema) for ollama_pull validating 'model' (required string), 'insecure' (boolean, default false), and 'format' (enum, default 'json').
    export const PullModelInputSchema = z.object({
      model: z.string().min(1),
      insecure: z.boolean().default(false),
      format: ResponseFormatSchema.default('json'),
    });
  • Auto-loader that discovers all tools (including ollama_pull) by importing each .ts/.js file in src/tools/ and collecting exported toolDefinition objects.
    export async function discoverTools(): Promise<ToolDefinition[]> {
      const toolsDir = join(__dirname, 'tools');
      const files = await readdir(toolsDir);
    
      // Filter for .js files (production) or .ts files (development)
      // Exclude test files and declaration files
      const toolFiles = files.filter(
        (file) =>
          (file.endsWith('.js') || file.endsWith('.ts')) &&
          !file.includes('.test.') &&
          !file.endsWith('.d.ts')
      );
    
      const tools: ToolDefinition[] = [];
    
      for (const file of toolFiles) {
        const toolPath = join(toolsDir, file);
        const module = await import(toolPath);
    
        // Check if module exports tool metadata
        if (module.toolDefinition) {
          tools.push(module.toolDefinition);
        }
      }
    
      return tools;
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden for behavioral disclosure. It states the tool downloads a model, implying network usage and local storage. However, it does not mention whether it overwrites existing models, handles authentication, or any rate limits. The description is basic but not misleading.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: two sentences that directly convey the action and effect. Every word serves a purpose, and the primary verb appears first. There is no unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (pull a model), the description covers the main intent. However, it lacks details on return format, progress indication, error handling, or prerequisites (e.g., Ollama server running). With no output schema, the agent may not know what to expect from the call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has moderate description coverage (67% per context signals). The description does not add any parameter-level information beyond the schema. Since schema descriptions are fairly clear for 'model' and 'insecure', and 'format' has an enum, the lack of extra context in the tool description is acceptable but not improved.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: pulling a model from the Ollama registry and making it available locally. The verb 'pull' matches the tool name, and the resource 'model' is explicit. However, it does not explicitly distinguish from siblings like 'ollama_push' or 'ollama_copy', though the action is sufficiently different.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, exclusions, or compare to sibling tools such as 'ollama_create' or 'ollama_download' (if existed). The agent is left to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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