Something went wrong. Try again.
mirror of github.com/PrefectHQ/fastmcp
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445---title: timeoutsidebarTitle: timeout---
# `fastmcp.utilities.timeout`
Timeout normalization utilities.
## Functions
### `normalize_timeout_to_timedelta` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/timeout.py#L8" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
```pythonnormalize_timeout_to_timedelta(value: int | float | datetime.timedelta | None) -> datetime.timedelta | None```
Normalize a timeout value to a timedelta.
**Args:**- `value`: Timeout value as int/float (seconds), timedelta, or None
**Returns:**- timedelta if value provided, None otherwise
### `normalize_timeout_to_seconds` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/timeout.py#L28" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
```pythonnormalize_timeout_to_seconds(value: int | float | datetime.timedelta | None) -> float | None```
Normalize a timeout value to seconds (float).
**Args:**- `value`: Timeout value as int/float (seconds), timedelta, or None.Zero values are treated as "disabled" and return None.
**Returns:**- float seconds if value provided and non-zero, None otherwise