Skip to main content
Glama

scope_duplicates

Detect floor-area shapes on a sheet whose overlapping polygons double-count square footage, distinguishing cross-condition collisions from same-condition double traces before totals are used.

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.

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": "scope_duplicates"
  }
}

Input 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

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. Changed13 schema fields changedv0.1.31
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / collisions / items / properties / b / $ref
      Removed value: -"#/properties/collisions/items/properties/a"
    • addedOutput schema / properties / collisions / items / properties / b / additionalProperties
      Added value: +false
    • addedOutput schema / properties / collisions / items / properties / b / properties
      Added value: +{
      +  "area_sf": {
      +    "type": "number"
      +  },
      +  "condition": {
      +    "type": "string"
      +  },
      +  "condition_id": {
      +    "type": "string"
      +  },
      +  "label": {
      +    "type": "string"
      +  },
      +  "reviewed": {
      +    "description": "true = the estimator affirmed this shape — ink; scope_merge never trims or deletes it",
      +    "type": "boolean"
      +  },
      +  "shape_id": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / collisions / items / properties / b / required
      Added value: +[
      +  "shape_id",
      +  "condition_id",
      +  "condition",
      +  "area_sf",
      +  "reviewed"
      +]
    • addedOutput schema / properties / collisions / items / properties / b / type
      Added value: +"object"
    • removedOutput schema / properties / duplicates / items / $ref
      Removed value: -"#/properties/collisions/items"
    • addedOutput schema / properties / duplicates / items / additionalProperties
      Added value: +false
    • addedOutput schema / properties / duplicates / items / properties
      Added value: +{
      +  "a": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "area_sf": {
      +        "type": "number"
      +      },
      +      "condition": {
      +        "type": "string"
      +      },
      +      "condition_id": {
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      },
      +      "reviewed": {
      +        "description": "true = the estimator affirmed this shape — ink; scope_merge never trims or deletes it",
      +        "type": "boolean"
      +      },
      +      "shape_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "shape_id",
      +      "condition_id",
      +      "condition",
      +      "area_sf",
      +      "reviewed"
      +    ],
      +    "type": "object"
      +  },
      +  "b": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "area_sf": {
      +        "type": "number"
      +      },
      +      "condition": {
      +        "type": "string"
      +      },
      +      "condition_id": {
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      },
      +      "reviewed": {
      +        "description": "true = the estimator affirmed this shape — ink; scope_merge never trims or deletes it",
      +        "type": "boolean"
      +      },
      +      "shape_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "shape_id",
      +      "condition_id",
      +      "condition",
      +      "area_sf",
      +      "reviewed"
      +    ],
      +    "type": "object"
      +  },
      +  "fraction_of_smaller": {
      +    "description": "shared ÷ the smaller shape's area (1 = the smaller sits entirely inside the other)",
      +    "type": "number"
      +  },
      +  "iou": {
      +    "description": "Symmetric intersection-over-union — ≥ 0.5 is the room eval's own 'same space claimed twice' bar",
      +    "type": "number"
      +  },
      +  "look": {
      +    "additionalProperties": false,
      +    "description": "Image-px region framing both shapes — pass to view_sheet {overlay: true}",
      +    "properties": {
      +      "x0": {
      +        "type": "number"
      +      },
      +      "x1": {
      +        "type": "number"
      +      },
      +      "y0": {
      +        "type": "number"
      +      },
      +      "y1": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "x0",
      +      "y0",
      +      "x1",
      +      "y1"
      +    ],
      +    "type": "object"
      +  },
      +  "note": {
      +    "description": "Explains a positive overlap whose SF rounds to zero",
      +    "type": "string"
      +  },
      +  "same_condition": {
      +    "description": "true = a double trace on ONE condition (its own list), false = two conditions claiming one floor",
      +    "type": "boolean"
      +  },
      +  "shared_sf": {
      +    "description": "Polygon intersection through the sheet's scale, rounded to two decimals",
      +    "type": "number"
      +  },
      +  "sheet_id": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / duplicates / items / required
      Added value: +[
      +  "sheet_id",
      +  "a",
      +  "b",
      +  "shared_sf",
      +  "fraction_of_smaller",
      +  "iou",
      +  "same_condition",
      +  "look"
      +]
    • addedOutput schema / properties / duplicates / items / type
      Added value: +"object"
    • addedOutput schema / properties / floor_shapes / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / floor_shapes / minimum
      Added value: +-9007199254740991
  2. Addedv0.1.21

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the load and does much of it: declares read-only, states machine-precision edge remnants are ignored, that sub-0.01 SF overlaps stay listed with a note, that degenerate/unscaled shapes land in unmeasured rather than as zero, and pins the coordinate space (image px at render scale 2.0). It does not disclose result ordering, pagination, or behavior on very large pair sets, which are the remaining gaps for a no-annotation tool.

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

Conciseness3/5

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

The purpose is front-loaded and every sentence is on-topic, but it is a single dense paragraph interleaving an issue reference (#366), the iou-gate analogy, coordinate-system notes, and materials guidance. Several asides (e.g., 'the browser canvas's native space', the room-eval comparison) could be cut or moved without losing actionable meaning.

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 complex, jargon-heavy analysis tool with zero annotations and an output schema, the description covers purpose, exclusions, edge cases, and coordinate conventions well. It redundantly explains return contents that the output schema already provides, and omits explicit sibling routing, but an agent can call it correctly from this text alone.

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 documented. The description adds conceptual color ("rings that merely kiss along a wall are not claims", EXACT intersection) but largely restates the min_fraction semantics already in the schema and adds nothing new for the undocumented sheet parameter beyond what the schema gives. Baseline 3 is appropriate.

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?

Opens with a specific verb+resource framing ("Two conditions claiming the same floor, as a list") and precisely defines the predicate: committed floor_area shape pairs on one sheet whose exact polygon intersection exceeds min_fraction of the smaller shape. It also disambiguates two distinct outcomes (different-condition collisions vs same-condition double traces). It never names or contrasts sibling tools like scope_merge, so an agent must infer when to reach for it over related scoping tools.

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?

Gives explicit when-to-use guidance — read shared_floor_sf and confirm it is 0 before any total means anything — plus clear exclusions: supporting materials belong in edit_materials coverage rows, and deducts and runs are not claims. It stops short of explicitly naming a sibling alternative to use instead, so routing is implied rather than stated.

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