Skip to main content
Glama

Connect Webview

webview_connect
Destructive

Connects to an app's in-app WebView via adb forwarding, returning the current page URL, title, and route. Call this before accessing WebView DOM.

Instructions

连接/重连目标 App 的 in-app 系统 WebView(自动 adb forward),返回当前页 url/title/路由。读 webview DOM 前必须先调它。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo本地转发端口,默认 9222
deviceYes目标设备 serial(同 mobile_list_available_devices 的 id)
packageNameYesApp 包名(其 webview 被调试),如 cn.csxs.xiaoshuo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

注释已提供 destructiveHint=true,描述未与之矛盾,且添加了自动 adb forward 和返回值细节,但未说明具体副作用(如是否重连会中断现有会话)。由于注释已覆盖破坏性,描述未充分补充行为上下文,评分3。

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

描述仅一句话,却包含连接/重连、自动 adb forward、返回值及前置条件,无冗余信息,且关键信息前置,结构高效。

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

无输出 schema,但描述已说明返回 url/title/路由,提供了必要返回值概要。虽未提及连接后的状态或更多细节,但对于简单工具已基本完整,评分4。

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema 描述覆盖率为100%,所有参数(port、device、packageName)在 schema 中已有说明,描述本身未额外提供参数语义,按规则基线为3。

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

描述明确指出动词'连接/重连'、资源'目标 App 的 in-app 系统 WebView',并返回 url/title/路由,同时强调是读取 DOM 的前置步骤,与 webview_* 系列兄弟工具(如 evaluate、click)区分明显,目的非常清晰。

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

描述明确给出使用时机:读取 webview DOM 前必须先调用,提供了清晰的上下文。但未提及何时不应使用或替代方案,不过对于此类前置连接工具,已足够。

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.