Skip to main content
Glama

cut_out

Cuts a real hole in a committed floor area via boolean subtraction, updating net quantities and deductions. Clips open surface or linear runs to the surviving stretch when a ring overlaps.

Instructions

Cut a REAL hole in a committed floor_area shape (#206) — the way the canvas cuts one (#137): the same lib/cutout.js boolean subtract, so the two surfaces can never disagree about what a hole holds. The parent keeps its outer ring plus the reconciled hole(s) (verts_norm_holes), its computed nets for real — N cuts compose, overlap between cuts never double-deducts (set subtraction), a hole ADDS perimeter — and the deduct commits carrying cuts_shape_id so the report and legend read the reconciled number, never a second arithmetic pass. This is the verb for a column, a floor drain, an island of casework INSIDE a room; an independent measure_polygon role:"deduct" stays the tool for a deduction that isn't a hole in one parent. Refusal over guessing: the ring must sit FULLY inside the parent's outer ring (an edge-crossing cut is a boundary correction — edit_shape the parent instead), and a cut that would erase the parent or split it in two refuses whole (trace the pieces as rooms). One journal entry — undo_last restores parent and hole together; delete_shape on the deduct later reverts the cut too (a multi-cut parent rebuilds from the chain's pristine snapshot minus the survivors). AN OPEN RUN IS CLIPPED, NOT SUBTRACTED: wall tile (surface_area) and base/transitions (linear) are polylines traced in plan, so the ring removes the stretch it covers, the run keeps its id and takes what survives, and a cut through the MIDDLE leaves the far side as its own shape (same condition, same height) — quantities ride the surviving length, which is exact, since wall SF is LF × height and a border's SF is LF × thickness. No deduct is minted for a run: there is no area for one to sit on, and a deduct's SF counts against the FLOOR total a run never fills. A ring that misses the run, one that swallows it whole (delete_shape it), and a curved run (its verts are control points) all refuse. A derived base with numeric openings also refuses: those deductions have no stored location; use measure_line for installed runs so a geometric cut cannot erase the numeric allowance. 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

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "parent_shape_id": "<parent_shape_id>",
      "verts": "<verts>"
    },
    "name": "cut_out"
  }
}

Input Schema

NameRequiredDescriptionDefault
vertsYesThe ring, image px — fully inside the parent for an area; over the stretch to remove for a run
parent_shape_idYesA committed floor_area shape id, or an open run (surface_area / linear) to clip (list_shapes)

Output Schema

