Skip to main content
Glama

measure_spacing

Read-onlyIdempotent

Measure the gap, overlap, and distance in CSS pixels between two elements, including margins and paddings. Provides read-only values from the current layout for accurate spacing analysis.

Instructions

Measure the gap, overlap and distance in CSS pixels between two elements, with their margins and paddings. Read-only. Values come from the current layout, so zoom and viewport size change them: set_zoom(1) and a fixed viewport_resize make results comparable across runs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
selector1YesFirst element; distances are measured from its box
selector2YesSecond element; ">>>" pierces shadow DOM
Behavior5/5

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

Describes dependency on zoom and viewport, advising use of set_zoom(1) and fixed viewport_resize for consistency. Adds behavioral context beyond readOnlyHint and idempotentHint annotations.

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?

Two sentences with no wasted words. Front-loaded with purpose, followed by behavioral context. Efficient and well-structured.

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?

Covers purpose, parameters implicitly, and behavioral context. Missing output description (no output schema), but otherwise sufficiently complete for a measurement tool.

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 descriptions already cover parameters (100% coverage). Description adds minor detail about shadow DOM piercing for selector2, but does not significantly enhance meaning beyond schema.

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?

Clearly specifies the verb 'measure' and the resource 'gap, overlap and distance in CSS pixels between two elements'. Distinguishes from sibling tools like query_dom.

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?

Implies use for layout measurement but lacks explicit guidance on when to use vs alternatives or when not to use. Suggests using set_zoom and viewport_resize for comparability.

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/frsorrentino/chrome-bridge'

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