# `ExMCP.Reliability`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/reliability/supervisor.ex#L597)

Convenience functions for reliability features.

This module provides easy access to reliability patterns
without manual setup.

## Examples

    # Wrap a function with retry logic
    ExMCP.Reliability.with_retry(fn ->
      ExMCP.Client.call_tool(client, "risky_tool", %{})
    end)

    # Create a circuit-breaker protected function
    protected_call = ExMCP.Reliability.protect(fn ->
      external_service_call()
    end, failure_threshold: 5)

    # Use the protected function
    protected_call.()

# `protect`

```elixir
@spec protect(
  function(),
  keyword()
) :: function()
```

Creates a circuit breaker and retry-protected version of a function.

The function will be protected by a circuit breaker and retried
according to the specified options on failure.

## Options

- `:name` - Name for the circuit breaker process
- `:failure_threshold` - Number of failures before circuit opens (default: 5)
- `:success_threshold` - Number of successes to close circuit (default: 2)
- `:timeout` - Timeout for each call (default: 5000)
- `:reset_timeout` - Time before attempting to close open circuit (default: 30000)
- Plus all retry options from `ExMCP.Reliability.Retry.mcp_defaults/1`

# `with_retry`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
