PulseAugur
中
实时 15:18:01
English(EN) Your MCP Tools Are Eating Your Context Window: Measure, Trim and Lazy-Load Tool Definitions in Python

AI 代理因过多的工具定义导致成本飙升;开发者分享优化技巧

一位开发者在使用内部代理时遇到了严重问题,包括工具选择不正确、响应缓慢以及 API 成本翻倍。根本原因是添加了三个新的 MCP 服务器(GitHub、PostgreSQL、Jira),使工具总数超过 90 个。每次向 LLM 发送请求时,都会包含所有这些工具的完整定义,在处理用户的实际查询之前,大约会消耗 38,000 个 token。该开发者分享了测量每个 MCP 服务器 token 使用量的方法,并提出了修剪工具模式和实现惰性加载的策略,以降低成本并提高准确性。 AI

影响 优化 AI 代理中的工具定义处理可以显著降低运营成本并缩短响应时间,从而使 AI 系统对开发者和用户更加高效。

排序理由 该文章描述了对现有 AI 代理进行技术优化,重点是提高效率和成本效益,而不是新发布或研究。

在 dev.to — MCP tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 1 个来源。 我们如何撰写摘要 →

AI 代理因过多的工具定义导致成本飙升;开发者分享优化技巧

本文如何被排名

Signal score
50 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
该文章描述了对现有 AI 代理进行技术优化,重点是提高效率和成本效益,而不是新发布或研究。
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
infra, product
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
Breaking (< 6h)
Fresh story with cross-source coverage still developing. Ranking may shift as more sources report.

完整方法见我们的编辑标准。

报道来源 [1]

  1. dev.to — MCP tag TIER_1 English(EN) · EME GUG ·

    您的 MCP 工具正在消耗您的上下文窗口:在 Python 中测量、修剪和惰性加载工具定义

    <p>Tuần trước mình debug một agent nội bộ: model chọn sai tool liên tục, response chậm, bill API tăng gần gấp đôi so với tháng trước. Code agent không đổi gì, prompt cũng không đổi. Hóa ra team vừa cắm thêm 3 MCP server (GitHub, Postgres, Jira), tổng cộng hơn 90 tool. Request nào…