data_juicer.tools.DJ_mcp_granular_ops module

data_juicer.tools.DJ_mcp_granular_ops.process_parameter(name: str, param: Parameter) Parameter[source]

Processes a function parameter: - Converts jsonargparse.typing.ClosedUnitInterval to a local equivalent annotation.

data_juicer.tools.DJ_mcp_granular_ops.create_operator_function(op, mcp)[source]

Creates a callable function for a Data-Juicer operator class.

This function dynamically creates a function that can be registered as an MCP tool, with proper signature and documentation based on the operator’s __init__ method.

data_juicer.tools.DJ_mcp_granular_ops.create_mcp_server(port: str = '8000')[source]

Creates the FastMCP server and registers the tools.

Parameters:

port (str, optional) – Port number. Defaults to “8000”.