Skip to main content
Glama

rect

Get an element's bounding box coordinates to define screenshot clip regions using a snapshot ref or CSS selector.

Instructions

Bounding box of an element (for screenshot clip).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "rect"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoref from snapshot, e.g. e3
tabNotab id, defaults to current
selectorNoCSS selector
request_timeoutNoOuter page request deadline in milliseconds; defaults to at least 30000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations at all, so the description carries the full burden: it never states that this is a read-only lookup, what happens when the element is missing, which of ref/tab/selector wins if multiple are supplied, or what the returned box looks like. Only the timeout parameter's schema hints at page-load behavior.

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?

A single short sentence that front-loads the result and appends the purpose. It is efficient, though as a noun-phrase fragment it omits an explicit verb and reads more like a return-type note than an instruction.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description should describe the returned geometry and failure modes; it does neither. An agent knows roughly what it gets but not its shape or error behavior, which matters when feeding the result into a screenshot clip.

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 each of the four parameters is already documented (ref example, tab default, selector, timeout default). The description adds no meaning beyond that baseline, in particular no precedence rule among ref/tab/selector.

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?

States a specific resource and result — the bounding box of an element — and the parenthetical clarifies the intended consumer (screenshot clip). It is distinguishable from siblings like screenshot or snapshot, though it never names them or says what a 'bounding box' contains.

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 phrase 'for screenshot clip' implies the intended workflow but gives no explicit when-to-use or when-not guidance, nor does it say to obtain a ref via snapshot first (only the schema hints at that). An agent must infer the sequence rect -> screenshot itself.

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