Wrap Legacy APIs for AI Agents: OpenAPI to Checked Tools
Seven operations in the old API, four tools for the agent, and only two of six test calls got through.
Video #240 ยท Enterprise architecture and AI agents
Steps in the video
Files
- compare.py (24 lines)
- convert.py (46 lines)
- legacy.py (7 lines)
- spec.py (28 lines)
Tested with
Python 3.12.15
What this does not show
A made-up API with seven operations and six hand-written calls; no model or agent runs. The checks cover missing, unknown, wrong type and one maximum, so a negative refund still passes. No nested bodies, headers, authentication, user identity or approval step.
Sources
Learning IT by Example.