src/tool
The web_search and web_fetch Mastra tools.
web_search is backed by the Databricks Model Serving native web-search
tool: it resolves its own web-search-capable model (see search.ts) and
calls the workspace serving endpoint under the caller’s OBO scope, so the
search runs as the requesting user and independently of the agent’s chat
model. web_fetch reads a page via got-scraping.
Both are read-only and run without approval by default; each accepts an
optional ApprovalGate (approval) that maps onto Mastra’s
requireApproval. true gates every call; a URL-pattern (or OneOrMany
list) gates only calls whose URL matches - for web_fetch that is evaluated
against the target URL, while web_search (whose result URLs aren’t known
before the call) treats a pattern gate as “always gate”. approval falls
back to the standalone runtime’s approval config when a tool omits its own.
App-integrated agents should consume the plugin’s native toolkit so calls retain that plugin’s policy and executor. These factories are the standalone Mastra surface and capture an explicit runtime or isolated config.