push
Upload a model to a registry for sharing or deployment. Specify the model name to transfer it from local storage to a remote repository.
Instructions
Push a model to a registry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the model to push |
Implementation Reference
- src/index.ts:407-421 (handler)The main handler function for the 'push' tool. It executes the 'ollama push' command with the provided model name and returns the output or throws an error.private async handlePush(args: any) { try { const { stdout, stderr } = await execAsync(`ollama push ${args.name}`); return { content: [ { type: 'text', text: stdout || stderr, }, ], }; } catch (error) { throw new McpError(ErrorCode.InternalError, `Failed to push model: ${formatError(error)}`); } }
- src/index.ts:149-162 (schema)The tool definition including input schema for the 'push' tool, registered in the ListTools response. Requires a 'name' string parameter.{ name: 'push', description: 'Push a model to a registry', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the model to push', }, }, required: ['name'], additionalProperties: false, },
- src/index.ts:266-267 (registration)The switch case registration/dispatch in the CallToolRequestHandler that routes 'push' tool calls to the handlePush function.case 'push': return await this.handlePush(request.params.arguments);