def uc_function_to_langchain_tool(
        *,
        function_name: str,
        client: Optional[BaseFunctionClient] = None,
        filter_accessible_functions: bool = False,
    ) -> Optional[UnityCatalogTool]:
        """
        Convert a UC function to Langchain StructuredTool

        Args:
            function_name: The full name of the function in the form of 'catalog.schema.function'
            client: The client for managing functions, must be an instance of BaseFunctionClient
        """
        client = validate_or_set_default_client(client)

        if function_name is None:
            raise ValueError("function_name must be provided.")
        try:
            function_info = client.get_function(function_name)
        except PermissionError as e:
            _logger.info(f"Skipping {function_name} due to permission errors.")
            if filter_accessible_functions:
                return None
            raise e

        def func(*args: Any, **kwargs: Any) -> str:
            args_json = json.loads(json.dumps(kwargs, default=str))
            result = client.execute_function(
                function_name=function_name,
                parameters=args_json,
                enable_retriever_tracing=mlflow_tracing_enabled("langchain"),
            )
            return result.to_json()

        return UnityCatalogTool(
            name=get_tool_name(function_name),
            description=function_info.comment or "",
            func=func,
            args_schema=generate_function_input_params_schema(function_info).pydantic_model,
            uc_function_name=function_name,
            client_config=client.to_dict(),
        )

        Convert a UC function to Langchain StructuredTool

        Args:
            function_name: The full name of the function in the form of 'catalog.schema.function'
            client: The client for managing functions, must be an instance of BaseFunctionClient
        
ai/integrations/langchain/src/unitycatalog/ai/langchain/toolkit.py