Skip to main content
Glama
rawveg

Ollama MCP Server

ollama_create

Create custom AI models by specifying a base model and customizing behavior with system prompts, templates, and other parameters.

Instructions

Create a new model with structured parameters. Allows customization of model behavior, system prompts, and templates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesName for the new model
fromYesBase model to derive from (e.g., llama2, llama3)
systemNoSystem prompt for the model
templateNoPrompt template to use
licenseNoLicense for the model
formatNojson

Implementation Reference

  • Handler function for the ollama_create tool. Parses args with CreateModelInputSchema, then calls createModel() with the validated inputs.
    handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => {
      const validated = CreateModelInputSchema.parse(args);
      return createModel(
        ollama,
        {
          model: validated.model,
          from: validated.from,
          system: validated.system,
          template: validated.template,
          license: validated.license,
        },
        format
      );
    },
  • Core createModel function that calls ollama.create() and formats the response.
    export async function createModel(
      ollama: Ollama,
      options: CreateModelOptions,
      format: ResponseFormat
    ): Promise<string> {
      const response = await ollama.create({
        model: options.model,
        from: options.from,
        system: options.system,
        template: options.template,
        license: options.license,
        stream: false,
      });
    
      return formatResponse(JSON.stringify(response), format);
    }
  • Tool definition registration object with name 'ollama_create', description, inputSchema, and handler. Auto-discovered by autoloader.
    export const toolDefinition: ToolDefinition = {
      name: 'ollama_create',
      description:
        'Create a new model with structured parameters. Allows customization of model behavior, system prompts, and templates.',
      inputSchema: {
        type: 'object',
        properties: {
          model: {
            type: 'string',
            description: 'Name for the new model',
          },
          from: {
            type: 'string',
            description: 'Base model to derive from (e.g., llama2, llama3)',
          },
          system: {
            type: 'string',
            description: 'System prompt for the model',
          },
          template: {
            type: 'string',
            description: 'Prompt template to use',
          },
          license: {
            type: 'string',
            description: 'License for the model',
          },
          format: {
            type: 'string',
            enum: ['json', 'markdown'],
            default: 'json',
          },
        },
        required: ['model', 'from'],
      },
      handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => {
        const validated = CreateModelInputSchema.parse(args);
        return createModel(
          ollama,
          {
            model: validated.model,
            from: validated.from,
            system: validated.system,
            template: validated.template,
            license: validated.license,
          },
          format
        );
      },
    };
  • Zod schema CreateModelInputSchema defining validation for model, from, system, template, license, and format fields.
    export const CreateModelInputSchema = z.object({
      model: z.string().min(1),
      from: z.string().min(1),
      system: z.string().optional(),
      template: z.string().optional(),
      license: z.string().optional(),
      format: ResponseFormatSchema.default('json'),
    });
Behavior2/5

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

No annotations; description does not disclose side effects (e.g., overwrites existing model, requires pulling base model, or modifies local storage).

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 sentences, no redundancy, efficient. Could add a bit more context without losing conciseness.

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?

No output schema, no annotations; description omits important context like conflict behavior, required permissions, or outcome (e.g., local file creation). Incomplete for a tool with 6 parameters.

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 description coverage is 83%; description adds 'structured parameters' but not much beyond what schema already provides. Baseline 3 applicable.

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?

Clearly states 'Create a new model with structured parameters' and distinguishes from sibling tools like ollama_copy, ollama_delete, etc.

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 for creating a new model, but no explicit guidance on when to use vs alternatives or prerequisites (e.g., base model must exist).

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