We Got It All Wrong: Why Function Calling is a Dead End for AI Agents | Cloudflare | Matt Carey @JavaScriptConferences
We Got It All Wrong: Why Function Calling is a Dead End for AI Agents | Cloudflare | Matt Carey  @JavaScriptConferences
Uploaded April 2026 | Updated November 2026, 13 hours ago
Offload your entire OpenAPI spec to sandboxed V8 isolates to bypass the 2.3M token context wall once and for all.

πŸŽ™οΈ "We got it all wrong." Matt Carey (Cloudflare) breaks down why the industry's approach to AI Agents and Tool Calling is hitting a hard limit. When your API reaches 2.3 million tokens, "cherry-picking" endpoints for your MCP server isn't just tedious β€” it's architecture suicide.

πŸ’‘ The solution? Code Mode. Instead of feeding bulky tool definitions into the LLM context, Matt proposes a paradigm shift: Agents writing code against a typed SDK, executed within secure, lightweight Dynamic Worker Loaders.

What’s inside this Node Congress 2026 deep-dive:
β˜‘οΈ The 2.3M Token Wall | Why traditional Function Calling fails at enterprise scale.
β˜‘οΈ Code Mode vs. Semantic Search | Why "Discovery on Demand" is more reliable than brittle RAG-based tool search.
β˜‘οΈ Infrastructure as a Sandbox | Running untrusted LLM code with 1ms cold starts via V8 isolates.
β˜‘οΈ MCP Evolution | How to scale Model Context Protocol for massive APIs while keeping your AI clients lean and token-efficient.
β˜‘οΈ Live Demo | Building a cross-service Agent workflow in a single round-trip.

πŸ”₯ Matt Carey is an Agent & MCP Specialist at Cloudflare and a core maintainer of the official MCP TypeScript SDK. He specializes in architecting autonomous systems using Cloudflare primitives like Dynamic Worker Loaders and Durable Objects, helping industry leaders build and scale production-ready AI agents. Beyond the terminal, Matt brings a high-performance mindset from his previous career as a professional windsurfer, having represented Malta at multiple World and European championships.
πŸ‘‰ Connect with Matt:
πŸ”— linkedin.com/in/mattzcarey
πŸ‘‰ Explore Matt’s code and the MCP SDK:
πŸ”— github.com/mattzcarey
πŸ‘‰ Deep dive into Matt’s insights:
πŸ”— mattzcarey.com
πŸ‘‰ Build AI Agents on Cloudflare:
πŸ”— developers.cloudflare.com/workers

πŸ“Œ Follow the link to watch the full version of the talk and gain access to all Node Congress recordings:
πŸ”— gitnation.com/events/node-congress-2026?utm_source=youtube&utm_medium=MattCarey

πŸ’¬ Don’t just watch β€” get your toughest architecture questions answered in real-time, be part of the room where Seniors and Architects shape the future, get ahead of the curve. Join us live at the next event!
πŸ”— gitnation.com/events?utm_source=youtube&utm_medium=MattCarey

πŸ• Timestamps:
00:00 - Intro
00:41 - Beyond the Glass Box: Giving AI Agents Hands
01:16 - Your 20% Off 🀫
01:53 - The Evolution of MCP: From Bundle Tools to Global Sharing
03:30 - The Context Limit Nightmare: Cloudflare’s 2.3M Token Problem
04:41 - The Core Thesis: Context Limits are an Agent Problem
05:05 - Progressive Disclosure 101: CLI Bash & Self-Documentation
05:30 - The Brittle Reality of Semantic Tool Search
06:02 - Code Mode Unveiled: Discovering Tools on Demand
08:20 - Hidden Inefficiencies: Why Search Costs 17,000 Tokens
09:52 - Typed SDKs: Generating Reliable Pipelines for LLMs
11:55 - The Safety Dilemma: Running Untrusted AI-Generated Code
13:04 - Control Flow Mastery: Solving Brittle AI Workflows
14:52 - Massive Token Efficiency: One Round Trip to Rule Them All
16:28 - Architecture Suicide? The History of Sandboxing
18:29 - Dynamic Worker Loaders: The Ultimate Agent Sandbox
20:30 - Network Lockdown: Controlling Fetch in Isolate Environments
21:40 - Live Demo: Managing Enterprise Projects via Code Mode
24:27 - MCP Evolution: Bringing Server-Side Complexity to AI
26:27 - Scaling to Cloudflare: Managing 2,600 Global Endpoints
27:44 - Action Demo: Deploying Infrastructure via AI Chat
31:38 - Final Thoughts: The Future of Agents & Hiring
32:21 - ⁉️ Q&A: Handling Massive Specs & API Discovery Patterns

✍️ This talk was part of Node Congress 2026:
Every API is a Tool for Agents with Code Mode | Matt Carey
πŸ”— nodecongress.com/?utm_source=youtube&utm_medium=MattCarey

πŸ“Œ We’ve hidden a secret code for 20% off your next event.
Join our upcoming conferences!

πŸ’« JSNation 2026 June 11 & 15, 2026 (Amsterdam)
πŸ”—jsnation.com/?utm_source=youtube&utm_medium=MattCarey

πŸ’« React Summit, June 12 & 16, 2026 (Amsterdam)
reactsummit.com/?utm_source=youtube&utm_medium=MattCarey

πŸ’« TechLeadConf, June 11 & 12, 2026 (Amsterdam)
techleadconf.com/?utm_source=youtube&utm_medium=MattCarey

and more!

πŸš€ Check out all the upcoming events from GitNation:
πŸ”— gitnation.com/events?utm_source=youtube&utm_medium=MattCarey

Don't forget to use INSIDER20 promo code for 20% off on tickets.

#AIAgents #Cloudflare #NodeCongress #MCP #ModelContextProtocol #CodeMode #SoftwareArchitecture #V8Isolates #OpenAPI #BackendEngineering #TypeScript #NodeJS #WebDev #LLM #AIEngineering #TokenOptimization #FunctionCalling #AgenticWorkflows #Cloud Computing #GitNation #CloudflareWorkers #JavaScriptConference #TechTalk
We Got It All Wrong: Why Function Calling is a Dead End for AI Agents | Cloudflare | Matt CareyPrompting is for Juniors. The New Senior AI Role | Kent C. DoddsReact Summit & JSNation US edition #gitnation #techtalks #reactsummit #jsnation #shortsSLMs are Killing Giants: Why GPT-4 is Overkill for Agents | Legare Kerrison | Red HatIs your Node.js stack ready for 2026? πŸš€ #shortsWhy there are so many people into coding and music at the same timeπŸ€” #devlife #softwareengineerRyan Carniato on Why the Virtual DOM is losing the war  #shortsREST sends data across the network. What if it could send callable objects instead? #shortsRewrite or Refactor? How to Safely Move Legacy Apps to Modern Frameworks - at JSNation 2026 #shortsNode.js on Mobile: Zero-Bridge Shared Logic with Bare RuntimeJSNation in Amsterdam (June 11&15) | Price increase β€” in one week! | JavaScript Conference #shortsso technically.. job done, right?πŸ‘‰πŸ‘ˆ #techconference #techevent #frontend #devlife #devhumor
JavaScript Conferences by GitNation |

We Got It All Wrong: Why Function Calling is a Dead End for AI Agents | Cloudflare | Matt Carey

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER