Context Engineering for MCP: 150K-22K Tokens
summary
Measured context goes from 1.17M tokens for 2,594 tools down to a single-code approach that often needs ~1k tokens; a production agent moves from 150K to 22K prompt tokens and tool selection jumps from 42% to 80%. Models write JavaScript in a secure sandbox to call MCP tools, returning trimmed fields instead of full documents; prototypes (Pi demo) work but face stale definitions, nonexistent method guesses, excessive script output, and harder debugging.
AI-written summary · about
chapters (14)
- 0:00The 1.17 Million Token Problem
- 1:01Meet the Speakers and Takeaways
- 2:30Where Did the Context Go
- 3:44Copying Data Through the Model
- 4:31Tool Selection Accuracy at 42%
- 4:56Tool Selection Accuracy at 42%
- 5:40How Code Mode Works
- 8:25Progressive Disclosure of Tools
- 9:05Production Results: 150K to 22K
- 10:53Pi Demo: Direct Tool Calling
- 12:57Pi Demo: Code Mode Run
- 16:38Challenges and When Not to Use It
- 19:01Try It Yourself and Wrap-Up
- 19:52Try It Yourself
