Dynamic tool discovery
Data as of Oct 21, 2026
Reviewed by Dimitry Apollonsky
Which brands AI mentions
Mentioned in · Jul 7 – Oct 21, 2026
ChatGPT SearchChatGPT SearchGoogle AI ModeGoogle AI Mode
Widest split: OpenAI Agents SDK, 50% on ChatGPT Search and 4% on Google AI Mode.
- 1Model Context ProtocolChatGPT Search 96%Google AI Mode 87%
- 2LangChain LangGraphChatGPT Search 63%Google AI Mode 78%
- 3LangChainChatGPT Search 42%Google AI Mode 52%
- =4Microsoft Semantic KernelChatGPT Search 29%Google AI Mode 35%
- =4OpenAI Agents SDKChatGPT Search 50%Google AI Mode 4%
Questions and answers
Google AI ModeOct 21, 2026
The best framework approach for dynamic tool discovery is the Model Context Protocol (MCP) combined with enterprise agent gateways like LangChain, CrewAI , or Spring AI . MCP standardizes how agents discover tools from external servers at runtime, preventing context bloat by injecting only relevant tool definitions on-demand.
Top Frameworks for Dynamic Tool Discovery
- Model Context Protocol (MCP): Created by Anthropic and adopted widely, it acts as an open standard for connecting AI models to secure, discoverable external tool servers.
- LangChain / LangGraph: Offers advanced dynamic tool loading and runtime registry patterns where agents query a central tool store based on current state.
- CrewAI: Features flexible agent tool-set configurations that can bind or swap tool registries dynamically per task execution.
- Spring AI: Implements native Tool Search advisors (
ToolSearchToolCallingAdvisor) that index tool libraries and let models search for required capabilities dynamically.
Core Architecture Patterns
- Discovery First, Injection Second: The model initially sees only a core search primitive instead of hundreds of tool schemas, saving context tokens.
- On-Demand Expansion: When a task requires a specific capability, the agent queries the registry, retrieves the relevant tool reference, and injects its full schema.
- Decoupled Servers: Hosting tools on independent microservices or MCP servers allows new capabilities to be added or updated without redeploying the core agent application.
If you can share where your tools are hosted (e.g., local APIs, cloud functions, or MCP servers) and how many tools you plan to manage, I can recommend a specific architectural setup.
Sources cited in this answer4
- lunar.devDynamic Tool Selection for AI Agents | Solving the Context Management Problem
- techcommunity.microsoft.comDynamic Tool Discovery: Azure AI Agent Service + MCP Server Integration | Microsoft Community Hub
- docs.spring.ioDynamic Tool Discovery with Tool Search Tool :: Spring AI Reference
- sparkco.aiEnterprise Guide to Dynamic Tool Loading Agents
ChatGPT SearchOct 21, 2026
For a system where agents can dynamically discover and use new tools, I'd recommend Model Context Protocol (MCP) for tool discovery and interoperability, paired with LangGraph for orchestration if you need complex, stateful agent workflows.
The key architectural decision is to separate the protocol that discovers and exposes tools from the framework that decides when and how agents use them. MCP defines a standard way for clients to enumerate available tools and invoke them, while agent frameworks manage reasoning, execution, and workflow state.
The best options
1. Model Context Protocol (MCP) — best for dynamic tool discovery
(Recommended foundation)
MCP lets agents discover tools from external servers, read their descriptions and input schemas, and invoke them through a common protocol. Servers can update their available tool lists and notify clients of changes.
Best when tools are added by plugins, internal services, third-party integrations, or independently deployed teams.
Docs:
2. LangGraph — best for complex production agents
Provides explicit workflow state, branching, persistence, and control over agent execution. Pair it with MCP-compatible clients and a tool registry to discover tools dynamically.
Best when agents need retries, long-running workflows, approval gates, or predictable control over execution.
Docs:
3. OpenAI Agents SDK — best for a lightweight agent runtime
A good fit if you want tool use, agent handoffs, and guardrails without implementing a full workflow engine. It supports MCP integrations.
Best when you prefer a relatively small abstraction layer and straightforward agent execution.
Docs:
Recommended architecture
For genuinely dynamic discovery—where new tools can appear after your agent is deployed—I would build a registry + progressive discovery + execution gateway around MCP.
Agent / LLM
Determines the capability needed
Discovery layer
search_tools(query) → ranked tool candidates
Keyword + semantic search + permission filtering
Tool registry / MCP clients
Fetch current schema, validate access, resolve endpoint
MCP server A
Internal APIs
MCP server B
External plugins
Execution gateway enforces authorization, timeouts, auditing, and approval policies.
This follows MCP's recommended progressive-discovery pattern: expose a small
search_toolscapability, then load full tool definitions only when needed. This becomes particularly valuable when you have hundreds or thousands of tools.How I'd implement it
- Register tools dynamically. Each tool has a unique ID, description, input schema, server endpoint, version, required permissions, and health status.
- Search capabilities, not every tool definition. Start with keyword search and add vector embeddings for semantic matching. Use a small model to rerank candidates only when necessary.
- Load the full schema on demand. The agent sees only a few relevant tools at a time, instead of the entire catalog.
- Execute through a controlled gateway. Validate arguments, check user and agent permissions, enforce timeouts and quotas, and require approval for sensitive actions.
- Refresh and invalidate caches. Respond to tool-list change notifications and handle tools that disappear or change schema between discovery and execution.
- Measure discovery quality. Track tool-selection accuracy, execution success, latency, token usage, and unauthorized-call attempts.
These design choices align with the MCP client guidance on progressive discovery, caching, and tool invocation.
Which stack should you choose?
Your main requirement Suggested stack Complex, stateful agents MCP + LangGraph Lightweight agents with minimal framework overhead MCP + OpenAI Agents SDK TypeScript-first applications MCP + Mastra Hundreds or thousands of tools MCP + searchable tool registry + progressive discovery Strict enterprise access control MCP + policy enforcement gateway + audit logging Framework comparisons also distinguish LangGraph's explicit stateful orchestration from the lighter agent SDK approach.
One important distinction: MCP standardizes tool discovery and invocation; it does not by itself provide a complete global registry, semantic search engine, trust system, or orchestration layer. Those are parts you design around it.
One question that would change my recommendation
When you say agents should dynamically discover new tools, which scenario is closest to your goal?
1. What does dynamic discovery mean in your system?
Agents discover tools at runtime from many existing services.
New tools or plugins can be registered without redeploying agents.
Agents discover capabilities offered by other agents.
Agents can find, generate, or install tools they have never used before.
2. What's your primary language?
Python
TypeScript / Node.js
Multiple languages
3. Roughly how many tools?
Dozens
Hundreds
Thousands or more
[Recommend my architecture]
Sources cited in this answer9
- github.commodelcontextprotocol/docs/specification/2026-07-28/server/tools.mdx at main · modelcontextprotocol/modelcontextprotocol · GitHub
- github.commodelcontextprotocol/docs/docs/2026-07-28/learn/architecture.mdx at main · modelcontextprotocol/modelcontextprotocol · GitHub
- langchain.comThe best AI agent frameworks in 2026
- modelcontextprotocol.ioWhat is the Model Context Protocol (MCP)? - Model Context Protocol
- nerova.aiOpenAI Agents SDK vs LangGraph in 2026: Which Agent Framework Should You Choose?
- docs.langchain.comLangGraph overview - Docs by LangChain
ChatGPT SearchOct 12, 2026
The recommended approach is to use the Model Context Protocol (MCP) with dynamic tool discovery and progressive tool loading. This allows agents to discover available capabilities at runtime, select the right tools for a task, and use new tools without hard-coding every tool into the agent.
For an agentic system that needs to scale as tools are added, the key design principle is: discover broadly, load selectively, and invoke through a standardized protocol. The official MCP documentation and AWS guidance describe this pattern, including runtime discovery and semantic tool search.
Recommended architecture
1. User request
Understand the task and identify the required capability
2. Discovery layer
Search a tool registry or call
search_toolsusing semantic matching3. Load and validate tools
Fetch schemas, check permissions, and expose only relevant tools to the model
4. Execute through MCP
Call the selected tool with validated arguments and return its result
5. Re-evaluate and continue
Use the result, discover additional tools if needed, and continue the task
1. Choose the discovery strategy based on scale
Strategy Best for Trade-off Static registration Small, stable toolsets Simple, but brittle when tools change Dynamic discovery Small to medium, evolving toolsets Easy to implement, but context usage grows Progressive discovery + semantic search Large or rapidly growing tool ecosystems Requires a registry and retrieval layer AWS explicitly distinguishes these approaches and recommends filtering or semantic search to expose a scoped set of relevant tools.
2. Implement MCP's discovery and invocation lifecycle
Use the standard MCP client/server protocol rather than inventing a custom integration for each tool provider.
- Discover: call
tools/listto retrieve available tools and their input schemas. - Index: maintain a searchable catalog containing tool names, descriptions, schemas, server identity, and access metadata.
- Search: expose a lightweight
search_tools(query)capability to the agent. - Inspect: fetch the full schema and documentation for selected candidates.
- Invoke: use MCP's
tools/callwith the selected tool name and validated arguments. - Refresh: respond to
notifications/tools/list_changedso newly added or removed tools are reflected in the catalog.
MCP defines the listing, invocation, and change-notification mechanisms needed for this lifecycle.
3. Recommended production design
For a general-purpose agent, I'd use three layers:
- Discovery layer: semantic or hybrid search over a catalog of tools and MCP servers.
- Execution layer: an MCP client that loads selected schemas and routes calls to the correct server.
- Governance layer: authentication, per-tool authorization, argument validation, audit logs, and approval for sensitive actions.
Keep credentials in the host or execution broker, not in model-generated code. Treat tool descriptions and returned content as untrusted input, and require appropriate authorization before executing consequential operations.
4. Useful implementation references
Model Context Protocol
The standard protocol for discovering and calling tools across servers.
OpenAI Responses API
A practical option for using remote MCP servers with an API-based agent.
Amazon Web Services tool discovery guidance
Compares static registration, dynamic discovery, and semantic search.
Read the implementation guidance
Bottom line: For your system, start with MCP as the interoperability layer and progressive discovery as the scaling strategy. Let the agent search for capabilities at runtime and load only the schemas it needs. This supports adding new tools without hard-coding them into every agent while keeping context usage and execution access under control.
Sources cited in this answer6
- github.commodelcontextprotocol/docs/docs/2026-07-28/develop/clients/client-best-practices.mdx at main · modelcontextprotocol/modelcontextprotocol · GitHub
- docs.aws.amazon.comTool discovery - AWS Prescriptive Guidance
- github.commodelcontextprotocol/docs/specification/2026-07-28/server/tools.mdx at main · modelcontextprotocol/modelcontextprotocol · GitHub
- github.commodelcontextprotocol/docs/docs/2026-07-28/learn/architecture.mdx at main · modelcontextprotocol/modelcontextprotocol · GitHub
- modelcontextprotocol.ioWhat is the Model Context Protocol (MCP)? - Model Context Protocol
- developers.openai.comMCP servers | OpenAI API
- Discover: call
Also asked as
- We are designing an agent architecture that requires the ability to discover and integrate tools dynamically. Can you recommend a framework that handles this?