The GPT-4 tool calls the tool again and again until it fails

Hi

I have implemented an agent which has access to 2 different tools. The one is a super simple ‘add_two_numbers’ tool the second is an API call. The API call tool works fine but when calling the ‘add_two_numbers’ tool, it uses it and returns the correct result but it is calling the tool again and again. I am adding the returned value from the tool to the conversation/memory the following way:

This is my ‘add_two_numbers’ function:

sum_tool = {
    "type": "function",
    "function": {
        'name': 'add_two_numbers', 
        'description': """This function can be used to add two numbers. 
                          Use this function whenever two number need to be added.""", 
        'parameters': {
            'properties': {
                'number_1': {
                    'description': "First number to add", 
                    'type': 'integer'
                    },
                'number_2': {
                    'description': "Second number to add", 
                    'type': 'integer'
                    }
                }, 
            'required': ['number_1',
                         'number_2'], 
            'type': 'object'
        }
    }
}

def add_two_numbers(number_1: int, number_2: int) -> str:
    """
    This function can be used to add two numbers. Use this function whenever two number need to be added.'
    """
    return str(number_1 + number_2)

Can someone help me see what I am missing or doing wrong?

Thanks in advance.