Skip to main content
Glama

get_sheet_vectors

Retrieve a sheet's raw vector strokes—points, pen weights, luminance, and layer ids—so you can run custom room, symbol, or wall analysis against the same geometry the app uses.

Instructions

The STROKES — the sheet's vector layer exactly as the engine is fed it, so you can run your own geometry against what the app sees (#367). view_sheet lets you look, read_sheet_text lets you read, sheet_context classifies a region; this returns the raw extractor output that all of them and every shape verb (the wall network's pen weights, symbol_sweep's matching) work from: flat points [x1, y1, x2, y2, …] in image px, one meta byte per segment (low nibble flags: 1 curve chord, 2 clip-only, 4 fill-only, 8 polyline arc; pen width = meta >> 4), per-segment stroke luminance, the drawn figure each segment belongs to (subpath ordinal), the sheet's placed-image area, and its PDF layer table with a per-segment layer index (sheet_info.layers names and classifies the same ids). Nothing is classified, decimated, or merged here — segments arrive whole, in extraction order, undecimated, which is the point: a reader can build its own room finder, symbol matcher, or wall classifier on the same array and commit through the existing verbs with provenance intact. Paged, never clipped silently: a dense sheet runs to hundreds of thousands of segments, so the reply carries limit (default 20000 segments, ceiling 100000) and the ledger offset + returned + dropped === total on every page; dropped is exactly what passing next_cursor as cursor recovers. region keeps every segment that intersects the rect (endpoints untouched — the same keep test sheet_context uses, so total here equals sheet_context's total_in_region) and echoes it post-clamp. Read-only and stateless — no shape, condition, or scale is touched. A scan has no strokes: the verb refuses and names view_sheet as the path. 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": {
      "sheet": "<sheet>"
    },
    "name": "get_sheet_vectors"
  }
}

Input Schema

NameRequiredDescriptionDefault
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")
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

Output Schema

NameRequiredDescriptionDefault
lumYesAligned 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
metaYesOne 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
noteNoPresent when the sheet is a scan wrapper — the few segments here are a frame, not the drawing
pageYes
limitYesThe page size that applied
sheetYes
totalYesSegments on the sheet intersecting the region — the whole set, before paging
offsetYesMatching segments BEFORE this page (skipped by cursor)
pointsYesFlat [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
regionYesThe 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
droppedYesMatching 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
subpathYesAligned 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
layer_ofYesAligned with points: index into layer_ids, or −1 for a segment outside every layer. Empty only when the geometry carries no layer channel
returnedYesSegments in this reply
sheet_pxYes
layer_idsYesThe 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
image_areaYesTotal 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
next_cursorNoPass as cursor to fetch the next page; absent when dropped is 0

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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
  2. Addedv0.1.21

TDQS

A4.7/5.0
Behavior5/5

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

No annotations exist, so the description carries the full load and does so richly: read-only and stateless, no shape/condition/scale touched, paging is never silently clipped, the ledger invariant offset+returned+dropped===total, and dropped is exactly what re-passing next_cursor recovers. The region keep-test is tied to sheet_context's identical test, and the coordinate space (image px at render scale 2.0, PDF pt × 2, top-left origin, y down) is spelled out.

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?

Nearly every clause carries real information, but it is delivered as a single dense paragraph of long run-on sentences with stacked parentheticals. It is front-loaded correctly, yet an agent must parse nested asides to extract the paging invariant and the refusal behavior.

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 enumerates the return shape (flat points, meta byte nibble flags, pen width = meta >> 4, per-segment luminance, subpath ordinal, placed-image area, PDF layer table). For a high-volume, unclassified extractor call, nothing an agent needs in order to call it correctly 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; the description goes further by restating the default/ceiling in context of payload size (~1 MB per 20000), explaining cursor as a next_cursor from a prior reply, and defining region semantics as an intersection keep-test with endpoints untouched plus post-clamp echo. It stops short of adding anything the schema lacks for limit bounds, so not a 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?

Opens with a specific verb+resource: returns the sheet's raw vector stroke layer as the engine sees it. It explicitly positions itself against three siblings (view_sheet looks, read_sheet_text reads, sheet_context classifies) and against downstream shape verbs, so an agent can pick it without opening a 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?

States the use case precisely (run your own geometry against the same array the app uses) and names the alternatives with their distinct roles. It also gives a when-not: a scanned sheet has no strokes, so the verb refuses and redirects to view_sheet.

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