I figured out the issue.
The reason I couldn’t access the state inside the tool was because I hadn’t passed the state_schema when creating the agent. Once I included the correct state_schema in create_agent, the state values became available as expected.
Do you how the agent is accessing state_schema if i had not included it while creating agent. Because when i print the runtime earlier, i could find only messages in it as the state