Skip to main content
Glama
rawveg

Ollama MCP Server

ollama_push

Upload a local model to the Ollama registry to make it accessible from remote locations.

Instructions

Push a model to the Ollama registry. Uploads a local model to make it available remotely.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesName of the model to push
insecureNoAllow insecure connections
formatNojson

Implementation Reference

  • The core handler function that executes the push operation. Calls ollama.push() with model, insecure flag, and stream:false, then formats the response as JSON.
    export async function pushModel(
      ollama: Ollama,
      model: string,
      insecure: boolean,
      format: ResponseFormat
    ): Promise<string> {
      const response = await ollama.push({
        model,
        insecure,
        stream: false,
      });
    
      return formatResponse(JSON.stringify(response), format);
    }
  • Zod schema for validating the ollama_push tool's input parameters: model (required string), insecure (optional boolean, default false), and format (optional enum, default 'json').
    export const PushModelInputSchema = z.object({
      model: z.string().min(1),
      insecure: z.boolean().default(false),
      format: ResponseFormatSchema.default('json'),
    });
  • The tool definition registration object exported as 'toolDefinition'. Defines the tool name 'ollama_push', description, input schema properties with types/descriptions/defaults, and the handler function that validates args and calls pushModel.
    export const toolDefinition: ToolDefinition = {
      name: 'ollama_push',
      description:
        'Push a model to the Ollama registry. Uploads a local model to make it available remotely.',
      inputSchema: {
        type: 'object',
        properties: {
          model: {
            type: 'string',
            description: 'Name of the model to push',
          },
          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 = PushModelInputSchema.parse(args);
        return pushModel(ollama, validated.model, validated.insecure, format);
      },
    };
  • The autoloader discovers tool definitions (including ollama_push) by scanning the tools directory for modules exporting a 'toolDefinition' and collects them into an array.
      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;
    }
  • Utility function that formats the push response output as either JSON or markdown based on the requested format.
    export function formatResponse(
      content: string,
      format: ResponseFormat
    ): string {
      if (format === ResponseFormat.JSON) {
        // For JSON format, validate and potentially wrap errors
        try {
          // Try to parse to validate it's valid JSON
          JSON.parse(content);
          return content;
        } catch {
          // If not valid JSON, wrap in error object
          return JSON.stringify({
            error: 'Invalid JSON content',
            raw_content: content,
          });
        }
      }
    
      // Format as markdown
      try {
        const data = JSON.parse(content);
        return jsonToMarkdown(data);
      } catch {
        // If not valid JSON, return as-is
        return content;
      }
    }
Behavior2/5

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

No annotations provided, so description must fully disclose behavior. Describes upload action but omits details about overwrite behavior, authentication, rate limits, or the effect of the 'insecure' parameter. Significant gaps.

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

Conciseness4/5

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

Two concise sentences with no redundant information. Could be slightly improved by front-loading key info, but overall efficient.

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

Completeness2/5

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

Given 3 parameters, no output schema, and no annotations, the description is insufficient. Missing error cases, return format, prerequisites, and detailed usage steps.

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?

Schema coverage is 67% (2 of 3 params described). Description adds no extra meaning beyond the schema—repeats 'push' and 'local to remote' but doesn't explain model naming, insecure usage, or format output.

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

Purpose5/5

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

The description uses a specific verb ('push') and resource ('model to the Ollama registry'), clearly indicating the action. It distinguishes from sibling tools like ollama_pull (download) and ollama_list.

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

Usage Guidelines3/5

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

Implies usage: uploading a local model for remote availability. However, lacks explicit when-to-use vs alternatives, prerequisite (model must exist locally), or context about when to choose this over ollama_copy.

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