fastmcp.utilities.types
Common types used across FastMCP.
Functions
get_fn_name
get_function_type_hints
Annotated metadata.
Before Python 3.11, typing.get_type_hints wraps the hint of every
parameter that defaults to None in Optional[...]. For
Annotated[int | None, Field(title="Limit")] = None that produces
Optional[Annotated[...]], which buries the Field metadata in a nested
union branch of the JSON schema. Hints are resolved here without that
wrapping, so every supported Python version yields the same schema.
get_cached_typeadapter
issubclass_safe
is_class_member_of_type
find_kwarg_by_type
create_function_without_params
replace_type
type_: The type to transform.type_map: A mapping of types to replace (keys are replaced by values).

