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: [] }

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