Skip to main content
Glama
Toowiredd

ChatGPT MCP Server

container_remove

Remove Docker containers by ID or name to free up system resources and manage container lifecycle. Use the force option to stop running containers before removal.

Instructions

Remove a container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containerYesContainer ID or name
forceNoForce remove running container

Implementation Reference

  • Core implementation executing the `docker rm` command with optional force flag.
    async removeContainer(id: string, force = false): Promise<string> {
      return this.executeCommand(`rm ${force ? '-f' : ''} ${id}`);
    }
  • MCP server request handler for 'container_remove' tool, dispatching to DockerService.
    case 'container_remove': {
      const { container, force } = request.params.arguments as {
        container: string;
        force?: boolean;
      };
      const output = await this.dockerService.removeContainer(container, force);
      return {
        content: [{ type: 'text', text: `Container removed: ${output}` }],
      };
    }
  • Tool registration in ListTools response, including input schema definition.
    {
      name: 'container_remove',
      description: 'Remove a container',
      inputSchema: {
        type: 'object',
        properties: {
          container: {
            type: 'string',
            description: 'Container ID or name',
          },
          force: {
            type: 'boolean',
            description: 'Force remove running container',
          },
        },
        required: ['container'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Remove a container' implies a destructive operation, but it doesn't specify whether this is permanent deletion, what happens to container data, whether it requires specific permissions, or what happens if the container is running. The 'force' parameter in the schema suggests there are runtime constraints, but the description doesn't explain them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, front-loading the core action and resource with zero wasted words. Every word earns its place in conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with no annotations and no output schema, the description is inadequate. It doesn't explain what 'remove' means operationally, what happens to container resources, whether the action is reversible, or what the response looks like. Given the complexity of container removal and lack of structured safety information, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (container ID/name and force flag). The description adds no additional meaning about parameters beyond what's in the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Remove a container' clearly states the action (remove) and target resource (container), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like container_stop or container_exec, which also operate on containers but with different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like container_stop (which might pause a container) and container_exec (which runs commands in a container), there's no indication of when removal is appropriate versus other container operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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