Enterprises spent the final decade constructing API applications. A big group now runs 1000’s of inside APIs, every with a spec, proprietor, authentication scheme, and entry insurance policies enforced at a gateway. As brokers transfer into manufacturing, these APIs are the plain supply of the context brokers want: buyer information, order standing, stock, pricing, and assist tickets.
The harder query now’s how brokers attain these methods at scale. The Mannequin Context Protocol (MCP) gave the trade a regular solution to join brokers to instruments. However the commonest manner groups expose APIs over MCP, one software per API operation, begins to fail nicely earlier than an agent touches a significant share of the enterprise’s API property.
Right here’s why that occurs, what a greater sample appears like, and the way platform groups can construct a context layer that reuses the governance they have already got.
Why one software per endpoint doesn’t scale
The default solution to flip an API into an MCP server is to take its OpenAPI spec and generate one software per operation. That works for a small API. Nonetheless, a typical enterprise CRM or ERP API can have a whole bunch of operations, and an agent that wants just a few of these APIs rapidly faces a whole bunch of software definitions.
Utilizing this method, three issues go sideways quick.
- Value. Each software definition hundreds into the mannequin’s context earlier than the agent does any work, and each intermediate outcome flows again by means of the mannequin. A routine workflow, akin to wanting up a buyer, pulling their open orders, and checking cargo standing, pays for every hop in tokens.
- Accuracy. As soon as the software record grows previous what the mannequin can cause about, software choice degrades. The agent picks the fallacious software from a set of similar-looking choices, or makes three calls the place one would do.
- Latency. Extra context to course of and extra back-and-forth between the mannequin and its instruments slows the agent down. Customers discover that lengthy earlier than anybody sees the token invoice.
Groups often reply by curating. They trim software lists and break up giant APIs into many small MCP servers. That helps, however now each agent use case wants its personal hand-maintained integration. That creates the identical integration sprawl that API applications had been constructed to remove.
Code mode: Let the agent write code in opposition to the API
The trade has converged on a greater sample, usually referred to as “code mode.” A code-mode server exposes an API as a single SDK-like interface as an alternative of a flat record of instruments. The agent writes quick code snippets in opposition to that interface, the code runs in a sandbox, and solely the ultimate outcome returns to the mannequin’s context.
In follow, the sample is search, perceive, and execute. The agent searches the API floor for the operation it wants, pulls that operation’s schema on demand, and runs it. The complete API stays accessible, and solely the components the agent truly makes use of attain its context.
This performs to what fashions already do nicely. Massive language fashions have seen huge quantities of code in coaching and relatively little tool-calling syntax. On the SDK stage, an agent can use a big API it was by no means skilled on as a result of it reads the interface the way in which a developer would.
The effectivity features are substantial. As a result of the agent works in code, one snippet can chain a number of API calls with loops, conditionals, and error dealing with. As such, the multi-step workflow above takes fewer spherical journeys. Intermediate outcomes keep out of the context window. In our testing, a workflow that consumed roughly 120,000 tokens by means of normal software calling used about 1,200 in code mode.
To be clear, code mode carries its personal value. Operating agent-written code means you want each a sandbox you belief and full observability into what the code truly referred to as. A platform workforce adopting the sample ought to deal with each as necessities from day one.
Route agent visitors by means of the gateway you already run
Code mode solves the context window downside, however the governance downside stays. An agent calling a manufacturing API wants every little thing some other shopper wants: authentication, authorization, charge limiting, and audit logging.
Many groups constructing agent integrations recreate these controls one MCP server at a time. Credentials find yourself in server configs. Entry guidelines get redefined by whoever wrote the combination. Agent visitors bypasses the gateway, so it by no means exhibits up within the logs safety groups already watch.
A greater method treats the context layer as an extension of the API platform. The spec, schemas, authentication necessities, and entry insurance policies for every API already reside the place the API is managed. Generate the agent-facing interface from that supply of reality, and route agent calls by means of the identical gateway that governs each different shopper. Present insurance policies then apply to brokers mechanically, and the agent turns into another ruled shopper.
Discovery issues too. Register every agent-ready interface in a central catalog, so the following workforce constructing an agent can discover and reuse it as an alternative of constructing a fourth integration to the identical CRM.
Compose one context floor per agent
APIs are solely a part of the image. Most enterprises already run MCP servers, some from SaaS distributors and a few constructed by inside groups. Brokers additionally want entry to enterprise knowledge sources. A helpful agent attracts on all of them.
A context layer ought to let platform groups compose sources. Take a number of inside APIs and some current MCP servers, and expose them collectively as one code-mode interface scoped to a particular agent’s job. A buyer assist agent will get ticketing, CRM, and transport. It doesn’t get payroll.
That scoping does two jobs directly. It’s a safety management, as a result of the agent can attain solely what its activity requires. Additionally it is a efficiency management, as a result of a smaller, related interface retains the mannequin centered.
Curation is the purpose. Extra context is just not mechanically higher context. The objective is to make the breadth of the enterprise accessible to brokers whereas protecting what reaches the mannequin small and related.
How we carried out code mode at Kong
At Kong, we constructed these ideas into Kong Context Mesh, now usually accessible as a part of Kong AI Administration. They lengthen the method we launched with Kong Context Mesh earlier in 2026.
Platform groups convey collectively their APIs, current MCP servers, and enterprise knowledge sources, and Kong AI Gateway generates the code-mode MCP interfaces brokers use to achieve them. As a result of the gateway generates and serves these interfaces, agent entry sits on the identical platform groups already use to manipulate their API and AI visitors.
Brokers are solely pretty much as good because the context they’ll attain. Efficient brokers want broad entry to enterprise methods, delivered selectively and on demand. The fastest-moving enterprises are treating that context as infrastructure. They’ll generate it from methods they already handle, govern it with insurance policies they already implement, and scope it to the job every agent must do.
APIs grew to become the spine of digital enterprise as a result of platform groups made them discoverable, safe, and ruled. Brokers want the identical self-discipline. The excellent news is that almost all enterprises have already constructed the muse.
—
New Tech Discussion board gives a venue for expertise leaders—together with distributors and different outdoors contributors—to discover and focus on rising enterprise expertise in unprecedented depth and breadth. The choice is subjective, based mostly on our decide of the applied sciences we consider to be essential and of best curiosity to InfoWorld readers. InfoWorld doesn’t settle for advertising collateral for publication and reserves the best to edit all contributed content material. Ship all inquiries to doug_dineley@foundryco.com.
