Skip to main content
Glama

get_sheet_vectors

Return a sheet's raw vector strokes as flat point arrays with per-segment flags, luminance, and layer index so you can build your own geometry.

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.

Input Schema

TableJSON 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

TableJSON 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. Addedv0.1.21

TDQS

A4.7/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 thoroughly: paging semantics (default 20000, ceiling 100000, ledger offset + returned + dropped === total, dropped recoverable via next_cursor), region intersection behavior with post-clamp echo and alignment to sheet_context's total_in_region, read-only and stateless operation, and refusal behavior for scans. It also specifies coordinate space and origin.

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 first sentence is front-loaded and clear, but the rest is a single massive paragraph dense with technical detail. While most sentences are informative, some repetition (e.g., 'undecimated') and lack of bullet-point structure reduce economy. It is adequate but could be more scannable for an agent.

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?

Given the tool's complexity, the absence of annotations, and the presence of an output schema, the description is complete enough for an agent to call the tool correctly. It covers paging, region filtering, refusal cases, coordinate system, and output structure, leaving no critical gap for correct invocation.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema for the region parameter by explaining the exact keep test (intersects rect, endpoints untouched) and that total equals sheet_context's total_in_region, and clarifies the paging contract for limit/cursor. It does not add much for the sheet parameter, but the added region semantics lift it above baseline.

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: returns the sheet's raw vector stroke layer exactly as the engine sees it, and explicitly distinguishes itself from view_sheet, read_sheet_text, sheet_context, and shape verbs by naming what each does instead. The agent can identify this tool's unique output 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?

Explicitly names the sibling alternatives and their roles (view_sheet looks, read_sheet_text reads, sheet_context classifies a region) and states the use case: to run your own geometry against the app's raw extractor output. It also provides a when-not case: a scan has no strokes and the verb refuses, naming view_sheet as the path.

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