How to expose tools to AI agents without clogging their context
说明与用途
通过使用固定工具和按需发现工具,AI 代理的上下文令牌消耗减少了 69%,提升了效率。
问题
AI agents struggle to manage large tool catalogs because tool definitions, selection, and results consume excessive context tokens, hindering performance and clarity.
结果
Implementing discovery with pinned tools cut input token usage by 69% compared to loading all tool definitions, improving efficiency and reducing context clutter.
工作流
- Configure Agent Sessions to expose a small working set of tools and enable discovery for the rest.
- Pin frequently used tools (e.g., meeting and account actions) in the session configuration.
- When a task starts, load only the pinned tools into the model’s context.
- If the agent needs an additional tool, invoke the meta tool
nango_tool_searchto find matching definitions. - Execute the selected tool via
nango_executeor directly if already loaded. - Enforce execution permissions at the backend, ensuring the agent cannot broaden its scope.
- Measure token usage for the entire task to decide which tools to pin.
- Iterate on pinning strategy based on observed usage patterns.
证据
Discovery with two pinned tools used 69% fewer input tokens per task than loading all 57 tool definitions upfront in our synthetic test.
Tool exposure creates three separate costs: Definitions, Selection, Results.
Separate tool permissions from tool visibility. User authorization, session permissions, and tool visibility control different things.
- 记录日期: 2026-10-15T19:56:31.003Z