calute.operators.helpers#
Helpers for exposing Calute operator tools.
Contains the operator_tool() decorator which annotates callables
with the metadata the Calute runtime reads when registering operator
tools.
- calute.operators.helpers.operator_tool(name: str, *, description: str | None = None, category: str = 'operator') Callable[[Callable], Callable][source]#
Decorate a callable with a Calute public tool schema name.
The decorator attaches a
__calute_schema__dictionary and acategoryattribute to the wrapped function so the runtime can discover and register the tool under a canonical name.- Parameters
name – Canonical tool name exposed to the LLM (e.g.
"exec_command"or"web.open").description – Optional human-readable description included in the tool schema. When
None, the function’s own docstring is used.category – Logical tool category label. Defaults to
"operator".
- Returns
A decorator that marks the wrapped callable with schema metadata and returns it unchanged.
Example
>>> @operator_tool("my_tool", description="Does a thing") ... def my_tool(arg: str) -> str: ... return arg >>> my_tool.__calute_schema__["name"] 'my_tool'