Skip to main content
Glama

ollama_copy

Duplicate an existing Ollama model by creating a copy with a new name for testing, sharing, or versioning purposes.

Instructions

Copy a model. Creates a duplicate of an existing model with a new name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesName of the source model
destinationYesName for the copied model
formatNojson

Implementation Reference

  • Core function that executes the ollama_copy tool logic: copies the model using ollama.copy() and formats the response.
    /** * Copy a model */ export async function copyModel( ollama: Ollama, source: string, destination: string, format: ResponseFormat ): Promise<string> { const response = await ollama.copy({ source, destination, }); return formatResponse(JSON.stringify(response), format); }
  • Registration of the 'ollama_copy' tool, including name, description, inline input schema, and handler that validates args and calls copyModel.
    export const toolDefinition: ToolDefinition = { name: 'ollama_copy', description: 'Copy a model. Creates a duplicate of an existing model with a new name.', inputSchema: { type: 'object', properties: { source: { type: 'string', description: 'Name of the source model', }, destination: { type: 'string', description: 'Name for the copied model', }, format: { type: 'string', enum: ['json', 'markdown'], default: 'json', }, }, required: ['source', 'destination'], }, handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => { const validated = CopyModelInputSchema.parse(args); return copyModel(ollama, validated.source, validated.destination, format); }, };
  • Zod schema used for input validation in the ollama_copy handler: requires source and destination model names.
    /** * Schema for ollama_copy tool */ export const CopyModelInputSchema = z.object({ source: z.string().min(1), destination: z.string().min(1), 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