Skip to main content
Glama

Get Webview Computed Style

webview_get_computed_style
Read-only

Retrieve computed CSS styles and bounding box for any element in a mobile WebView using a CSS selector, enabling precise UI verification and layout debugging.

Instructions

取 webview 内某元素的 computed CSS + 包围盒(getComputedStyle)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
propsNoCSS 属性名数组,默认常用集
deviceYes目标设备 serial(同 mobile_list_available_devices 的 id)
selectorYesCSS 选择器

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds that it returns computed CSS and bounding box, which is useful. However, it doesn't disclose details like whether the bounding box is in CSS pixels or device pixels, whether the element must be visible, or what happens if the selector matches multiple elements. With annotations covering the safety profile, a 3 is appropriate.

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

Conciseness4/5

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

The description is a single concise sentence that front-loads the core purpose (get computed CSS + bounding box). It's efficient and doesn't waste words. It could add a bit more context about return format, but for its length it's well-structured.

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

Completeness3/5

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

For a read-only tool with full schema coverage and no output schema, the description is mostly adequate. It tells the agent what it does and what it returns. However, it doesn't mention the bounding box coordinate system, behavior with multiple matches, or whether the webview must be connected first. These are minor gaps for a simple read tool, but they prevent a higher score.

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 description coverage is 100%, so the schema already documents all three parameters. The description adds the default behavior for 'props' (默认常用集 = default common set), which is a small addition beyond the schema. However, it doesn't explain the format of the selector or how the bounding box is returned. Baseline 3 is correct when schema does the heavy lifting.

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

Purpose4/5

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

The description states a specific verb ('取' = get) and resource (computed CSS + bounding box of an element in a webview), which clearly distinguishes it from sibling webview tools like webview_dom_outline or webview_evaluate. However, it doesn't explicitly name a sibling alternative, so it doesn't fully earn a 5.

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

Usage Guidelines3/5

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

The description implies usage context: it's for reading computed styles and bounding boxes from a webview element. It doesn't explicitly state when to use this vs alternatives like webview_dom_outline or webview_evaluate, nor does it mention prerequisites like needing an active webview connection. The context is clear but exclusions/alternatives are not stated.

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