Update state within a tool

How to access and update the state inside a tool(not in the node) in Langgraph ?

Please check out the tools guide which has a section on how to work with short term memory.