Skip to main content
Glama

Docker Container Create

docker_container_create

Create and configure a Docker container on an fnOS NAS with port/mount mappings, environment variables, memory/CPU limits, and an optional restart or immediate start.

Instructions

创建 Docker 容器(写操作)。

支持端口/挂载映射、环境变量、内存/CPU 限制与启动策略。 创建后可用 docker_containers(--all) 与 docker_container_action 管理。

⚠️ cmd 的限制:trim-cli 的 --cmd 会按空格重新切分,所以 cmd=["sh","-c","sleep 300"] 实际落成 ["sh","-c","sleep","300"], ["sh","-c","while true; do ...; done"] 这类命令会直接跑挂。需要带空格 的参数时改用 docker_request(endpoint="containerCreate", body={...}) 传原始 Cmd 数组。

Input Schema

NameRequiredDescriptionDefault
cmdNo容器命令参数;每个元素不能含空格(trim-cli 按空格切分)
envNo环境变量,如 TZ=Asia/Shanghai
hostNoNAS 主机地址(IP 或域名)
nameNo容器名
portNoNAS 端口,如 5667(HTTPS)/5666(HTTP)/443
imageYes镜像引用,如 nginx:latest
startNo创建后立即启动
schemeNo传输协议
profileNo独立 session profile 名称,默认使用 default
restartNo设置 restart 策略
memory_mbNo内存上限(MB)
cpu_sharesNoCPU 权重(shares)
port_mappingsNo端口映射,如 8080:80
mount_mappingsNo挂载映射,如 /vol1/1000/app:/data

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the write nature ('写操作') and, more valuably, a non-obvious behavioral trap: trim-cli re-splits --cmd on whitespace, so multi-word commands silently corrupt or hang. It does not mention auth/permission needs or failure behavior, but the cmd caveat is exactly the kind of gotcha annotations can't convey.

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

Conciseness4/5

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

Purpose is front-loaded, then capabilities, then management routing, then the cmd warning. The warning section is longer than the rest but each worked example prevents a real failure mode, so it earns its space; only mild redundancy keeps it from a 5.

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

Completeness4/5

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

An output schema exists, so return values need not be described, and the 14 parameters are fully documented in the schema. The description covers purpose, post-creation workflow, and the critical cmd edge case; it could add auth/permission context for a write tool, but nothing needed to invoke it correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3. The description earns above baseline by explaining the semantics behind the cmd parameter (why each element cannot contain spaces) and providing a workaround, which the schema only asserts without explaining.

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

Purpose5/5

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

The first line gives a specific verb and resource ('创建 Docker 容器') and explicitly flags it as a write operation. It then names the capabilities (port/mount mapping, env vars, memory/CPU limits, restart policy) and routes to siblings, so an agent can distinguish it from docker_containers and docker_container_action without opening a schema.

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

Usage Guidelines5/5

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

It states what to do after creation (use docker_containers(--all) and docker_container_action) and gives an explicit when-to-use-an-alternative rule: when arguments contain spaces, switch to docker_request(endpoint='containerCreate') with a raw Cmd array. Concrete conditions and a named fallback, not implied usage.

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

Deploy Server

Other Tools