pull_image
Pull container images from registries to enable deployment of containerized applications using Podman. This tool retrieves specified images for container management operations.
Instructions
Pull a container image from a registry.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Image name with optional tag |
Implementation Reference
- main_b.py:577-580 (handler)The main handler function that implements the pull_image tool logic by executing 'podman pull' on the provided image and returning the result.async def pull_image(self, args: Dict[str, Any]) -> Dict[str, Any]: image = args.get("image") result = run_podman(["pull", image]) return {"output": f"Pulled image: {image}" if result["success"] else f"Error: {result['stderr']}"}
- main_b.py:356-369 (schema)The input schema definition for the pull_image tool, specifying the required 'image' parameter.Tool( name="pull_image", description="Pull a container image from a registry", inputSchema={ "type": "object", "properties": { "image": { "type": "string", "description": "Image name with optional tag" } }, "required": ["image"] } ),
- main_b.py:459-472 (registration)The dictionary mapping tool names to their handler methods, registering 'pull_image' to self.pull_image.tool_handlers = { "list_containers": self.list_containers, "container_info": self.container_info, "start_container": self.start_container, "stop_container": self.stop_container, "restart_container": self.restart_container, "container_logs": self.container_logs, "run_container": self.run_container, "remove_container": self.remove_container, "exec_container": self.exec_container, "list_images": self.list_images, "pull_image": self.pull_image, "container_stats": self.container_stats, }
- main.py:258-261 (handler)Alternative implementation using FastMCP decorator, combining handler logic and schema for pull_image tool.@mcp.tool(title="Pull image", description="Pull a container image from a registry.") def pull_image(image: str = Field(..., description="Image name with optional tag")) -> str: result = run_podman(["pull", image]) return f"Pulled image: {image}" if result["success"] else f"Error: {result['stderr']}"