session_state = {} # session_id -> {"step_a_done": False}
def tool_b(session_id, **kwargs):
state = session_state.setdefault(session_id, {"step_a_done": False})
if not state["step_a_done"]:
return {
"isError": True,
"content": [{"type": "text", "text": "call tool_a first — tool_b requires its output"}],
}
source & further reading
dev.to — original article
1,000/1,000 bits leaked through a rounding error
Which AI Is Really Behind That Chatbot? I Fingerprinted 3 Live Bots With LLMmap, and It Was Confidently Wrong
What Happens to an AI Agent When the Wi-Fi Drops?