fastmcp.tools.function_tool
Standalone @tool decorator for FastMCP.
Functions
tool
Classes
DecoratedTool
Protocol for functions decorated with @tool.
ToolMeta
Metadata attached to functions by the @tool decorator.
FunctionTool
Methods:
to_mcp_tool
from_function
fn: The function to wrapmetadata: ToolMeta object with all configuration. If provided, individual parameters must not be passed.name, title, etc.: Individual parameters for backwards compatibility. Cannot be used together with metadata parameter.
run
register_with_docket
add_to_docket
docket: The Docket instancearguments: Tool argumentsfn_key: Function lookup key in Docket registry (defaults to self.key)task_key: Redis storage key for the result**kwargs: Additional kwargs passed to docket.add()

