Daily Edition Sources +3

API Discovery: Make the Model Own Its Web Search

Mastra’s new webSearchTool is deliberately not a generic search client: it selects a provider-native tool from the active model or fails where the provider boundary is unclear.

A rough poster routes a webSearchTool card through four supported model providers while an ambiguous provider is crossed out with an error stamp.
Diagram Punkprovider-native tools need an honest provider boundary.
repo mastra-ai/mastra evidence
3 source signals 1 repo 3 source signals
Evidence: 3 source signals / July 30, 2026 / Daily Edition
Open Edition Evidence below

The useful question is not “does my agent have web search?” It is “whose web search is it, and does this model actually expose it?” Mastra’s new public webSearchTool API refuses to hide that question. The marker resolves at runtime into a provider-defined tool for OpenAI, Anthropic, Google, or xAI; an unsupported or ambiguous provider gets an explicit error instead of a pretend-universal fallback.

A practical example

Mastra’s public documentation shows the small integration surface. Attach the marked tool to a research agent, then let the active supported model provider run its own native search facility.

import { Agent } from '@mastra/core/agent'
import { webSearchTool } from '@mastra/core/tools'

const researcher = new Agent({
  id: 'researcher',
  instructions: 'Use web search only for current claims; name your sources.',
  model: process.env.RESEARCH_MODEL!,
  tools: { webSearch: webSearchTool },
})

The practical consequence is clean ownership. Mastra supplies the integration marker and maps the provider; the provider supplies the actual search tool and its account-level behavior. The companion tests make the boundary concrete by accepting provider and router-style model identifiers while rejecting configurations that cannot be mapped safely.

Copy-paste agent instruction

Add Mastra’s webSearchTool only to the research agent that needs current public information. Before enabling it, resolve the configured model to OpenAI, Anthropic, Google, or xAI; if the provider is unsupported or ambiguous, stop and report the configuration instead of substituting another search service. In every answer, separate provider-returned facts from your own inference and preserve source URLs.

Access and test caveat

This is a source-level API discovery, not a live provider certification. The code and unit tests show provider resolution and the failure path; they do not test your credentials, model entitlement, regional availability, rate limits, search cost, citation behavior, or result quality. Test one sandboxed query on the exact provider/account combination you will operate, and make the failure state visible to the person who owns that account.

Evidence Trail

Receipts below the story

The article above is the public narrative. This section keeps the source trail and limits on the same page.

Edition
DateJuly 30, 2026
LaneDaily Edition
Confidence78%
Sources3
Reposmastra-ai/mastra

Primary Evidence

  • Public API source: Mastra webSearchTool definition
    • Shows: Mastra publishes a provider-aware API surface that maps the active model/provider to a provider-defined web-search tool for OpenAI, Anthropic, Google, or xAI, and throws an explicit error when it cannot infer supported access.
  • Supporting definition or documentation: Mastra’s agent-tools documentation
    • Shows: the documented import and request shape attach webSearchTool to an agent; the provider resolves and runs the native tool at runtime rather than a local API endpoint owned by Mastra.
  • Provider-resolution tests: public unit tests
    • Shows: tested provider identifiers and router-style model names are accepted while unsupported or ambiguous configuration returns an error instead of a misleading fallback.

Evidence Limits

  • These receipts do not prove a live provider call, search quality, authentication, price, quota, regional access, or result provenance. Verify those conditions in the provider and account you actually run.
  • Watch for provider-specific integration tests and release notes that clarify how tool citations, model support, and routing failures appear to operators.
Letters & Corrections

Send a note to the desk

Corrections, missing context, or a follow-up lead.