FetchWebpageTool
Fetches a URL with OkHttp (15s connect/read timeouts) and extracts readable body text via Jsoup, stripping script/style/noscript/nav/footer/header before extraction. Reaches the network (openWorldHint); requires INTERNET (always-granted). A malformed URL returns an "Invalid URL" error; non-2xx status, empty body, or any other failure returns a ToolResult.error. The response body is capped at 5 MB while reading (see readBounded) regardless of max_length.
No URL scheme/host restriction: this can fetch http:// targets on the phone's own LAN (including localhost) same as any browser would. Whoever holds the bearer token can direct the phone to probe its local network through this tool — consistent with this SDK's general trust model (the host app / token holder is the trust boundary), but worth knowing before exposing the HTTP transport beyond a trusted network.
Output map: title (String), url (echoed), content (text truncated to max_length), content_length (Int — full untruncated length).