Skip to main content
Glama

container_run

Run a Docker container from a specified image with configurable settings for ports, volumes, environment, and more.

Instructions

Run a container from an image.

args: image - The image to run command - The command to run in the container name - Name to assign to the container detach - Run in the background and return container info environment - Environment variables to set ports - Port mappings, e.g. {'2222/tcp': 3333} volumes - Volumes to mount network - Name of the network to attach hostname - Optional hostname for the container user - Username or UID to run as working_dir - Working directory inside the container entrypoint - Entrypoint to override the image default restart_policy - Restart policy, e.g. {'Name': 'on-failure', 'MaximumRetryCount': 3} labels - Labels to set on the container remove - Remove the container when it exits (only with detach=False) auto_remove - Enable auto-removal of the container on daemon side privileged - Give extended privileges to the container tty - Allocate a pseudo-TTY stdin_open - Keep STDIN open mem_limit - Memory limit cpu_count - Number of CPUs extra_kwargs - Additional keyword arguments forwarded to ContainerCollection.run (call docs_lookup(section="containers") for the full accepted set) returns: dict | str - Container attrs when detach=True, otherwise stdout/stderr as a string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ttyNo
nameNo
userNo
imageYes
portsNo
detachNo
labelsNo
removeNo
commandNo
networkNo
volumesNo
hostnameNo
cpu_countNo
mem_limitNo
entrypointNo
privilegedNo
stdin_openNo
auto_removeNo
environmentNo
working_dirNo
extra_kwargsNo
restart_policyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations indicate the tool is not read-only and not destructive, which aligns with running a container. The description adds behavioral details: default detach=True, return type depends on detach, and extra_kwargs should be documented elsewhere. No contradictions with annotations, and the description provides meaningful context beyond the structured fields.

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?

The description is a well-structured docstring with a clear first sentence stating purpose, followed by a parameter list. Every sentence adds value, though the length is justified given the 22 parameters. It is front-loaded and efficiently organized.

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?

Given the tool's complexity (22 parameters, 1 required, many optional), the description covers all parameters with explanations, notes on return types, and a reference for extra parameters. The output schema is not provided but the description explains return formats. It lacks usage examples or details on container lifecycle, but overall is fairly complete for a run tool.

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 input schema has 0% description coverage, so the description carries the full burden. It lists each parameter with a brief explanation (e.g., 'ports - Port mappings, e.g. {"2222/tcp": 3333}') and mentions the extra_kwargs parameter with a reference to docs_lookup. This adds significant meaning beyond the schema's type definitions, though some explanations could be more precise.

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 description starts with 'Run a container from an image', clearly stating the verb (run) and resource (container from image). This distinguishes it from sibling tools like container_create (create without running) and container_start (start existing container).

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 does not explicitly state when to use container_run versus alternatives such as container_create, container_start, or container_exec. While the purpose is clear, there is no comparison or exclusion, leaving the agent to infer usage from the name alone.

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/L337-org/docker-mcp'

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