From HATEOAS to MCP: Guiding AI Agents Through State Machines

If you let an AI agent loose on an API with 15 tools, it will eventually figure out the right sequence. But it will also try things that don’t make sense, hit errors, retry, and waste tokens doing it. The question is: can we make the API itself tell the agent what to do next? The Problem Consider an order management system. An order goes through states: pending → confirmed → shipped → delivered....

Apr 4, 2026 · 6 min