AIMessage carries tool call requests in its tool_calls field as structured JSON. The application executes the tool and returns a ToolMessage containing the result and the matching tool_call_id to close the loop [citation:1].
The round trip for a tool call is a core pattern in LangChain agents. When an LLM decides to use a tool, it returns an AIMessage where the content is typically empty and the tool_calls field is populated with a list of requests. Each request has a (the tool's name), (the arguments as a JSON dict), and a unique . Your application then uses this and the tool name to execute the function. Once done, it constructs a , placing the result in and the original request's in the field. This is then appended to the conversation history and sent back to the LLM, which uses it to formulate its final answer to the user [citation:1].
nameargsididToolMessagecontentidtool_call_idToolMessage0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience