Skip to main content
Glama

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

NameRequiredDescriptionDefault
imageYesImage 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

  • 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'], }, },
  • TypeScript interface defining the input arguments for the pull_image tool.
    interface ImageArgs { image: string; }
  • 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);

Other Tools

Related Tools

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/suvarchal/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server