wait_for_container_healthy
Poll a container until its healthcheck reports healthy, with configurable timeout and poll interval. Returns health status and timeout flag.
Instructions
Poll a container until its healthcheck reports healthy (or it stops, or the timeout elapses).
Complements wait_container (which waits for exit): this waits for a running container to become
healthy. Re-inspects every poll_intervals, never blocks past timeout (no exception on timeout —
the result carries timed_out: true).
Health comes from the container's HEALTHCHECK. With none defined, once the container is running
the tool returns promptly with health: null and healthy: false (false = "not confirmed healthy",
not "unhealthy" — check health to tell them apart). A container that exits before becoming healthy
returns its terminal status and healthy: false.
args:
id_or_name - The container id or name
timeout - Max seconds to wait before returning timed_out (default 120)
poll_interval - Seconds between re-inspections (default 2, > 0); also capped by the time left,
so a large value can't push the total wait past timeout
returns: dict - {"container", "healthy", "health", "status", "waited_seconds", "timed_out"};
health is "starting"/"healthy"/"unhealthy" or null when no healthcheck is defined.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| id_or_name | Yes | ||
| poll_interval | No |