container_stop
Stop a running Docker container by specifying its ID or name to manage container lifecycle and resource usage.
Instructions
Stop a running container
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container | Yes | Container ID or name |
Implementation Reference
- src/servers/mcp.server.ts:249-255 (handler)MCP server handler for the 'container_stop' tool. Extracts the 'container' argument from the request and delegates to DockerService.stopContainer, returning the result as text content.case 'container_stop': { const { container } = request.params.arguments as { container: string }; const output = await this.dockerService.stopContainer(container); return { content: [{ type: 'text', text: `Container stopped: ${output}` }], }; }
- src/servers/mcp.server.ts:134-143 (schema)Input schema definition for the 'container_stop' tool, specifying a required 'container' string parameter.inputSchema: { type: 'object', properties: { container: { type: 'string', description: 'Container ID or name', }, }, required: ['container'], },
- src/servers/mcp.server.ts:131-144 (registration)Registration of the 'container_stop' tool in the server's listTools response, including name, description, and input schema.{ name: 'container_stop', description: 'Stop a running container', inputSchema: { type: 'object', properties: { container: { type: 'string', description: 'Container ID or name', }, }, required: ['container'], }, },
- src/services/docker.service.ts:45-47 (helper)Core implementation of stopping a Docker container by executing the 'docker stop' CLI command.async stopContainer(id: string): Promise<string> { return this.executeCommand(`stop ${id}`); }