Context
Tools that depend on external services.
Problem
Agents waste time attempting to use unavailable tools.
Solution
Provide health check capability:
- Lightweight probe: Fast availability check
- Dependency status: Are backends reachable?
- Degraded mode: What still works if partial?
- Lightweight probe: Fast availability check
- Dependency status: Are backends reachable?
- Degraded mode: What still works if partial?
Examples
Python
@tool
def check_service_health(
service: str | None = None
) -> HealthStatus:
"""Check if services are available.
Args:
service: Specific service or None for all
Returns status: healthy, degraded, or unavailable.
"""
return health_checker.check(service) Considerations
- Make health checks fast (sub-second)
- Return specific failure reasons
- Consider caching health status briefly