Passing the output of one function call as input to another function


Imagine I have two functions: get_city_weather and get_capital_by_country. When a user asks, “What’s the weather like in the UK?” the system sequentially executes two functions: get_capital_by_country followed by get_city_weather. This works well (but not always). However, I’m wondering if there’s a formal method to describe the output parameters of a function, similar to how we define input parameters. This would enhance the reliability of the function call chain.

Thank you!