Skip to main content
Glama

start_container

Start a stopped Docker container by providing its ID or name to resume application execution.

Instructions

Start a stopped Docker container.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesContainer ID or name

Implementation Reference

  • The handler function that implements the start_container tool logic. It gets a Docker container by ID and starts it using the Dockerode API.
    export async function startContainer(id: string): Promise<string> {
      const container = docker.getContainer(id);
      await container.start();
      return `Container ${id} started`;
    }
  • src/index.ts:70-78 (registration)
    Registration of the start_container tool with the MCP server. Defines the tool name, description, input schema, and handler function.
    server.tool(
      "start_container",
      "Start a stopped Docker container.",
      { id: z.string().describe("Container ID or name") },
      async ({ id }) => {
        const result = await startContainer(id);
        return { content: [{ type: "text", text: result }] };
      },
    );
  • Input schema definition for start_container tool using Zod. Validates that the 'id' parameter is a string representing the container ID or name.
    { id: z.string().describe("Container ID or name") },

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/ofershap/mcp-server-docker'

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