How to Return Tool Output and Update State Simultaneously Using Command in LangChain?

Hi @bharathiselvan

If I understand your point correctly, you want to update the state and return the tool result itself separately, right?

Based on the signature (Types | LangChain Reference) - you can’t sparate those data - it all must be sent via state imho

A tool or node can return a Command that both updates the graph state and controls flow (e.g., route to the next node)

See those: