push
Transfer AI models to a registry using MCP-powered applications. Enables seamless integration of local LLM capabilities for enhanced control and privacy.
Instructions
Push a model to a registry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/index.ts:108-115 (handler)The handler function for the 'push' tool that calls ollama.push({ model: name }) to push the model to a registry and returns the JSON result or an error message.async ({ name }) => { try { const result = await ollama.push({ model: name }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true }; } }
- src/index.ts:103-107 (schema)Input schema and metadata (title, description) for the 'push' tool, requiring a 'name' parameter of type string.{ title: "Push model", description: "Push a model to a registry", inputSchema: { name: z.string() }, },
- src/index.ts:101-116 (registration)Registration of the 'push' tool using server.registerTool, specifying the tool name, schema, and handler function.server.registerTool( "push", { title: "Push model", description: "Push a model to a registry", inputSchema: { name: z.string() }, }, async ({ name }) => { try { const result = await ollama.push({ model: name }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true }; } } );