HostContract#

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_lookupCallable[[str], dict[str, bool] | None], default: annotations_for

Returns a tool’s behavior hints.

coordinatorCallCoordinator, optional

Joins and replays mutating calls; one per server.

Overview#

wrap

Return fn wrapped with the host contract.

Import detail#

from ansys.fluent.mcp.common.host import HostContract

Method detail#

HostContract.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:
toolstr

Registered tool name.

fnCallable[…, Any]

Tool function, sync or async.

Returns:
Callable[…, Any]

The wrapped tool function.