docker_compose_ps
Check the status of Docker Compose services to monitor running containers and their health in a specified directory.
Instructions
Show status of Docker Compose services
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory | No | Directory containing docker-compose.yml |
Implementation Reference
- src/tools/docker/compose.ts:6-18 (handler)The actual implementation of the tool 'docker_compose_ps' which executes the 'docker compose ps' command.
export async function composePs(args: Record<string, unknown>): Promise<string> { const directory = (args.directory as string) || "."; try { const { stdout } = await execFileAsync("docker", ["compose", "ps", "--format", "table"], { cwd: directory, timeout: 30000, }); return stdout.trim() || "No compose services found."; } catch (error) { const msg = error instanceof Error ? error.message : String(error); throw new Error(`Failed to run docker compose ps: ${msg}`); } } - src/tools/docker/index.ts:75-83 (registration)The schema registration for 'docker_compose_ps'.
name: "docker_compose_ps", description: "Show status of Docker Compose services", inputSchema: { type: "object" as const, properties: { directory: { type: "string", description: "Directory containing docker-compose.yml" }, }, }, }, - src/tools/docker/index.ts:127-127 (handler)The dispatch logic for 'docker_compose_ps' in the handler function.
case "docker_compose_ps": return composePs(a);