docker_system
Perform Docker system operations such as viewing info, version, events, disk usage, and pruning unused resources with optional flags.
Instructions
Docker system operations and information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | System action to perform | |
| all | No | Apply to all resources (for prune) | |
| volumes | No | Include volumes in operation | |
| force | No | Force operation without confirmation |
Implementation Reference
- src/services/DockerService.ts:1035-1081 (handler)The systemOperations method that handles the 'docker_system' tool logic. It builds and executes docker system commands (info, version, events, df, prune) based on the action argument.
async systemOperations(args: DockerSystemArgs): Promise<ToolResult> { const { action, all, volumes, filter, force, since, until, format } = args; ValidationUtils.validateRequired({ action }, ['action']); let command = 'docker system'; switch (action) { case 'info': command = 'docker system info'; if (format) command += ` --format ${format}`; break; case 'version': command = 'docker version'; if (format) command += ` --format ${format}`; break; case 'events': command = 'docker system events'; if (since) command += ` --since ${since}`; if (until) command += ` --until ${until}`; if (filter) command += ` --filter ${filter}`; break; case 'df': command = 'docker system df'; break; case 'prune': command = 'docker system prune'; if (all) command += ' -a'; if (volumes) command += ' --volumes'; if (force) command += ' -f'; if (filter) command += ` --filter ${filter}`; break; default: throw new Error(`Unsupported system action: ${action}`); } try { return await this.executeDockerCommand(command, { cwd: this.getCurrentWorkspace() }); } catch (error: any) { throw new Error(`Docker system ${action} failed: ${error.message}`); } } - The DockerSystemArgs interface defining the input schema for the docker_system tool, with action as a union type of 'info' | 'version' | 'events' | 'df' | 'prune' and optional parameters.
export interface DockerSystemArgs { action: 'info' | 'version' | 'events' | 'df' | 'prune'; all?: boolean; volumes?: boolean; filter?: string; force?: boolean; since?: string; until?: string; format?: string; } - src/index.ts:219-220 (registration)The router case statement that dispatches the 'docker_system' tool to systemOperations on the DockerService.
case 'docker_system': return await this.dockerService.systemOperations(args as DockerSystemArgs); - src/toolDefinitions.ts:570-587 (registration)The tool definition/registration for 'docker_system', declaring the name, description, and inputSchema with properties like action, all, volumes, force.
{ name: 'docker_system', description: 'Docker system operations and information', inputSchema: { type: 'object', properties: { action: { type: 'string', enum: ['info', 'version', 'events', 'df', 'prune'], description: 'System action to perform' }, all: { type: 'boolean', description: 'Apply to all resources (for prune)' }, volumes: { type: 'boolean', description: 'Include volumes in operation' }, force: { type: 'boolean', description: 'Force operation without confirmation' }, }, required: ['action'], }, },