(a: z.infer<typeof PsArgs>)
| 29 | description = 'List Docker containers with id, image, status, ports and name (condensed table). Read-only.'; |
| 30 | isReadOnly = true; isDestructive = false; argsSchema = PsArgs; |
| 31 | async execute(a: z.infer<typeof PsArgs>): Promise<ToolResult> { |
| 32 | const fmt = 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}'; |
| 33 | const args = ['ps', '--format', fmt]; |
| 34 | if (a.all) args.push('-a'); |
| 35 | return docker(args, 20_000); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // ---- docker_logs ---- |