NameRequiredDescriptionDefault
noteYes
holesNoArea parent: holes the parent now carries
piecesNoRun parent: every stretch that survived the cut — more than one when the ring fell in the middle
hole_sfNoArea parent: what this cut actually removed from the parent's net — 0 when the ring fell entirely inside an existing hole
shape_idNoRun parent: the run that was clipped — it keeps its id and takes the first surviving stretch
parent_netNo
removed_lfNoRun parent: length the cut took out
removed_sfNoRun parent: the SF that rode on that length
measure_roleNoRun parent: surface_area or linear
deduct_shape_idNoArea parent: the reconciled deduct — carries cuts_shape_id; totals skip it (the parent nets the hole)
parent_shape_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.31
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / verts / items / additionalItems
      Added value: +false
    • addedOutput schema / properties / holes / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / holes / minimum
      Added value: +-9007199254740991
  2. Changed11 schema fields changedv0.1.19
    • changedInput schema / properties / parent_shape_id / description
      Previous value: -"A committed floor_area shape id (list_shapes)"New value: +"A committed floor_area shape id, or an open run (surface_area / linear) to clip (list_shapes)"
    • changedInput schema / properties / verts / description
      Previous value: -"The hole's ring, image px, fully inside the parent"New value: +"The ring, image px — fully inside the parent for an area; over the stretch to remove for a run"
    • changedOutput schema / properties / deduct_shape_id / description
      Previous value: -"The reconciled deduct — carries cuts_shape_id; totals skip it (the parent nets the hole)"New value: +"Area parent: the reconciled deduct — carries cuts_shape_id; totals skip it (the parent nets the hole)"
    • changedOutput schema / properties / hole_sf / description
      Previous value: -"What this cut actually removed from the parent's net — 0 when the ring fell entirely inside an existing hole"New value: +"Area parent: what this cut actually removed from the parent's net — 0 when the ring fell entirely inside an existing hole"
    • changedOutput schema / properties / holes / description
      Previous value: -"Holes the parent now carries"New value: +"Area parent: holes the parent now carries"
    • addedOutput schema / properties / measure_role
      Added value: +{
      +  "description": "Run parent: surface_area or linear",
      +  "type": "string"
      +}
    • addedOutput schema / properties / pieces
      Added value: +{
      +  "description": "Run parent: every stretch that survived the cut — more than one when the ring fell in the middle",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "lf": {
      +        "description": "This piece's own length",
      +        "type": "number"
      +      },
      +      "sf": {
      +        "description": "LF × the height (wall) or the thickness (border) it was measured at",
      +        "type": "number"
      +      },
      +      "shape_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "shape_id",
      +      "lf",
      +      "sf"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / removed_lf
      Added value: +{
      +  "description": "Run parent: length the cut took out",
      +  "type": "number"
      +}
    • addedOutput schema / properties / removed_sf
      Added value: +{
      +  "description": "Run parent: the SF that rode on that length",
      +  "type": "number"
      +}
    • addedOutput schema / properties / shape_id
      Added value: +{
      +  "description": "Run parent: the run that was clipped — it keeps its id and takes the first surviving stretch",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "deduct_shape_id",
      -  "parent_shape_id",
      -  "hole_sf",
      -  "parent_net",
      -  "holes",
      -  "note"
      -]New value: +[
      +  "note"
      +]
  3. Addedv0.1.15

TDQS

A4.4/5.0
Behavior3/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 far more than most: it discloses the shared lib/cutout.js subtract implementation, idempotent set-subtraction composition so N cuts never double-deduct, that a hole ADDS perimeter, that deducts commit with cuts_shape_id, and that one journal entry makes undo_last/delete_shape restore parent and hole together. It also documents the refusal surface (non-contained ring, erase-or-split, ring missing or swallowing a run, curved run, derived base with numeric openings) and the clipping semantics for polyline runs. This is well above baseline disclosure for a mutate tool with zero annotation coverage.

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 core purpose is front-loaded and the dense prose is largely load-bearing, with each clause covering a distinct case (area cut, run clip, refusal, coordinate space). It is a long, unbroken block with no paragraph breaks or structure, which makes it harder to scan, so it falls 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?

Output schema exists, so return values need not be explained, and the description covers everything else an agent needs: preconditions, refusal cases, side effects on the journal and deduct chain, clipping behavior for open runs, and the coordinate system for constructing the ring. For a tool with this complexity and no annotations, nothing material is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: it explains that a ring removing an existing hole in a non-minted list is a different tool, and it pins down the coordinate contract for verts (image px at render scale 2.0, PDF pt × 2, origin top-left, y down). That coordinate note is materially useful for constructing the verts array and is not in the 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?

"Cut a REAL hole in a committed floor_area shape" gives a specific verb plus resource, and the description immediately differentiates the operation from siblings by naming measure_polygon role:"deduct" as the tool for deductions that aren't holes in a parent. An agent can identify the operation and its scope without reading 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?

Explicit when-to-use cases are enumerated (a column, a floor drain, an island of casework INSIDE a room) alongside named alternatives with the condition that selects them: edit_shape for an edge-crossing boundary correction, measure_polygon for an independent deduction, measure_line for installed runs with numeric openings, delete_shape for a ring swallowing a run whole. Nothing is left to inference.

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