Skip to main content
Glama
Himangguo
by Himangguo

get_ancestors

Trace the full ancestor chain of a CSS element with style properties like overflow, position, and transform to diagnose sticky, overflow, and z-index stacking bugs.

Instructions

获取元素的完整祖先链,每个祖先节点包含指定样式属性值。专为 sticky/overflow/z-index 层叠问题根因定位设计。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxDepthNo最多追溯几层祖先,默认 20,最大 20
selectorYesCSS 选择器,定位目标元素
stylePropertiesNo要在每个祖先节点查询的样式属性,默认 ["overflow","position","transform","will-change","contain"]
Behavior3/5

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

No annotations are provided, so the description carries the burden of behavioral disclosure. It states the operation is to '获取' (get) the ancestor chain, implying a read-only action, and mentions that each node contains specified style property values. However, it does not clarify whether these are computed styles or inline styles, nor does it mention behavior around max depth or error cases. The purpose is clear, but transparency is limited.

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?

The description is only two sentences, front-loaded with the tool's primary purpose and then a second sentence stating its intended use case. There is no redundant or filler content; every word contributes to understanding the tool's function and rationale.

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?

For a read-only get tool with no output schema, the description adequately covers the key aspects: what it does, what data it returns (ancestor chain with style property values), and its intended use case. It does not detail the exact return structure or potential edge cases, but these are not necessary for a simple query tool. The contextual information provided is sufficient for an agent to invoke it appropriately.

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?

The input schema already describes all three parameters with 100% coverage, making the schema self-sufficient. The description adds context about the use of styleProperties (each ancestor includes specified style property values) but does not elaborate on selector or maxDepth beyond what the schema provides. With full schema coverage, the baseline score of 3 is appropriate.

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?

The description uses the specific verb '获取' (get) with a clear resource: the complete ancestor chain of an element, including style property values. It also explicitly states the tool's specialized use case for diagnosing sticky/overflow/z-index stacking issues, which distinguishes it from siblings like get_computed_styles or get_dom_tree.

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?

The description provides clear when-to-use guidance by indicating the tool is '专为 sticky/overflow/z-index 层叠问题根因定位设计' (specifically designed for locating root causes of sticky/overflow/z-index stacking issues). However, it does not explicitly mention when not to use it or name alternative tools, leaving some gap in guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Himangguo/chrome-devtools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server