Skip to main content
Glama

pull_image

Pull Docker images from registries to your local machine for container deployment and management.

Instructions

Pull a Docker image from a registry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYesImage name (e.g. "nginx:latest")

Implementation Reference

  • The handler function that implements the logic for pulling a Docker image using the 'docker pull' command. It validates the image argument and returns the command 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)
    The registration of the 'pull_image' tool in the list of tools provided to the MCP client, including its 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;
    }

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