Skip to main content
Glama
Toowiredd

ChatGPT MCP Server

container_start

Start a stopped Docker container by providing its ID or name. This tool enables container management through natural language interactions.

Instructions

Start a stopped container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containerYesContainer ID or name

Implementation Reference

  • Registration of the 'container_start' tool including its name, description, and input schema definition.
    {
      name: 'container_start',
      description: 'Start a stopped container',
      inputSchema: {
        type: 'object',
        properties: {
          container: {
            type: 'string',
            description: 'Container ID or name',
          },
        },
        required: ['container'],
      },
    },
  • Handler logic for the 'container_start' tool: parses arguments, calls DockerService.startContainer, and formats the response.
    case 'container_start': {
      const { container } = request.params.arguments as { container: string };
      const output = await this.dockerService.startContainer(container);
      return {
        content: [{ type: 'text', text: `Container started: ${output}` }],
      };
    }
  • Core implementation of container start: executes the Docker CLI command 'docker start <container-id>'.
    async startContainer(id: string): Promise<string> {
      return this.executeCommand(`start ${id}`);
    }
  • Utility method to execute Docker CLI commands asynchronously, used by all Docker operations including startContainer.
    async executeCommand(command: string): Promise<string> {
      try {
        const { stdout } = await execAsync(`docker ${command}`);
        return stdout;
      } catch (error: any) {
        throw new McpError(
          ErrorCode.InternalError,
          `Docker command failed: ${error.message}`
        );
      }
    }

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