Skip to main content
Glama
NightTrek

Ollama MCP Server

by NightTrek

create

Generate custom AI models locally by defining parameters in a Modelfile, enabling tailored machine learning solutions for specific applications.

Instructions

Create a model from a Modelfile

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the model
modelfileYesPath to Modelfile

Implementation Reference

  • The function that executes the 'create' tool by running the 'ollama create' command using the provided model name and Modelfile path.
    private async handleCreate(args: any) {
      try {
        const { stdout, stderr } = await execAsync(`ollama create ${args.name} -f ${args.modelfile}`);
        return {
          content: [
            {
              type: 'text',
              text: stdout || stderr,
            },
          ],
        };
      } catch (error) {
        throw new McpError(ErrorCode.InternalError, `Failed to create model: ${formatError(error)}`);
      }
    }
  • Input schema defining the required 'name' and 'modelfile' parameters for the 'create' tool.
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name for the model',
        },
        modelfile: {
          type: 'string',
          description: 'Path to Modelfile',
        },
      },
      required: ['name', 'modelfile'],
      additionalProperties: false,
    },
  • src/index.ts:76-94 (registration)
    Registration of the 'create' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'create',
      description: 'Create a model from a Modelfile',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name for the model',
          },
          modelfile: {
            type: 'string',
            description: 'Path to Modelfile',
          },
        },
        required: ['name', 'modelfile'],
        additionalProperties: false,
      },
    },
  • src/index.ts:258-259 (registration)
    Dispatch in CallToolRequestHandler that routes 'create' tool calls to the handleCreate method.
    case 'create':
      return await this.handleCreate(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Create a model') but fails to describe key traits: whether this is a write operation (implied but not explicit), what permissions or authentication are needed, if it's idempotent or destructive, rate limits, or what happens on success/failure. For a creation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence: 'Create a model from a Modelfile'. It is front-loaded with the core action, has zero wasted words, and is appropriately sized for the tool's complexity. Every part of the sentence contributes essential information, making it highly concise and well-structured.

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 the complexity of a model creation tool, the description is incomplete. No annotations exist to cover behavioral aspects, and there is no output schema to explain return values. The description alone lacks details on success criteria, error handling, or output format, leaving gaps that could hinder an agent's ability to use the tool effectively in context.

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 100% description coverage, with clear docs for 'name' and 'modelfile' parameters. The description adds no additional semantic meaning beyond the schema, such as format details (e.g., what constitutes a valid name or path) or constraints. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema handles the parameter documentation adequately.

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: 'Create a model from a Modelfile'. This specifies the verb ('Create'), resource ('model'), and source ('Modelfile'), making the action distinct. However, it doesn't explicitly differentiate from sibling tools like 'pull' or 'run', which might also involve model creation or usage, leaving room for ambiguity in sibling context.

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 lacks context on prerequisites (e.g., needing a Modelfile), exclusions (e.g., not for updating existing models), or comparisons to siblings like 'pull' (which might fetch models) or 'run' (which might use models). This absence leaves the agent without usage direction.

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/NightTrek/Ollama-mcp'

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