Skip to main content
Glama

list_images

View all Docker images available on your system to manage containers and resources through the Docker MCP Server.

Instructions

List all Docker images

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the 'docker images' command, parses the output into a list of image objects (name, id, size), and returns it as JSON-formatted text content.
    private async listImages() { const { stdout } = await execAsync('docker images --format "{{.Repository}}:{{.Tag}}\\t{{.ID}}\\t{{.Size}}"'); const images = stdout.trim().split('\n') .filter(line => line.trim() !== '') .map(line => { const [name, id, size] = line.split('\t'); return { name, id, size }; }); return { content: [ { type: 'text', text: JSON.stringify(images, null, 2), }, ], }; }
  • src/index.ts:82-89 (registration)
    Registration of the 'list_images' tool in the ListToolsRequestSchema handler, specifying name, description, and empty input schema (no parameters required).
    { name: 'list_images', description: 'List all Docker images', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema definition for the list_images tool: an empty object, indicating no input parameters are required.
    inputSchema: { type: 'object', properties: {}, },
  • Switch case in the CallToolRequestSchema handler that dispatches to the listImages method when 'list_images' tool is called.
    case 'list_images': return await this.listImages();

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