# Code Mode MCP Reduces Agentic Tool Calls by 70% in Production
This talk explains how Kong took code mode MCP into production to make large API catalogs usable for agentic systems. Instead of exposing a model to hundreds or thousands of tools at once, the approach reduces interaction to a small set of verbs such as search, get schema, and execute, then runs model-written code inside a sandboxed Python-like environment that can chain calls, transform outputs, and keep intermediate data out of the model context. Using tools generated from an OpenAPI spec alongside existing handcrafted domain-specific MCP tools, the team supported a catalog of roughly 1,000 APIs and reported a 70% reduction in agentic loops over 30 days in production, avoiding about 32,000 round trips. Key lessons include setting sandbox time, memory, and recursion limits based on actual API object depth, returning output schemas so chained calls work reliably, recording successful calls to recover from partial failures, and shifting human approval from individual tool calls to the execution plan, especially for destructive operations.