list_images
Retrieve a detailed list of all available Docker images on your system, enabling efficient container management and resource tracking through the MCP protocol.
Instructions
List all Docker images
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:238-255 (handler)The handler function that lists Docker images by executing 'docker images' command, parsing the output, and returning 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)Tool registration in the ListTools response, including name, description, and empty input schema.{ name: 'list_images', description: 'List all Docker images', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:191-192 (registration)Dispatch case in the CallToolRequest handler that routes to the listImages method.case 'list_images': return await this.listImages();
- src/index.ts:85-88 (schema)Input schema definition for the list_images tool (empty object, no parameters required).inputSchema: { type: 'object', properties: {}, },