I gave my AI agent a 2MB PDF. Here's what happened to my token count.
The article discusses the token costs associated with processing a 2MB PDF using an AI agent. It highlights the inefficiencies of inline processing compared to using specialized services. By utilizing the Model Context Protocol (MCP), significant reductions in token usage and costs can be achieved.
- ▪Processing a 2MB PDF inline can cost over 97,000 tokens just for input.
- ▪Using the MCP approach can reduce the token cost to around 8,000 tokens for the same document.
- ▪The cost difference between inline processing and MCP can be as much as ten times cheaper per document.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3957328) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Mark Turner Posted on May 28 I gave my AI agent a 2MB PDF. Here's what happened to my token count. #ai #mcp #llm #agents Every token your agent spends on file I/O is wasted reasoning capacity. I was building a document processing agent — the kind that reads incoming research reports, extracts key findings, and produces executive briefings. Nothing exotic. The kind of workflow thousands of teams are automating right now. The PDF I was testing with was 2MB. Dense text.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).