pull_image
Pull a Docker image from a registry to manage containers efficiently. Specify the image name to integrate with the Docker MCP Server for streamlined resource handling.
Instructions
Pull a Docker image from a registry
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Image name (e.g. "nginx:latest") |
Input Schema (JSON Schema)
{
"properties": {
"image": {
"description": "Image name (e.g. \"nginx:latest\")",
"type": "string"
}
},
"required": [
"image"
],
"type": "object"
}
Implementation Reference
- src/index.ts:353-371 (handler)The handler function that pulls the specified Docker image using `docker pull` and returns the output.private async pullImage(args: ImageArgs) { if (!args.image) { throw new McpError( ErrorCode.InvalidParams, 'Image parameter is required' ); } const { stdout } = await execAsync(`docker pull ${args.image}`); return { content: [ { type: 'text', text: stdout.trim(), }, ], }; }
- src/index.ts:169-182 (registration)Registration of the 'pull_image' tool in the list of tools, including name, description, and input schema.{ name: 'pull_image', description: 'Pull a Docker image from a registry', inputSchema: { type: 'object', properties: { image: { type: 'string', description: 'Image name (e.g. "nginx:latest")', }, }, required: ['image'], }, },
- src/index.ts:36-38 (schema)TypeScript interface defining the input arguments for the pull_image tool.interface ImageArgs { image: string; }
- src/index.ts:199-200 (handler)Dispatch in the CallToolRequestSchema handler that routes to the pullImage method.case 'pull_image': return await this.pullImage(request.params.arguments as unknown as ImageArgs);