Skip to main content
Glama

scope_duplicates

Detect overlapping floor-area shapes on a sheet to catch duplicate or double-counted claims before takeoff totals, with shared SF and a view region to inspect.

Instructions

Two conditions claiming the same floor, as a list (#366). Every pair of committed floor_area shapes on one sheet whose EXACT polygon intersection exceeds min_fraction of the smaller shape — with the shared SF, which condition each belongs to, whether the estimator already affirmed either, and a look region to pass to view_sheet {overlay: true}. Pairs on DIFFERENT conditions are collisions: every total downstream counts that floor twice. Pairs on the SAME condition are a double trace (a different bug) and come back in duplicates. shared_floor_sf is the whole compared set's Σ areas − union, counted once per cell no matter how many shapes pile on it — the number takeoff_summary carries and the one that has to read 0 before any total means anything. Machine-precision edge remnants are ignored; a real overlap below 0.01 SF stays listed with an explanatory note. Supporting materials belong in edit_materials coverage rows, not duplicate floor polygons. Deducts and runs are not claims. Read-only; a shape on an unscaled sheet or with a degenerate ring is listed in unmeasured, never counted as zero. Same rule as the room eval's shared-floor gate (iou ≥ 0.5 = the same space claimed twice). Coordinates are image px at render scale 2.0: PDF pt × 2, origin top-left, y down (the browser canvas's native space). Sheet payloads carry dims in both px and pt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheetNoRestrict to one sheet; default every sheet with floor shapes
min_fractionNoList a pair only when shared ÷ smaller ≥ this (default 0.05 — rings that merely kiss along a wall are not claims; 0 lists every positive overlap above machine-precision noise)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteYes
by_sheetYes
collisionsYesPairs on DIFFERENT conditions, biggest shared floor first
duplicatesYesPairs on the SAME condition — a double trace, a different bug
unmeasuredYesShapes left out of every number, with the reason — never silently counted as zero
floor_shapesYes
min_fractionYes
shared_floor_sfYesΣ areas − union over the compared floor shapes, counted once per cell

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.21

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares read-only behavior, describes the returned fields (shared SF, condition membership, estimator affirmation, look region for view_sheet), and discloses edge-case handling — machine-precision remnants ignored, real overlaps below 0.01 SF retained with a note, unscaled/degenerate shapes routed to 'unmeasured' and never counted as zero. That is unusually rich behavioral disclosure for a query tool.

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 purpose is front-loaded in the first sentence, and nearly every following sentence carries load (collision vs double-trace semantics, shared_floor_sf definition, edge cases, coordinate space). It is dense and jargon-heavy for a two-parameter read-only tool, running long as a single block, which keeps it short of a 5.

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

Completeness5/5

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

An output schema exists, yet the description still supplies the semantic glue an agent needs — what a pair means downstream, which field must read 0 before totals count, and how anomalies are surfaced. It also cross-references the room eval gate and view_sheet handoff, leaving no ambiguity about correct invocation or interpretation.

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 both parameters are already fully documented in the schema (including min_fraction's default and the 0-case). The prose adds conceptual framing (shared ÷ smaller, the shared_floor_sf definition, coordinate space) but no syntax or format detail beyond what the schema provides, so the baseline 3 applies.

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 opening clause names a specific resource and output ('Two conditions claiming the same floor, as a list') and immediately scopes it to committed floor_area shapes whose exact polygon intersection exceeds min_fraction. It explicitly separates itself from neighboring tools by referencing view_sheet, edit_materials, and takeoff_summary, so an agent can tell what this tool is and is not without opening any schema.

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

Usage Guidelines5/5

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

It states when the tool applies (committed floor_area shapes, overlaps above min_fraction), how to interpret results (different conditions = collision/double-count; same condition = double trace/different bug), and where things should go instead ('Supporting materials belong in edit_materials coverage rows, not duplicate floor polygons'). Exclusions are explicit: deducts and runs are not claims.

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