Skip to main content
Glama

get_sheet_vectors

Read-onlyIdempotent

Extracts a tight crop's vector linework from a plan PDF as normalized segments and merged runs, so you can build accurate takeoff polygons on real wall geometry instead of guessing from an image.

Instructions

READ THE LINES — the PDF's own vector linework for a WINDOW of a sheet, as data. This is how you draw a takeoff polygon on real geometry instead of guessing from a picture: coordinates come back in the SAME 0..1 normalized frame verts_norm uses (rotation already applied), so a wall endpoint is a polygon vertex VERBATIM — copy the number, never convert it. Collinear segments are merged into straight runs, each with its length in feet (calibrated sheets), so you can sanity-check a wall before building on it. crop IS REQUIRED and must be tight — one room, not one sheet; a dense page truncates and this tool then REFUSES rather than hand you a partial picture of the walls (halve the crop and re-call). min_width_pt filters to structural linework: walls run ~0.5-1.0 pt, equipment and hatch are ~0.24 pt hairlines — pass 0.5 first. Scanned sheets have no vector layer and come back empty — that is not an error, it means look with get_sheet_image instead. Also takes the open-source OpenTakeoff server's arguments (sheet, region, limit, cursor): sheet keys or numbers, image px at render scale 2, finish tags.

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": {
      "sheet": "<sheet>"
    },
    "name": "get_sheet_vectors"
  }
}

Input Schema

