:class:`HostContract` ===================== .. py:class:: ansys.fluent.mcp.common.host.HostContract(hint_lookup: Callable[[str], dict[str, bool] | None] = annotations_for, *, coordinator: operations.CallCoordinator | None = None) Wrap tool functions with trace ids, timeout-safe execution and error guidance. :Parameters: **hint_lookup** : :obj:`Callable`\[[:class:`python:str`], :class:`python:dict`\[:class:`python:str`, :ref:`bool `] | :data:`python:None`], default: :obj:`annotations_for` Returns a tool's behavior hints. **coordinator** : :obj:`CallCoordinator`, :obj:`optional` Joins and replays mutating calls; one per server. .. !! processed by numpydoc !! .. py:currentmodule:: HostContract Overview -------- .. tab-set:: .. tab-item:: Methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~wrap` - Return ``fn`` wrapped with the host contract. Import detail ------------- .. code-block:: python from ansys.fluent.mcp.common.host import HostContract Method detail ------------- .. py:method:: wrap(tool: str, fn: Callable[..., Any]) -> Callable[..., Any] Return ``fn`` wrapped with the host contract. The wrapper keeps ``fn``'s signature (``functools.wraps``), so the MCP framework derives the same input schema. :Parameters: **tool** : :class:`python:str` Registered tool name. **fn** : :obj:`Callable`\[..., :obj:`Any`] Tool function, sync or async. :Returns: :obj:`Callable`\[..., :obj:`Any`] The wrapped tool function. .. !! processed by numpydoc !!