def extract_tool_call_data(response: Message) -> List[ToolCallData]:
    """
    Extracts the tool call information from the Anthropic response.

    Args:
        response (Message): The response from Anthropic containing tool usage blocks.

    Returns:
        List[ToolCallData]: A list of ToolCallData objects containing function names, arguments, and tool use IDs.
    """
    tool_calls_data = []

    if response.stop_reason == "tool_use":
        tool_calls = [
            tool_use for tool_use in response.content if isinstance(tool_use, ToolUseBlock)
        ]
        if tool_calls:
            for tool_call in tool_calls:
                if not tool_call.id:
                    raise ValueError(
                        "Tool use block is missing an ID and is unable to resolve the tool call."
                    )

                arguments = tool_call.input
                func_name = construct_original_function_name(tool_call.name)

                tool_calls_data.append(
                    ToolCallData(
                        function_name=func_name, arguments=arguments, tool_use_id=tool_call.id
                    )
                )

    return tool_calls_data

    Extracts the tool call information from the Anthropic response.

    Args:
        response (Message): The response from Anthropic containing tool usage blocks.

    Returns:
        List[ToolCallData]: A list of ToolCallData objects containing function names, arguments, and tool use IDs.
    
ai/integrations/anthropic/src/unitycatalog/ai/anthropic/utils.py