When a user asks the LLM to perform an action, e.g., get the current weather or current stock market details, the LLM cannot get this information on its own. It needs some functionality or tools along with a description of when to call these tools/functionality.

How is it working?

The LLM analyzes the query to find out whether it is related to any of the tools and their descriptions.

If so, the LLM will suggest the tool along with the parameters to the agent/external logic. The external logic will perform the action and send the result back to the LLM.

The LLM reads the result and generates the structured output.