SShortSingh.
Back to feed

AI Agents Waste Tokens Re-Reading Unused Tools on Every Turn, Microsoft Offers Fix

0
·1 views

AI agents that use large tool catalogs silently waste input tokens by resending the full JSON schema for every tool on every request turn, regardless of whether those tools are used. A 200-tool catalog at 250 tokens per schema can consume around 600,000 input tokens on tool definitions alone across a 12-turn task, dwarfing the actual conversation cost. Beyond cost, large catalogs with near-duplicate tool names degrade the model's tool-selection accuracy, not due to model limitations but due to genuine ambiguity in the options presented. Microsoft introduced a Tool Search feature at Build 2026 for Azure AI Foundry, replacing the flat tool list with two meta-tools that let agents retrieve a small ranked set of relevant tools on demand, keeping token usage roughly flat regardless of catalog size. The approach is most beneficial above roughly 30 tools, and can be further optimised by pinning frequently used or critical tools to bypass retrieval latency entirely.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Go and Rust Power Secure, Local-First AI Assistants for Privacy-Critical Use Cases

A technical framework for building local-first AI assistants has been outlined, using Go for orchestration and Rust for inference execution, eliminating reliance on cloud-based APIs. The architecture addresses key concerns around data privacy, latency, and offline operation, making it suitable for sectors like healthcare and financial analysis. A micro-kernel design separates the system into three layers: a Go-based orchestrator managing sessions and workflows, a Rust-based engine handling model inference with memory safety guarantees, and a typed bridge connecting the two. Rust is specifically chosen for the inference layer because its ownership model prevents buffer overflows and race conditions at compile time, treating memory safety as a security feature. The absence of garbage collection in Rust also ensures consistent, low-latency token generation critical for real-time chat interfaces.

0
ProgrammingDEV Community ·

Claude Code Brings Autonomous Code Review and Auto-Fix to CI Pipelines

Anthropic's Claude Code can now operate as an autonomous agent inside CI pipelines, automatically reviewing pull request diffs, generating missing tests, and fixing failures without human intervention. Unlike traditional CI bots that only detect and report issues, Claude Code in auto mode detects, repairs, and documents problems, posting structured feedback directly as review comments. The tool integrates with major platforms including GitHub Actions, GitLab CI, and Azure DevOps via environment variables and secrets management. A built-in safety classifier reviews each command before execution to prevent scope escalation or unauthorized file access, which is critical given the agent operates with repository write access. Production deployments require token budgets per pull request, scoped file permissions, and defined exit conditions to avoid runaway execution costs.

0
ProgrammingDEV Community ·

How to Build an MCP Server to Expose AI Tools Using Python and Flask

A developer working on a LangGraph-powered support bot encountered persistent context-retention failures, which were traced back to the absence of a centralized tooling server. To solve this, they outline how to build a Model Context Protocol (MCP) server that exposes tools to AI applications in a scalable way. The walkthrough uses Python to define a basic sentiment analysis tool and a Flask-based REST server to host and serve it via HTTP endpoints. A key practical warning is raised: tools must be registered before the server starts, or a dynamic registration mechanism should be used to keep the tool list current. The post is part of a 30-day series on agentic AI development with LangGraph and MCP.

0
ProgrammingDEV Community ·

Developer Launches Order Archive Manager Plugin for WooCommerce on WordPress.org

A developer has released their first WordPress.org plugin, Order Archive Manager for WooCommerce, following several weeks of development and review. The plugin allows WooCommerce store owners to move historical orders into separate database tables, reducing the size of active order tables. Archived orders remain safe and can be fully restored at any time. The WordPress Plugin Review Team provided feedback during the approval process. The developer plans to enhance the plugin further, with HPOS support among the features planned for future releases.