containers_list
View all Docker containers to monitor running instances and manage container status. Use this tool to check active and stopped containers for system oversight.
Instructions
List all Docker containers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Show all containers (including stopped ones) |
Implementation Reference
- src/servers/mcp.server.ts:90-102 (registration)Registers the 'containers_list' tool including its input schema and description.{ name: 'containers_list', description: 'List all Docker containers', inputSchema: { type: 'object', properties: { all: { type: 'boolean', description: 'Show all containers (including stopped ones)', }, }, }, },
- src/servers/mcp.server.ts:222-228 (handler)MCP server handler for the 'containers_list' tool; extracts 'all' parameter and delegates to DockerService.listContainers, formats response.case 'containers_list': { const { all } = request.params.arguments as { all?: boolean }; const output = await this.dockerService.listContainers(all); return { content: [{ type: 'text', text: output }], }; }
- src/services/docker.service.ts:20-24 (helper)Core implementation of listing Docker containers using 'docker ps' command with optional --all flag.async listContainers(showAll = false): Promise<string> { return this.executeCommand( `ps ${showAll ? '-a' : ''} --format "{{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"` ); }