NameRequiredDescriptionDefault
cropNonormalized page-fraction crop rect (origin top-left, y down); omit for the full page
limitNoPage size in segments (default 20000, max 100000) — about 1 MB of JSON per 20000
sheetYesSheet key ("plan.pdf", "plan.pdf#2") or title-block number ("A-101"). A sheet key ("plan.pdf#2") or sheet number ("A-101"); sheet_id is accepted in its place.
cursorNoA previous reply's next_cursor — resume paging there. Omit for the first page
regionNoRect in image px (origin top-left, y down); omit for the full sheet. A segment is kept when it intersects the rect
max_runsNocap on reported runs (default 240) — tighten the crop instead of raising this
sheet_idNosheet key "file.pdf#page" (same as sheet; give one)
min_len_ftNodrop runs shorter than this in feet (default 1.0) — hatch ticks and fixture detail
project_idNoThe project to work on (list_projects names them). Optional for the open-source arguments: the project the last call named (load_plan makes one) is used.
min_width_ptNodrop strokes thinner than this (points). 0.5 keeps walls, drops hairline equipment/hatch. Default 0 = everything.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv1.0.23
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / crop
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "normalized page-fraction crop rect (origin top-left, y down); omit for the full page",
      +  "properties": {
      +    "x0": {
      +      "maximum": 1,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "x1": {
      +      "maximum": 1,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "y0": {
      +      "maximum": 1,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "y1": {
      +      "maximum": 1,
      +      "minimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "x0",
      +    "y0",
      +    "x1",
      +    "y1"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / max_runs
      Added value: +{
      +  "description": "cap on reported runs (default 240) — tighten the crop instead of raising this",
      +  "maximum": 600,
      +  "minimum": 20,
      +  "type": "integer"
      +}
    • addedInput schema / properties / min_len_ft
      Added value: +{
      +  "description": "drop runs shorter than this in feet (default 1.0) — hatch ticks and fixture detail",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / min_width_pt
      Added value: +{
      +  "description": "drop strokes thinner than this (points). 0.5 keeps walls, drops hairline equipment/hatch. Default 0 = everything.",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / project_id
      Added value: +{
      +  "description": "The project to work on (list_projects names them). Optional for the open-source arguments: the project the last call named (load_plan makes one) is used.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / sheet / description
      Previous value: -"Sheet key (\"plan.pdf\", \"plan.pdf#2\") or title-block number (\"A-101\")"New value: +"Sheet key (\"plan.pdf\", \"plan.pdf#2\") or title-block number (\"A-101\"). A sheet key (\"plan.pdf#2\") or sheet number (\"A-101\"); sheet_id is accepted in its place."
    • addedInput schema / properties / sheet_id
      Added value: +{
      +  "description": "sheet key \"file.pdf#page\" (same as sheet; give one)",
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "dropped": {
      -      "description": "Matching segments AFTER this page that limit cut — exactly what next_cursor recovers. offset + returned + dropped === total on every reply; 0 means this page ends the set",
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    },
      -    "image_area": {
      -      "description": "Total placed-image area on the sheet, image px² — a value near the sheet area means a scan or photo underlay sits under whatever linework there is",
      -      "type": "number"
      -    },
      -    "layer_ids": {
      -      "description": "The sheet's PDF Optional Content Group ids in first-seen order — the same ids sheet_info.layers reports (with names and roles); [] on an unlayered sheet",
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "layer_of": {
      -      "description": "Aligned with points: index into layer_ids, or −1 for a segment outside every layer. Empty only when the geometry carries no layer channel",
      -      "items": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "type": "array"
      -    },
      -    "limit": {
      -      "description": "The page size that applied",
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    },
      -    "lum": {
      -      "description": "Aligned with points: stroke luminance 0 (black) – 255 (white), Rec. 709 over the stroke colour in force when the path was built. Empty only when the geometry carries no luminance channel",
      -      "items": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "type": "array"
      -    },
      -    "meta": {
      -      "description": "One byte per segment, aligned with points: low nibble flags — 1 curve chord (bezier tessellation or detected polyline arc), 2 clip-only path (invisible ink), 4 filled-not-stroked, 8 polyline-arc provenance; high nibble (meta >> 4) = device pen width in px",
      -      "items": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "type": "array"
      -    },
      -    "next_cursor": {
      -      "description": "Pass as cursor to fetch the next page; absent when dropped is 0",
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    },
      -    "note": {
      -      "description": "Present when the sheet is a scan wrapper — the few segments here are a frame, not the drawing",
      -      "type": "string"
      -    },
      -    "offset": {
      -      "description": "Matching segments BEFORE this page (skipped by cursor)",
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    },
      -    "page": {
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    },
      -    "points": {
      -      "description": "Flat [x1, y1, x2, y2, …] — four numbers per segment, image px to 0.01, endpoints exactly as extracted (never clipped to the region, never merged); segments arrive in extraction order, the order the engine sees",
      -      "items": {
      -        "type": "number"
      -      },
      -      "type": "array"
      -    },
      -    "region": {
      -      "description": "The region actually resolved, post-clamp [x0, y0, x1, y1] image px — the same rect sheet_context and view_sheet take, so all three verbs answer in one frame",
      -      "items": {
      -        "type": "number"
      -      },
      -      "maxItems": 4,
      -      "minItems": 4,
      -      "type": "array"
      -    },
      -    "returned": {
      -      "description": "Segments in this reply",
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    },
      -    "sheet_px": {
      -      "items": {
      -        "type": "number"
      -      },
      -      "maxItems": 2,
      -      "minItems": 2,
      -      "type": "array"
      -    },
      -    "subpath": {
      -      "description": "Aligned with points: ordinal of the drawn FIGURE each segment belongs to (each moveTo starts one, each rectangle is one) — segments sharing a value are one path; −1 = outside every figure",
      -      "items": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "type": "array"
      -    },
      -    "total": {
      -      "description": "Segments on the sheet intersecting the region — the whole set, before paging",
      -      "maximum": 9007199254740991,
      -      "minimum": -9007199254740991,
      -      "type": "integer"
      -    }
      -  },
      -  "required": [
      -    "sheet",
      -    "page",
      -    "sheet_px",
      -    "region",
      -    "points",
      -    "meta",
      -    "lum",
      -    "subpath",
      -    "image_area",
      -    "layer_ids",
      -    "layer_of",
      -    "total",
      -    "offset",
      -    "returned",
      -    "dropped",
      -    "limit"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. Changed25 schema fields changedv0.1.31
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / cursor / maximum
      Added value: +9007199254740991
    • removedInput schema / properties / region / additionalProperties
      Removed value: -false
    • addedOutput schema / properties / dropped / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / dropped / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / layer_of / items / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / layer_of / items / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / limit / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / limit / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / lum / items / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / lum / items / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / meta / items / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / meta / items / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / next_cursor / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / next_cursor / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / offset / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / offset / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / page / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / page / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / returned / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / returned / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / subpath / items / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / subpath / items / minimum
      Added value: +-9007199254740991
    • addedOutput schema / properties / total / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / total / minimum
      Added value: +-9007199254740991
  3. Addedv0.1.21

TDQS

A4.7/5.0
Behavior5/5

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

Annotations establish safe read-only/idempotent behavior, and the description adds high-value behavior: normalized coordinates with rotation already applied, collinear runs with lengths in feet, truncation/refusal on dense pages, and empty results for scanned sheets. This is the kind of operational context annotations cannot supply.

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?

Front-loaded and dense with practical rules, and most sentences earn their place for a 10-parameter tool. The all-caps framing and closing 'finish tags' phrase are less clear, and a few points could be tightened, so it is strong but not flawless.

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?

Given 10 parameters, nested regions, and no output schema, the description covers the essential return shape (normalized vector runs with lengths), paging, empty scanned sheets, and alternatives. The remaining gap is the crop-required contradiction with the schema and some output-field detail, so it is nearly complete but not fully consistent.

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 schema already documents the parameters; the description nonetheless adds useful semantics such as the coordinate frame, tight-crop rule, and wall-vs-hairline min_width_pt guidance. However, calling crop 'REQUIRED' conflicts with the schema, where crop is optional and may be omitted for the full page, so it falls short of 5.

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?

States a specific verb and resource: reading a PDF sheet's vector linework for a window as data. It distinguishes itself from get_sheet_image for scanned sheets and frames the output as coordinates in the same 0..1 frame used by verts_norm, so an agent can identify the tool without opening the 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 guidance: draw takeoff polygons on real geometry, keep crop tight to one room, halve the crop and re-call if truncation causes refusal. It also names the alternative get_sheet_image for scanned sheets and recommends min_width_pt 0.5 first, leaving little inference.

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

Deploy Server

Other Tools