Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

docker_inspect

Retrieve detailed configuration and state information for Docker containers, images, networks, and volumes to debug and analyze containerized applications.

Instructions

Return low-level information on Docker objects (containers, images, networks, volumes)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesContainer, image, network, or volume name/ID
typeNoType of object to inspect
cwdNoWorking directory

Implementation Reference

  • Main handler function for 'docker_inspect' tool. Executes 'docker inspect' command with optional type flag using the shared executeDockerCommand helper.
    export async function dockerInspect(args: z.infer<typeof dockerInspectSchema>): Promise<ToolResponse> {
      const typeFlag = args.type ? `--type ${args.type}` : '';
      return executeDockerCommand(`docker inspect ${typeFlag} ${args.target}`.trim(), args.cwd);
    }
  • Zod schema used for input validation in the dispatch handler.
    export const dockerInspectSchema = z.object({
      target: z.string().describe('Container, image, network, or volume name/ID'),
      type: z.enum(['container', 'image', 'network', 'volume']).optional().describe('Type of object to inspect'),
      cwd: z.string().optional().describe('Working directory')
    });
  • src/index.ts:467-470 (registration)
    Dispatch logic in main server handler that routes 'docker_inspect' calls to the dockerInspect function after schema validation.
    if (name === 'docker_inspect') {
      const validated = dockerInspectSchema.parse(args);
      return await dockerInspect(validated);
    }
  • MCP tool registration definition included in dockerTools array for listTools endpoint.
    {
      name: 'docker_inspect',
      description: 'Return low-level information on Docker objects (containers, images, networks, volumes)',
      inputSchema: {
        type: 'object',
        properties: {
          target: { type: 'string', description: 'Container, image, network, or volume name/ID' },
          type: { type: 'string', enum: ['container', 'image', 'network', 'volume'], description: 'Type of object to inspect' },
          cwd: { type: 'string', description: 'Working directory' }
        },
        required: ['target']
      }
    },
  • Shared helper function that executes docker commands via child_process.exec and formats ToolResponse.
    async function executeDockerCommand(command: string, cwd?: string): Promise<ToolResponse> {
      try {
        const { stdout, stderr } = await execAsync(command, {
          cwd: cwd || process.cwd(),
          shell: '/bin/bash',
          maxBuffer: 10 * 1024 * 1024, // 10MB buffer for logs
          timeout: 60000 // 60 second timeout for builds
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: true,
                command: command,
                stdout: stdout.trim(),
                stderr: stderr.trim(),
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                command: command,
                stdout: error.stdout?.trim() || '',
                stderr: error.stderr?.trim() || error.message,
                exitCode: error.code || 1,
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ],
          isError: true
        };
      }
    }
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. It states 'Return low-level information,' which suggests a read-only operation, but doesn't disclose behavioral traits like whether it requires specific permissions, what format the information is returned in (e.g., JSON), or any rate limits. For a tool with no annotations, this leaves significant gaps in understanding how it behaves beyond basic purpose.

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 a single, efficient sentence that front-loads the core purpose ('Return low-level information on Docker objects') and specifies the object types without unnecessary words. Every part earns its place, making it appropriately sized and easy to parse quickly.

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

Completeness3/5

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

Given no annotations, no output schema, and 3 parameters with full schema coverage, the description is adequate for a read-only inspection tool but incomplete. It states what the tool does but lacks details on return format, error handling, or prerequisites, which could be important for an agent to use it correctly. It's minimally viable but has clear gaps in context.

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?

The description doesn't add any parameter-specific information beyond what's in the input schema, which has 100% coverage with clear descriptions for all parameters (target, type, cwd). Since schema coverage is high, the baseline is 3, and the description doesn't compensate with extra details like examples or constraints, so it meets but doesn't exceed the minimum.

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 clearly states the verb ('Return') and resource ('low-level information on Docker objects'), specifying the object types (containers, images, networks, volumes). It distinguishes from siblings like docker_ps (list containers) or docker_images (list images) by focusing on detailed inspection rather than listing. However, it doesn't explicitly contrast with all siblings, so it's not a perfect 5.

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

Usage Guidelines3/5

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

The description implies usage for getting detailed information on specific Docker objects, but doesn't explicitly state when to use this vs. alternatives like docker_ps (for listing) or docker_logs (for logs). It provides some context by listing object types, but lacks clear exclusions or named alternatives, leaving usage somewhat inferred.

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/ConnorBoetig-dev/mcp2'

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