How Agents Find and Choose the Right Tool for a Task

Agents choose tools well when discovery is a staged decision: identify the capability, narrow eligible operations, inspect their contracts, and select the smallest operation that can produce an acceptable result. Searching a large catalog and executing the first plausible name is a poor substitute for that process.

The challenge is semantic. A tool named “search” might return web pages, company records, or product listings. A “research” operation might return sources, a generated report, or an asynchronous job. The agent needs to understand which result actually serves the user’s task.

This guide presents a practical selection funnel, an example decision record, and a way to evaluate whether discovery is improving useful work.

Describe the needed result before searching

Start with a capability statement that includes the input, desired output, and constraints. “Find tools for research” is too broad. “Find public web pages about a product’s current pricing, returning retrievable source URLs” is much easier to evaluate.

Write down the acceptance criteria separately from preferences. Source URLs may be required; a particular provider may be optional. A same-day freshness requirement may matter; a polished summary may not. This distinction prevents convenience features from displacing the essential result.

For example, a company brief needs evidence about products and customers. Search can find candidate pages, extraction can read them, and an enrichment service may contribute structured company data. Those capabilities complement each other. They should not be treated as identical alternatives merely because all can return company-related text.

The company research workflow starts from an evidence ledger for that reason. Tool selection follows the evidence needed, rather than determining what facts the agent will claim.

Separate discovery from inspection

Discovery should be lightweight. It helps the runtime find candidate identifiers without loading every operation’s full schema into every model turn. Inspection retrieves the detail needed to make a decision and prepare inputs.

MCP defines named tools with descriptions and schemas, plus operations for listing and calling them. A gateway can additionally expose its own catalog discovery and inspection tools, keeping a small runtime interface while serving a larger provider catalog. MCP tools specification.

In o11, discover searches allowed tool names, providers, and identifiers and supports pagination. It should not be described as a semantic search engine. inspect returns the selected tool definition, including the provider contract and requirements available to the caller.

Use several deliberate search terms when terminology differs. For a page-reading task, the developer can try extraction, crawl, and the known provider name. Then compare actual definitions. A missing name match is not proof the capability does not exist, and a matching name is not proof it fits.

Apply hard filters before ranking

Reject candidates that cannot satisfy required constraints. Hard filters include availability, permitted account mode, necessary input types, workspace policy, required output evidence, and lifecycle compatibility.

If an operation requires customer credentials and none are connected, it is not ready for immediate execution. If the application needs a completed result within a short interactive request, a long-running job may require a different user experience. If the task forbids changes to remote data, a write operation is ineligible even when its name sounds useful.

Only rank candidates after these conditions are satisfied. Otherwise a cheap but unusable operation can repeatedly win a superficial score.

CheckPass conditionIf it fails
CapabilityOperation produces the required kind of evidenceSearch another capability
AccessAccount and policy permit the operationRequest configuration or choose an eligible path
ContractRequired inputs can be supplied honestlyAsk for missing data; do not invent identifiers
LifecycleApplication can handle completion and recoveryAdd durable handling or choose another operation
EconomicsApproved ceiling and usable pricing evidence existQuote, configure, or stop

This is a recommended evaluation artifact. It describes how to choose, not a claim that every platform performs these checks automatically.

Rank for the task rather than catalog popularity

After hard filtering, compare result fitness, input simplicity, observed reliability, latency requirements, and total workflow cost. Weights should reflect the user’s task.

A source-checking assistant may prioritize provenance and exact page access. A design prototype may prioritize asset format and turnaround. An account automation task may prioritize authorization fidelity and resource ownership. A single universal tool score hides those differences.

Use known evaluation cases. For page extraction, include the page types your users actually submit: static product pages, documentation, pricing tables, and pages with inaccessible content. Do not assume performance on one example generalizes to all websites.

Record missing evidence as missing. If no authorized live measurement exists, do not invent a latency or reliability score. Use a provisional decision based on documented capabilities, then update it after a controlled evaluation.

Price also needs context. A lower call price can be offset by repeated requests or unusable output. Compare the cost of producing an accepted result under equivalent constraints. The workflow cost comparison method makes that comparison explicit.

A worked selection record for reading a pricing page

Consider an illustrative task: extract the current public pricing table from a supplied URL and retain the source. The following record shows what the application should decide before dispatch. It contains no claimed benchmark results.

Required result: Plan names, stated prices, billing periods, source URL
Excluded action: Login, account creation, or purchase
Candidate A: Simple fetch, if the content is present in returned HTML
Candidate B: Extraction service, if supported for the page structure
Candidate C: Browser session, only if interaction is necessary and allowed
Selection rule: Use the least complex eligible operation
Acceptance rule: Every price must be traceable to retrieved page content
Fallback rule: Escalate only after a known limitation or failure
Stop rule: Report inaccessible evidence instead of guessing

The record prevents automatic escalation from “read this page” to a browser session or a paid enrichment purchase. It also gives the agent a useful explanation when the source cannot be accessed.

After execution, validate the actual content. If the page says “contact sales,” retain that wording as an unavailable public price. Do not infer a dollar amount from a competing product or an older source.

Keep production selection reproducible

During exploration, dynamic discovery is useful. In a production workflow, unconstrained rediscovery can change behavior silently. A newly added operation may have a similar name but different account requirements or semantics.

Retain the selected tool identifier, inspected contract information, application adapter version, and acceptance criteria with the workflow configuration. Review changes to those choices just as you would review a dependency update.

This does not require freezing the entire catalog. A workflow can have a reviewed candidate set and a deterministic selection policy. For example, choose between approved operations based on required file type, while keeping the output contract stable.

Avoid feeding thousands of raw definitions into each prompt. The application can expose a small discovery interface, inspect a few candidates, and present only the relevant schemas. That keeps the model’s decision focused without assuming that fewer prompt tokens automatically guarantee better choices.

The reusable tool layer guide shows how to centralize this policy while letting projects retain their own capabilities.

Treat descriptions and results as input to evaluate

A tool description influences model behavior, but it is not an authorization policy. The server still needs to enforce permitted operations, account scope, and spending. A description saying “safe” cannot grant write permission.

Likewise, external results should not be able to modify the workflow’s authority. A retrieved page can contain requests to send data elsewhere or call another tool. The agent should treat those as page content unless the user has separately authorized the action.

Keep trusted selection rules outside provider text. Use typed application configuration for approved tool identifiers and account modes. Validate supplier inputs and returned structures at the boundary.

Schema quality matters here. A description may explain when to use a field, while a schema enforces its type and required status. Neither alone proves that an operation is appropriate for the task. The schema usability experiment separates structural validity from meaningful selection.

Measure selection quality with useful outcomes

Track whether the agent selected an eligible tool, supplied valid inputs, obtained the required evidence, and stopped appropriately. These are more actionable than counting how often a tool was called.

Review failures by category: wrong capability, missing account, malformed input, provider limitation, unusable result, or unnecessary extra work. The category determines whether to change discovery wording, configuration, adapter logic, or the workflow itself.

Begin with a small, representative task set and preserve unsuccessful cases. An agent that correctly declines an unsupported request may be behaving better than one that always produces an answer. Record that distinction in your evaluation rubric.

For the first implementation, choose a bounded tool set and one output contract. Expand only when a new capability addresses a real missing task. Our tool-set selection guide provides a practical way to keep that expansion deliberate.

Sources

Give your agents a wallet.
Open up their world.

The paid web, through one simple API.

Get started
Become a partner Sell your product/API to agents using o11.

Keep reading