Skip to main content
Glama

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
NameRequiredDescriptionDefault
containerYesContainer ID or name

Implementation Reference

  • 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}` }], }; }
  • 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'], },
  • 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'], }, },
  • 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}`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Toowiredd/chatgpt-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server