Skip to main content
Glama
JackXuyi

Current operating environment

getDockerInfo

Retrieve Docker configuration and status details from the current operating environment to assess container availability and system setup.

Instructions

获取当前设备的 Docker 信息,若未安装则返回空

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for getDockerInfo tool: executes Docker CLI commands to retrieve version, images, and all containers; returns JSON or empty object if Docker not installed or error.
    case "getDockerInfo": {
      let dockerInfo = {};
      try {
        // 检查 Docker 是否安装
        execSync('docker --version');
        // 获取 Docker 信息
        const dockerVersion = execSync('docker version --format \'{{json .}}\'').toString();
        const dockerImages = execSync('docker images --format \'{{json .}}\'').toString().split('\n').filter(Boolean).map(line => JSON.parse(line));
        const dockerContainers = execSync('docker ps -a --format \'{{json .}}\'').toString().split('\n').filter(Boolean).map(line => JSON.parse(line));
        
        dockerInfo = {
          version: JSON.parse(dockerVersion),
          images: dockerImages,
          containers: dockerContainers
        };
      } catch (error) {
        // Docker 未安装或者出错,返回空对象
        dockerInfo = {};
      }
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify(dockerInfo, null, 2)
        }]
      };
    }
  • src/index.ts:262-270 (registration)
    Registration of getDockerInfo tool in the list of tools returned by handleRequest, including description and inputSchema (no parameters).
    {
      name: "getDockerInfo",
      description: "获取当前设备的 Docker 信息,若未安装则返回空",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • Input schema for getDockerInfo: empty object (no input parameters required).
    inputSchema: {
      type: "object",
      properties: {},
      required: []
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses one key behavioral trait: returning empty when Docker isn't installed. However, it doesn't describe what 'Docker information' includes (e.g., version, containers, images), whether it requires permissions, or the return format. For a zero-parameter tool, this is minimally adequate but lacks depth.

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 - a single sentence that efficiently conveys the core functionality and one important behavioral detail. Every word earns its place, with no redundant information. It's front-loaded with the main purpose followed by the conditional behavior.

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 the tool's simplicity (zero parameters, no annotations, no output schema), the description is reasonably complete for basic understanding. It explains what the tool does and one behavioral condition. However, for a system information tool, it could benefit from specifying what 'Docker information' includes or the return format, especially without an output schema.

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

Parameters4/5

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

The tool has zero parameters, so there's no need to explain parameter semantics. The description appropriately focuses on the tool's behavior rather than inputs. With 100% schema coverage (empty schema), a baseline of 4 is justified as the description doesn't need to compensate for missing parameter documentation.

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 tool's purpose: '获取当前设备的 Docker 信息' (get Docker information for the current device). It specifies the resource (Docker information) and includes a conditional behavior ('若未安装则返回空' - returns empty if not installed). While it distinguishes from siblings by focusing on Docker, it doesn't explicitly contrast with other system info tools.

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. It doesn't mention any prerequisites, use cases, or comparisons with sibling tools like getHardwareInfo or getPlatformInfo. The conditional behavior about returning empty when Docker isn't installed is useful but doesn't constitute usage guidance.

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/JackXuyi/env-mcp'

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