Skip to main content
Glama

compose_restart

Restart Compose services without recreating containers or reapplying config changes. Use to bounce a service after a runtime file change or to clear in-memory state.

Instructions

Stop then start services without recreating containers or applying config changes.

Use this to bounce a service (e.g. to pick up a runtime file change or clear an in-memory state). If the compose file has changed (new image, environment, volumes, ports) use compose_up instead - it recreates affected containers to apply the diff. stop_timeout_seconds controls the SIGTERM grace period before Docker sends SIGKILL. Does not raise on a non-zero CLI exit (a missing compose plugin or a timeout still raises) - inspect returncode/stderr in the result.

Args: project_dir: Dir with the compose file (default: server cwd; copied to the target host if no local plugin) files: Explicit compose file paths (repeatable, -f) project_name: Override the compose project name services: Restart only these services; omit to restart all stop_timeout_seconds: Seconds to wait for graceful stop before SIGKILL timeout_seconds: Subprocess timeout (default 300s)

Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
servicesNo
project_dirNo
project_nameNo
timeout_secondsNo
stop_timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.9.0

TDQS

A5/5.0
Behavior5/5

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

Beyond annotations (which are minimal: destructiveHint false, readOnlyHint false), the description discloses crucial behavior: it does not recreate containers, it passes through non-zero CLI exits without raising (unless missing plugin/timeout), and it copies project_dir to the target host if no local plugin. These are essential for correct invocation and result interpretation.

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 front-loaded with the core purpose, then provides usage guidance, behavioral notes, and a structured Args/Returns section. Each sentence earns its place; no filler or redundancy. The layout makes it easy to scan and parse.

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

Completeness5/5

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

For a tool with 6 parameters and no output schema, the description covers all necessary operational context: when to use, how to interpret results, exit-code behavior, and parameter defaults. An agent has everything needed to invoke it correctly, including the return dict structure.

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

Parameters5/5

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

Schema description coverage is 0%, so the description fully compensates by explaining all six parameters with clear semantics: project_dir default and copy behavior, files repeatable -f, project_name override, services subset, stop_timeout_seconds grace period, and timeout_seconds subprocess timeout. Every parameter is meaningfully described.

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 states a precise verb and resource: 'Stop then start services without recreating containers or applying config changes.' This clearly distinguishes it from compose_up and other compose commands, and the phrase 'bounce a service' adds concrete intent.

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?

Explicitly instructs when to use this tool ('to pick up a runtime file change or clear an in-memory state') and when not to, directing to `compose_up` if the compose file has changed. Also explains the stop_timeout_seconds behavior and the non-zero exit handling.

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