MCP tool reference
Every tool Scriber offers AI agents, as the server lists them (87 tools). Units are millimetres, y grows down, angles are degrees clockwise. Most tools also take an optional document (a document id from list_documents); without it they work on the active tab.
activate_document · add_annotation · add_constraint · add_dimensional_constraint · add_items · add_layer · align · array_polar · array_rectangular · auto_constrain · boolean · break_apart · break_item · chamfer · close_document · combine_items · delete_constraints · delete_items · delete_layer · delete_machine · delete_material · delete_material_setting · duplicate_items · explode · export_dxf · export_library · export_library_repository · export_png · export_svg · export_xs · extend · fillet · get_document · get_laser_setup · group · import_dxf · import_image · import_library · import_svg · import_xs · import_xtool_materials · import_xtool_project · join · lengthen · list_annotations · list_constraints · list_documents · list_fonts · list_layers · list_library_sources · list_machines · list_materials · list_recent_projects · match_properties · measure · new_document · offset · open · preflight_check · quick_select · redo · reply_annotation · resolve_annotation · restore_machine · save · save_machine · save_material · search_xtool_materials · select · select_similar · set_canvas · set_laser_setup · set_library_source · set_material_setting · set_notes · set_parameter · stretch · subscribe_library · sync_library_sources · transform_items · trim · undo · ungroup · unsubscribe_library · update_item · update_layer · wait_for_annotations
activate_document
Show a document to the person (make it the active tab). Only when they asked to see it: switching tabs changes what they are looking at.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | yes | The document's id (list_documents). |
add_annotation
Pin a comment on the canvas for the person (at a point, or on items). Not lasered or exported. Returns its id.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | yes | |
at | number[] | Where the pin goes (mm); default the centre of items. | |
items | integer[] | Item ids it is about. | |
author | string | Your name, shown on the comment (default "agent"). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
add_constraint
Add a geometric constraint (AutoCAD GEOMCONSTRAINT): coincident, collinear, concentric, fix, parallel, perpendicular, horizontal, vertical, tangent, smooth, symmetric or equal; or regular (one {kind: item} ref: a closed straight-sided shape keeps equal sides and corners, as polygons from add_items do). The geometry moves to satisfy it at once and stays bound from then on. Refused (with the conflicting constraints named) if it cannot be satisfied.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | Kind | yes | A geometric constraint (not dim_*). Two-object constraints keep the first object and move the second, as in AutoCAD. |
refs | Ref[] | yes | The geometry: e.g. [{"kind":"segment","item":3,"segment":0}, {"kind":"point","item":4,"vertex":1}]. Symmetric takes the two objects, then the symmetry line. |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
add_dimensional_constraint
Add a dimensional constraint (AutoCAD DIMCONSTRAINT): a named parameter (d1, ang1, rad1, dia1) that drives the geometry to its value. The value can be a number or an expression of other parameters. The dimension shows on the drawing as name=value.
| Parameter | Type | Required | Description |
|---|---|---|---|
type | DimType | yes | |
refs | Ref[] | yes | Two points, or one line (linear, aligned); two lines (angular); an arc or circle segment (radius, diameter). |
name | string | Parameter name; default d1, ang1, rad1, dia1, …. | |
value | any | A number (mm or degrees) or an expression of other parameters such as "d1 / 2". Default: what it measures now. | |
offset | number | Where the dimension is drawn: mm from the geometry (linear, aligned), the arc radius (angular), or the leader angle in degrees (radius, diameter). Default 8 / 0. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
add_items
Add items (line, rect, circle, arc, polygon, polyline, path, curve (Bézier), text, dimension) and guide lines (xline, ray, centerline, centermark: construction lines for drawing, never lasered or exported), each on a layer (by id, or by op: the first layer with it). Returns ids and the items compactly (id, name, layer, op, kind, bbox, rotation, contour/vertex counts; verbose: true for geometry). Big batches: write the items array to a JSON file and pass its path instead of items. One undo step. The old fill: true is still accepted and means op engrave.
| Parameter | Type | Required | Description |
|---|---|---|---|
items | NewItem[] | ||
path | string | Or a JSON file (absolute path) holding the same items array (or {"items": [...]}), for big batches. | |
select | boolean | Select the new items in the GUI (default false: the user's selection stays as it is). | |
infer | boolean | Join the new items to what they touch, as drawing in the GUI does (INFER): coincident on ends and centres within 1e-6 mm of another item's, concentric for shared arc centres. Default false. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
add_layer
Add a layer at the end with a name and op (cut, score, engrave, no_output). A taken name gets a number. Returns the layers.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
op | Op | yes | |
current | boolean | Make it the layer new shapes drawn in the GUI go on. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
align
Align (AutoCAD ALIGN, empty ids = the selection): move the items so source1 lands on dest1; with source2/dest2 also rotate them so source1→source2 points along dest1→dest2, and with scale also size them to match.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Items to move; empty = the selection. | |
source1 | number[] | yes | |
dest1 | number[] | yes | |
source2 | number[] | Second pair: the items also turn so source1→source2 lies along dest1→dest2. | |
dest2 | number[] | ||
scale | boolean | With a second pair: also scale so the two lines have the same length. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
array_polar
Copy items around a centre (empty ids = the selection): count items in total spread over angle degrees (default 360 = evenly round, positive = clockwise). rotate (default true) turns each copy; false keeps its orientation.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | ||
count | integer | yes | Items in total, the original included. |
centre | number[] | yes | |
angle | number | Degrees to spread them over, positive = clockwise; default 360 (evenly round). | |
rotate | boolean | Turn the copies with the angle (default true); false only moves them. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
array_rectangular
Copy items into a grid (empty ids = the selection): rows × columns in total, the original being the top-left cell, dx mm between columns and dy between rows.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | ||
rows | integer | yes | |
columns | integer | yes | |
dx | number | Distance between columns in mm (negative = to the left). | |
dy | number | Distance between rows in mm (positive = down). | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
auto_constrain
Infer constraints (AutoCAD AUTOCONSTRAIN) for items (empty = the selection): coincident ends, horizontal, vertical, parallel, perpendicular, tangent, concentric and equal, within the tolerances. Returns the new constraints.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the selection. | |
tolerance | number | Distance tolerance in mm (default 0.05). | |
angle_tolerance | number | Angle tolerance in degrees (default 1). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
boolean
Union, difference or intersection of two or more closed paths (empty ids = the selection). Difference subtracts the others from the first id. The result replaces the first item, keeping its name, layer and so its op (the other items' layers do not matter: a no-output cutter subtracted from a cut part leaves a cut part); holes become contours of a compound path; the other items are deleted. Returns the result compactly (verbose: true for its geometry).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Two or more closed paths; empty = the selection. For difference the first one is the base. | |
operation | BoolOp | yes | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
break_apart
Split a compound path into one item per contour.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Item id; missing = the single selected item. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
break_item
Break a path (AutoCAD BREAK) at the point nearest at: an open path splits in two items, a closed one opens there. With at2 the piece between the two points is removed instead (a closed shape loses the shorter way round). Returns the ids of the pieces.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
at | number[] | yes | Break point (the nearest point on the path). |
at2 | number[] | Second point: the piece between at and at2 is removed (on a closed shape the shorter way round). | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
chamfer
Cut corners off with a straight line (empty ids = the selection): the corner nearest at, or every sharp corner. distance goes back along the incoming side, distance2 (default = distance) along the outgoing one. Two open lines/polylines are joined where they meet, like fillet. With first and second, chamfers two picked objects as AutoCAD does (lines, arcs and end segments of open polylines; not circles): distance from the corner along the first (along the arc for arcs), distance2 along the second; 0 and 0 makes a sharp corner. Returns the new and changed ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the selection. Two open lines/polylines are joined where they meet, and that corner is cut. | |
distance | number | yes | How far back along the incoming side (or the first item) the cut starts, in mm. |
distance2 | number | Along the outgoing side (or the second item); default = distance. | |
at | number[] | Only cut the corner nearest this point; missing = every sharp corner. | |
first | ObjectPick | Two-object form (AutoCAD FILLET/CHAMFER picking two objects): the first object and where it was picked; needs second too, and then ids and at are ignored. | |
second | ObjectPick | The second object and where it was picked. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
close_document
Close a document's tab. Refuses when it has unsaved changes unless discard_changes is true (ask the person first). Closing the last tab leaves a new empty document.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | yes | The document's id (list_documents). |
discard_changes | boolean | Close it although it has unsaved changes (they are lost). |
combine_items
Combine paths into one compound path (empty ids = the selection). Holes stay empty when engraved. Keeps the first item's name and op.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
delete_constraints
Delete constraints by id, and/or every constraint on the given items (AutoCAD DELCONSTRAINT). The geometry stays where it is.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Constraint ids. | |
items | integer[] | Also every constraint on these items (AutoCAD DELCONSTRAINT). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
delete_items
Delete items (empty ids = the selection).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
delete_layer
Delete a layer. Its items move to move_to; without move_to a layer with items is refused. The last layer cannot be deleted.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
move_to | integer | Layer to move the items to; without it a layer that has items is not deleted. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
delete_machine
Delete a machine from the user's library. Refused while materials still have settings for it (they are listed) unless force: true, which keeps those settings unused. A built-in machine stays deleted until restore_machine brings it back; machines from a subscribed library source are read-only and refused. Deleting cannot be undone: ask the person first. Returns what was removed.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Machine id (list_machines). |
force | boolean | Delete it even though materials have settings for it (those settings stay, unused). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
delete_material
Delete a material and all its settings from the user's library. This cannot be undone: ask the person first. Materials from a subscribed library source are read-only and refused. Returns what was removed.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Material id (list_materials). |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
delete_material_setting
Delete one profile of a material's setting: material, machine, laser, operation (cut, score, engrave) and name ("" or missing = the default profile). Other profiles stay. This cannot be undone: ask the person first. Materials from a subscribed library source are read-only and refused. Returns what was removed.
| Parameter | Type | Required | Description |
|---|---|---|---|
material | string | yes | Material id. |
machine | string | yes | Machine id. |
laser | string | yes | Laser module id of that machine. |
operation | Operation | yes | |
name | string | Profile name; "" or missing = the default (unnamed) profile. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
duplicate_items
Copy items, offset by dx/dy (empty ids = the selection).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | ||
dx | number | ||
dy | number | ||
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
explode
Explode (AutoCAD EXPLODE, empty ids = the selection): a compound path becomes one item per contour, a single path one item per line or arc segment, a text one path of its letter outlines. Returns the new ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
export_dxf
Export the document as DXF (ASCII, AutoCAD 2004, $INSUNITS = mm) for CAD programs and laser software: one DXF layer per shown layer (its name, and its colour as AutoCAD colour index plus true colour), contours as LWPOLYLINE with arcs (bulges), full circles as CIRCLE, text as its outlines. The DXF origin is the material's bottom-left corner (y up). Hidden layers, guides, dimensions and images are left out; no_output layers only with include_no_output.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Where to write the .dxf. |
include_no_output | boolean | Include no_output layers (notes, helpers). Default false, because laser software would burn them. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
export_library
Save machines and materials to a Scriber library file to share with other Scriber users. A path ending in .scrlib: one JSON file; both lists missing = the whole library, and the machines the materials' settings use are included. A path ending in .zip: a library zip (.scriber.json and .scriber/machines|materials/<id>.json, the layout of a library repository) with only the user's own machines and materials (never built-ins or sources' items; both lists missing = all of them).
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Where to write the library file: .scrlib, or .zip for a library zip (your own items only). |
machines | string[] | Machine ids; with both lists missing everything is exported. | |
materials | string[] | Material ids; the machines their settings use are added. |
export_library_repository
Write the user's own machines and materials (ones they made: never built-ins, sources' items or edits of those) as a library repository so the person can publish it on GitHub for others to subscribe to. dir is a new folder, or an existing (git) repository that is updated in place: only .scriber.json and .scriber/machines|materials/<id>.json are written, files there for items the user no longer has are removed, everything else (.git, README, …) stays; an existing .scriber.json keeps its name, description, author, license and homepage (library_version, when present, is bumped). name/description are used only for a new repository. Scriber does no git: the person commits and pushes. Reply: created (or updated), added, changed and removed files.
| Parameter | Type | Required | Description |
|---|---|---|---|
dir | string | yes | The repository's folder (its root): a new folder, or an existing (git) repository to update in place. |
machines | string[] | Machine ids of the user's own; both lists missing = all the user's own machines and materials. | |
materials | string[] | Material ids of the user's own. | |
name | string | Only for a new repository (no .scriber.json yet): its name (default: the folder name) and description. | |
description | string |
export_png
Render the document to PNG (preview: true shows what the laser makes). With a path it is written to that file; without, the image is returned so you can see the drawing.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Where to write the PNG. Without a path the image is returned so you can look at it. | |
dpi | number | Resolution; default: 2048 px on the material's longest side. Images returned inline stay under 8000 px. | |
include_annotations | boolean | Default true. | |
preview | boolean | Render what the laser makes instead of the drawing: material colour, burned areas, thin cut and score lines, cut-out pieces shadowed with their holes open; no-output items and guides hidden. Engraved areas and score lines are darker the more energy their laser settings give (power x passes / speed, x lines per cm for engrave). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
export_svg
Export the document as SVG in mm for laser software (red = cut, blue = score, black = engrave lines and filled areas), one group (Inkscape layer) per shown layer in laser order; hidden layers are left out.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | |
include_annotations | boolean | Include no_output items (notes, dimensions, helpers). Default false, because laser software would burn them. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
export_xs
Export the document as an xTool Studio project (.xs) for the document's xTool machine and laser module: one xTool colour layer per shown layer, named after it (a colour another exported layer already has is nudged by one step per channel so layers never merge), each cut/score/engrave layer with its processing type (cut, score = vector engraving, engrave = fill) and the layer's power, speed and passes (and lines per cm). no_output layers go in as reference: on the canvas but never processed (xTool's ignoredDisplayIds); include_no_output: false leaves them out. Text goes out as outlines; hidden layers, guides and dimensions are left out; rotated or unreadable images are skipped (listed in skipped).
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Where to write the .xs project. |
include_no_output | boolean | Put no_output layers in as reference: on the canvas, marked not to be processed. Default true; false leaves them out. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
extend
Extend (AutoCAD EXTEND) the open end of a path nearest at until it meets the nearest boundary ahead of it (lines along their direction, arcs round their circle). Boundaries default to every other path and guide line.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
at | number[] | yes | A point near the open end to extend. |
boundaries | integer[] | Boundary items; empty = every other path and guide line. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
fillet
Round corners with an arc (empty ids = the selection): the corner nearest at, or every sharp corner between straight segments. With exactly two open lines/polylines, they are extended or shortened to meet, joined into one path, and that corner is rounded (AutoCAD FILLET of two objects). With first and second (each an id and the point it was picked at), fillets any two objects as AutoCAD does: lines, arcs, circles and end segments of open polylines (lines touching end to end count as one polyline); the picks choose the kept sides and which arc is meant, lines and arcs are trimmed or extended to the arc, circles stay, two open paths become one, parallel lines get a half-circle cap, radius 0 makes a sharp corner. Returns the new and changed ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the selection. Two open lines/polylines are joined where they meet, and that corner is rounded. | |
radius | number | yes | Arc radius in mm (0 with two open items just joins them into a sharp corner). |
at | number[] | Only round the corner nearest this point; missing = every sharp corner. | |
first | ObjectPick | Two-object form (AutoCAD FILLET/CHAMFER picking two objects): the first object and where it was picked; needs second too, and then ids and at are ignored. | |
second | ObjectPick | The second object and where it was picked. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
get_document
Get the document: material size, notes, layers, the user's selection, and every item (or only ids) with op, bounding box, rotation and its geometry. geometry: false gives a summary without geometry; a large document gets the summary unless geometry is set, with a note saying so: then ask for the geometry of particular ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Only these items; empty = all. Picked items come with their geometry unless geometry is false. | |
geometry | boolean | true: every item's geometry; false: summary only (id, name, layer, op, kind, bbox, rotation, contour and vertex counts). Default: geometry, unless the reply would be very large. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
get_laser_setup
The document's machine, laser module and material, the material library's settings per operation (null where the library has none), and per layer the setting the laser uses: the preset for the layer's op with the layer's own power/speed/passes on top (null when neither gives them).
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
group
Group items (empty ids = the selection) so they are picked together; an item leaves any group it was in.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
import_dxf
Import a DXF file (ASCII or binary, R12 to 2018). LINE, ARC, CIRCLE, LWPOLYLINE/POLYLINE (arcs stay arcs), ELLIPSE and SPLINE (fitted as arcs within tolerance), TEXT/MTEXT (text items in the default font) and INSERT (blocks, nested, arrays) come in; POINT, HATCH, DIMENSION and the like are left out (listed in skipped). Units follow $INSUNITS (no units = mm); the DXF origin goes to the material's bottom-left corner unless x/y place the drawing's top-left corner. Lines and arcs touching end to end are joined, closed contours inside one another become one compound path. Each DXF layer (or layer and colour, named "name #rrggbb", when a layer has several colours) goes on a Scriber layer of that name with the op from layers, else guessed: a name saying cut/score/engrave/no output, else its colour (red cut, blue score, black/dark grey engrave, grey no_output, white and others cut); layers turned off in the DXF are skipped unless named. Returns ids, bbox, units, layers (name, colour, op or skip, items) and skipped.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | DXF file to import (ASCII or binary, R12 to 2018). |
layers | object | Op per DXF layer name (the names import_dxf replies with; a layer with several colours is split as "name #rrggbb"): cut, score, engrave, no_output or skip. Layers not named get the guess from their name and colour. | |
x | number | Left edge of the drawing in mm; default: where the file puts it (DXF origin = the material's bottom-left corner). | |
y | number | Top edge of the drawing in mm (give x and y together). | |
tolerance | number | Largest distance in mm between an ellipse or spline and the arcs that replace it. Default 0.01. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
import_image
Import an image from a file or base64 data. It is converted to greyscale and placed as an engraved item. Returns the item.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | File to import (PNG, JPEG, WebP, BMP, GIF, TIFF). | |
data_base64 | string | Or the image bytes, base64 encoded. | |
x | number | ||
y | number | ||
width | number | Width in mm; height follows the aspect ratio. Default 10 px per mm, capped to the material. | |
name | string | ||
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
import_library
Merge a Scriber library file (.scrlib, or a library zip .zip with .scriber.json and .scriber/machines|materials/ at its root or in one top folder; invalid files in it are skipped and reported) into the user's library. on_conflict (replace / keep_both / skip) decides for ids taken by a different machine or material; keep_both gives the import a new id. Reports added, replaced, skipped and machines the settings need that the user does not have.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | A .scrlib file or a library zip (.zip). |
on_conflict | OnConflict | yes | For a machine or material whose id is taken by a different one. |
import_svg
Import an SVG file (path) or SVG text/base64 (data). Each path becomes an item (subpaths stay one compound path), curves become arcs, text becomes outlines and raster images greyscale images. Stroke colour sets the op: red = cut, blue = score, black/dark = engrave, grey or green = no_output, other colours = cut. A fill on a closed path means engrave the area, except a grey or green fill (no_output); a path with both a fill and a stroke becomes two items (the fill's op, then the stroke's) unless both give the same op. A path with neither fill nor stroke (or a fully transparent fill) comes in as no_output, handy as a boolean cutter. Each item goes on the current layer when that has its op, else on the first layer with it. Units in the file (mm, cm, in) are honoured; plain numbers are px at 96 per inch. Returns ids and items (compact, verbose: true for geometry), each with svg_id (the element's id, empty when it has none) and element (index of the SVG path/image in document order; one element can give two items).
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | SVG file to import. | |
data | string | Or the SVG itself: its text, or base64. | |
x | number | Left edge of the drawing in mm; default: where the file puts it. | |
y | number | Top edge of the drawing in mm; default: where the file puts it. | |
width | number | Scale the drawing to this width in mm (overrides scale). | |
scale | number | Extra factor on the file's own size; 1.333 (96/72) for 72 DPI files. Default 1. | |
tolerance | number | Largest distance in mm between a curve and the arcs that replace it. Default 0.01. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
import_xs
Open an xTool Studio project (.xs) as a new, unsaved document in a new tab: its elements (paths, lines, rectangles, circles/ellipses, polygons, stars, text as its glyph outlines, images) at their positions, one layer per xTool colour layer and processing type (cutting → cut, vector engraving → score, fill engraving → engrave, bitmap → engrave with the image; elements set not to be processed → no_output) with the project's power, speed, passes and line interval, groups (the outermost), and the machine from the device code (the material is its work area, or the drawing plus a margin). Returns the document id, per layer its id, name, op and item count, skipped elements with the reason, and notes. activate: true shows it (default false). For only the laser settings use import_xtool_project.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path to the xTool Studio project (.xs). |
activate | boolean | Show it to the person (make it the active tab). Default false. |
import_xtool_materials
Import materials from xTool Studio's cache into the user's library (ids from search_xtool_materials) for one Scriber machine: name, thickness, category and for every laser module of that machine the cut/score/engrave power, speed, passes and line interval. Image (bitmap) engraving settings are not imported. Returns the new material ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string[] | yes | Material ids from search_xtool_materials, e.g. "123". |
machine | string | The Scriber machine to import the settings for; missing = the document's machine if it has settings for it, else the first machine that has. | |
overwrite | boolean | Replace materials imported earlier from the same xTool entry instead of adding copies. | |
dir | string | xTool Studio's data folder, when it is not in the usual place. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
import_xtool_project
Import the laser settings of an xTool Studio project (.xs) as a material named after the file (rename it with save_material). Returns the new material ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path to an xTool Studio project (.xs). |
overwrite | boolean |
join
Join (AutoCAD JOIN) open paths that touch end to end into one path each (empty ids = the selection); a chain that comes round to its start becomes closed. Returns the remaining ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
lengthen
Lengthen (AutoCAD LENGTHEN) the open end of a path nearest at by delta mm (negative shortens), or so the contour is total mm long.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
at | number[] | yes | A point near the open end to change. |
delta | number | Change in length, mm (negative shortens). | |
total | number | Or the new total length of the contour, mm. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
list_annotations
List the review comments pinned on the canvas (id = the number on its pin, text, author, status open/resolved, at, items it points at, reply count, last_reply, revision). Filter by status and/or since_revision. Returns them and the current revision.
| Parameter | Type | Required | Description |
|---|---|---|---|
status | Status | Only open or only resolved ones. | |
since_revision | integer | Only those changed after this revision (from an earlier reply). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
list_constraints
List every constraint: type, references, the parameter name/expression/value of dimensional ones, and whether it is satisfied.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
list_documents
List the open documents (the tabs in Scriber's window): document id, name, path, unsaved, active (the one the person sees) and item count. Every document tool takes document: <id>; without it, it works on the active tab.
list_fonts
List the font families installed on this computer, for a text's font. sans-serif, serif and monospace also work and pick the system's default of that kind; generic says which installed family each one draws with.
list_layers
List the layers in order: id, name, op, colour, own settings (power/speed/passes that override the material library), lines_per_cm (the layer's own engrave line spacing; line_interval is the same in mm), image_mode (the layer's own; image_mode_used on engrave layers: the one its images get, the machine's default when it has none; null when the machine has no modes), visible, locked, number of items, whether it is current, and laser_setting: the power/speed/passes the laser uses (library preset for the op with the layer's own numbers on top; null when neither gives them).
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
list_library_sources
List the library sources (GitHub repositories the user subscribed to for machines and materials): id, url, track (what it follows), commit in use, release, name, description, author, license, enabled, how many machines and materials it gives, machines its materials need that nobody has (settings kept), last sync summary and error, and problems (skipped files, id clashes: the first source in the list wins).
list_machines
List the machines (laser cutters) the user has: work area in mm, laser modules with type, power and what each can do, image_modes (how its software can engrave images: greyscale or a dither; the first is the default, pick one per engrave layer with update_layer image_mode), notes and the source of the numbers.
list_materials
List the material library: each material with its thickness, color (preview sheet colour [r, g, b], missing = wood), burn_colour (the colour a full burn leaves in the preview, missing = a darker shade of the sheet) and laser settings per machine, laser module and operation (cut, score, engrave): power %, speed mm/s, passes, and for engrave line_interval (mm between lines; tell people lines per cm = 10 / line_interval) and bidirectional, and preview_opacity (0-1, how dark the burn looks in the preview; missing = from the energy).
| Parameter | Type | Required | Description |
|---|---|---|---|
machine | string | Only materials with settings for this machine id (and only those settings). |
list_recent_projects
The projects opened or saved recently in Scriber, newest first (path, name, modified as Unix seconds, exists, open_as = the document id when open now), and with dir also the .scrbr files in that folder. Open one with open.
| Parameter | Type | Required | Description |
|---|---|---|---|
dir | string | Also list the .scrbr files in this folder (not its subfolders). |
match_properties
Match properties (AutoCAD MATCHPROP): give the targets (empty = the selection) the layer (and so the laser operation) of the source item, and its font when both are text.
| Parameter | Type | Required | Description |
|---|---|---|---|
source | integer | yes | |
targets | integer[] | Items that get the source's laser operation (and font, text to text); empty = the selection. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
measure
Measure items (empty ids = the selection, or everything when nothing is selected): bounding box, outline length and area per item, plus the total laser path length per op. Pass from/to to measure a distance.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | ||
from | number[] | Also measure the straight distance between two points. | |
to | number[] | ||
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
new_document
Start a new empty document in a new tab (material size in mm, default 300 × 200). Returns its document id. activate: true shows it to the person (default false).
| Parameter | Type | Required | Description |
|---|---|---|---|
width | number | ||
height | number | ||
activate | boolean | Make it the active tab. Default false. |
offset
Add offset copies of paths (empty ids = the selection), keeping the originals. Positive distance = outward for closed shapes (their holes shrink), to the left on screen for open ones. For laser kerf compensation of a part, offset by half the kerf and cut the copy.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | ||
distance | number | yes | mm. Positive = outward for closed shapes (holes shrink), to the left on screen for open ones; negative = inward / right. |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
open
Open a .scrbr project in a new tab, or return the tab that already has it (already_open: true). Returns its document id: pass it as document to work on it. activate: true also shows it to the person; leave it false unless they asked to see it.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path to the .scrbr file. |
activate | boolean | Show it to the person (make it the active tab). Default false: leave their view alone unless they asked. |
preflight_check
Pre-flight check before lasering: open shapes set to cut, lines on top of each other, shapes outside the material or the machine's work area, details smaller than the beam, text too small to read, and operations without settings for the chosen machine and material. Each warning has a severity (error/warning), a plain text and the item ids involved.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
quick_select
Quick select: select the items with the given laser operation (from their layer), kind of shape and size (longer side of the bounding box, mm); missing filters match anything. Returns the new selection.
| Parameter | Type | Required | Description |
|---|---|---|---|
op | Op | ||
kind | string | line, arc, circle, polyline, closed shape, compound path, text, dimension, image or guide. | |
min_size | number | Size range on the longer side of the bounding box, mm. | |
max_size | number | ||
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
redo
Redo the last undone change.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
reply_annotation
Reply to a comment; resolve: true also resolves it (say what you changed), false reopens it.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
text | string | yes | |
resolve | boolean | true resolves it with the reply, false reopens it. | |
author | string | Your name (default "agent"). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
resolve_annotation
Mark a comment resolved (prefer reply_annotation with resolve: true, so the person sees what was done).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
author | string | Your name (default "agent"). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
restore_machine
Bring back a built-in machine that was deleted (delete_machine or the library window). Returns it.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Id of a deleted built-in machine. |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
save
Save a document as a .scrbr file (without path: its own file).
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Path to the .scrbr file; missing = the document's own file. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
save_machine
Add a machine or replace the one with the same id. Saved in the user's library.
| Parameter | Type | Required | Description |
|---|---|---|---|
machine | Machine | yes | The whole machine; replaces the one with the same id (built-ins too: the user's copy wins). |
save_material
Add a material (no id: name and thickness needed) or change an existing one's name, thickness, category, notes, color (the sheet colour in the laser preview, [r, g, b]; [] clears it) or burn_colour (the colour a full burn leaves in the preview, [r, g, b]; [] clears it). Returns it with its id.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Existing material to change; missing = add a new one (name and thickness needed). | |
name | string | ||
thickness | number | mm | |
category | Category | What kind of material (for filtering); a new material without one is "other". | |
notes | string | ||
color | integer[] | The sheet's colour in the laser preview as [r, g, b] (0-255); [] clears it (back to wood). | |
burn_colour | integer[] | The colour a full burn leaves in the laser preview as [r, g, b] (e.g. dark brown on kraft, silver on black metal card); [] clears it (back to a darker shade of the sheet). |
search_xtool_materials
Search the materials in xTool Studio's local cache on this computer (only materials the user opened in xTool Studio's material library, or saved there from atomm.com's Materials Lab with "Save to Studio"; read-only, nothing is downloaded). Each material once: id (for import_xtool_materials), name, thickness mm, category, and per Scriber machine in the user's library it can be imported for (the document's first) the settings per laser module and op. By default only importable materials are listed; with include_other_machines the rest come with why_not.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Words that must all appear in the name (case-insensitive); missing = all. | |
machine | string | Only materials that can be imported for this Scriber machine id (e.g. "xtool-m2"). | |
include_other_machines | boolean | Also list materials that only have settings for xTool machines not in the user's library. | |
dir | string | xTool Studio's data folder, when it is not in the usual place (or set SCRIBER_XTOOL_DIR). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
select
Select items in the GUI (empty list clears the selection).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
select_similar
Select similar: select every item on the same layer and with the same kind of shape as the given items (empty = the selection). Returns the new selection.
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
set_canvas
Set the material (canvas) size in mm.
| Parameter | Type | Required | Description |
|---|---|---|---|
width | number | yes | |
height | number | yes | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
set_laser_setup
Choose the document's machine, laser module and/or material (ids from list_machines/list_materials). use_work_area also sets the material size to the machine's work area. One undo step.
| Parameter | Type | Required | Description |
|---|---|---|---|
machine | string | Machine id; "" = none; missing = unchanged. | |
laser | string | Laser module id of the machine; missing = unchanged, or the machine's first module when the machine changes. | |
material | string | Material id; "" = none; missing = unchanged. | |
use_work_area | boolean | Also set the material (canvas) size to the machine's work area. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
set_library_source
Change a library source: track (what it follows; syncs right away: {"branch": ""} = default branch, {"tag": "v1.2"} locked to a tag, {"release": "latest"} = GitHub's latest release, {"commit": "<sha>"} fully locked) and/or enabled.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
track | Track | Follow something else (syncs right away): {"branch": ""}, {"tag": "v1.2"}, {"release": "latest"} or {"commit": "<sha>"}. | |
enabled | boolean | Use the source's machines and materials (false hides them without unsubscribing). |
set_material_setting
Add or replace a material's setting for one machine, laser module and operation (cut, score, engrave; the old "fill" means engrave): power 0-100 %, speed mm/s, passes; for engrave also line_interval and bidirectional; optional preview_opacity 0-1, how dark the burn looks in the laser preview (missing = worked out from power, speed, passes and lines per cm). line_interval is the distance between engraved lines in mm; people think in lines per cm, so convert: line_interval = 10 / lines per cm (100 lines/cm = 0.1 mm), and report it back as lines per cm.
| Parameter | Type | Required | Description |
|---|---|---|---|
material | string | yes | Material id. |
machine | string | yes | Machine id. |
laser | string | yes | Laser module id of that machine. |
operation | Operation | yes | |
name | string | Profile name, e.g. "Light" or "Photo": a material can have several settings per machine, laser and operation. "" (missing in older files) is the default one. | |
power | number | yes | Power in percent (0–100). |
speed | number | yes | Speed in mm/s. |
passes | integer | ||
line_interval | number | Engrave only: distance between engraved lines in mm. People see it as lines per cm = 10 / this (0.1 mm = 100 lines/cm). | |
bidirectional | boolean | Engrave only: engrave in both directions. | |
preview_opacity | number | How dark the burn looks in the laser preview, 0-1 (1 = the material's full burn colour); missing = worked out from power, speed, passes and lines per cm. |
set_notes
Replace the document's free-form notes (shown in the GUI's notes panel; saved with the file).
| Parameter | Type | Required | Description |
|---|---|---|---|
notes | string | yes | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
set_parameter
Set a parameter (a dimensional constraint) to a number or an expression such as "d1 / 2"; the geometry follows. Or rename it (e.g. d1 to width); expressions that use it follow.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
value | any | A number or an expression of other parameters ("d1 * 2 + 5"). Leave out to only rename. | |
rename | string | Rename the parameter (expressions that use it follow); a letter, then letters, digits or _, not taken. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
stretch
Stretch (AutoCAD STRETCH): every point of the items that lies inside the crossing window moves by dx/dy, the others stay, so the lines between them stretch. Whole circles, texts and images move when their centre/anchor is inside. One undo step. Returns the changed ids.
| Parameter | Type | Required | Description |
|---|---|---|---|
window | number[] | yes | Crossing window [x, y, width, height]: every point inside it moves. |
dx | number | yes | |
dy | number | yes | |
ids | integer[] | Only these items; empty = every item the window catches. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
subscribe_library
Subscribe to a machine and material library published in a public GitHub repository (.scriber.json at its root, files in .scriber/machines and .scriber/materials). Downloads it now; its machines and materials appear in the library, read-only (save_machine/save_material with the same id makes the user's own copy, which wins). Returns the source and what it added.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | yes | owner/repo, owner/repo@ref (a tag when the repository has one by that name, else a branch) or https://github.com/owner/repo[/tree/ref]. |
track | Track | What to follow: {"branch": "main"} ("" = the default branch), {"tag": "v1.2"}, {"release": "latest"} or {"commit": "<sha>"}; missing = from the url, else the default branch. |
sync_library_sources
Sync library sources now: resolve what each follows to its current commit (one small request) and, when it changed, download and use it (a broken new version is not used; the old one stays). Reply per source: changed, commit, summary (e.g. "+2 materials, 1 changed, 0 removed") and the diff (ids added, changed, removed).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Source id; missing = every enabled source. |
transform_items
Move, rotate, scale and/or mirror items (empty ids = the selection). Order: mirror, scale, rotate around the pivot, then move by dx/dy. The pivot defaults to the centre of the items' bounding box. Each item's rotation (see get_document) adds the rotate angle; a mirror negates it; a non-uniform scale resets it to 0 unless the item's angle is a multiple of 90°. copy: true transforms copies and keeps the originals (a mirrored copy: mirror_x or mirror_y with copy).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | ||
dx | number | ||
dy | number | ||
rotate | number | Degrees, positive = clockwise on screen. | |
scale_x | number | Scale factors; 0 or missing means 1. | |
scale_y | number | ||
mirror_x | boolean | Mirror left-right / top-bottom. | |
mirror_y | boolean | ||
pivot | number[] | Centre of rotation/scale/mirror; defaults to the centre of the items' bounding box. | |
copy | boolean | Transform copies and leave the originals where they are (e.g. mirror_x with copy for a mirrored copy). | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
trim
Trim a path (AutoCAD TRIM): the piece around at is removed back to the nearest crossings with the cutting edges (default: every other path). An open line keeps the parts on either side; a closed shape needs two crossings and becomes open. An item with nothing left is deleted. Constraints on the item follow what is left (a trimmed circle's tangents move to the arc), and each new end stays on its cutting edge unless constrain is false.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | The item to trim; missing = the single selected item. | |
at | number[] | yes | A point on the piece to remove. |
edges | integer[] | Cutting edges; empty = every other path. | |
constrain | boolean | Keep each new end on the edge it was trimmed against (a coincident constraint, as INFER does while drawing). Default true. | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
undo
Undo the last change (the user's or yours).
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
ungroup
Dissolve the groups that hold any of the items (empty ids = the selection).
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | integer[] | Item ids; empty = the user's current selection. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
unsubscribe_library
Unsubscribe from a library source: its machines and materials leave the library and its downloaded files are deleted. Confirm with the person first.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | Source id from list_library_sources. |
update_item
Change an item's name, layer (or op: moves it to the first layer with that op), note, geometry, rotation (degrees, about its own centre) or (text only) font. The old fill: true is still accepted and means op engrave.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
name | string | ||
layer | integer | Move it to this layer (see list_layers); wins over op. | |
op | Op | Move it to the first layer with this op (made if there is none). | |
fill | boolean | Deprecated, kept for old clients: true means op engrave. | |
note | string | ||
shape | ShapeInput | Replace the geometry. | |
font | string | Text only: change the font family (see list_fonts), keeping everything else. | |
rotation | number | Turn the item to this angle in degrees (clockwise positive) about the centre of its own box. get_document reports each item's rotation; a new shape starts at 0 (text and images: their rotation). | |
verbose | boolean | Reply with each item's full geometry. Default false: id, name, layer, op, kind, bbox, rotation and (paths) contour and vertex counts; get_document with ids gives the geometry later. | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
update_layer
Change a layer: name, op (changes what the laser does with all its items), color, settings (the layer's own power/speed/passes; missing = material library), lines_per_cm (engrave line spacing, lines per cm = 10 / mm; null = material library), profile, image_mode (how images on an engrave layer are engraved: greyscale or a dither, an id from the machine's image_modes in list_machines; "" = the machine's default), visible, locked, order (position) and current. One undo step.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
name | string | ||
op | Op | Changes what the laser does with every item on the layer. | |
color | integer[] | Canvas colour as [r, g, b]; [] = the op's colour. | |
settings | Overrides | Replaces the layer's own power (%), speed (mm/s) and passes; a missing one (or {}) uses the material library's preset for the layer's op. | |
lines_per_cm | number | Engrave layers: the layer's own line spacing in lines per cm (10 / mm between lines; 100 = 0.1 mm); null = the material library's. | |
profile | string | The material's profile for the layer's op (a setting's name, see list_materials); "" = the default one. | |
image_mode | string | Engrave layers: how its images are engraved, the id of one of the machine's image modes (list_machines image_modes, e.g. "bayer"); "" = the machine's default. | |
visible | boolean | Hidden layers are not drawn, lasered or exported. | |
locked | boolean | Items on a locked layer cannot be selected or edited. | |
order | integer | New position in the list (0 = first). | |
current | boolean | Make it the current layer (where shapes drawn in the GUI go). | |
document | integer | The open document to work on (id from list_documents); missing = the active tab, the one the person sees. |
wait_for_annotations
Wait until the person adds, replies to, resolves or reopens a comment after since_revision (missing = now), or timeout_s passes (default 60, max 300). Returns at once when there already is one. Watches every open document unless document is given; each annotation in the reply says its document (id), so pass that to reply_annotation. Reply: annotations (the changed ones, as list_annotations) and revision; pass that revision to the next call. timed_out: true when nothing came. Loop on it to follow the person's review.
| Parameter | Type | Required | Description |
|---|---|---|---|
document | integer | Only this open document's comments; missing = every open document (each reply names its document). | |
since_revision | integer | The revision from the last list_annotations / wait_for_annotations reply; missing = now. | |
timeout_s | number | Seconds to wait (default 60, at most 300). |
Types
The argument types the tools above refer to.
BoolOp
One of: union | difference | intersection
union: Everything covered by any of the shapes.difference: The first shape minus all the others.intersection: Only what all the shapes cover.
Category
What kind of material it is, so a long list can be filtered.
One of: paper | wood | plywood | acrylic | leather | fabric | metal | stone | glass | other
Contour
One closed or open outline.
| Field | Type | Required | Description |
|---|---|---|---|
vertices | Vertex[] | yes | |
closed | boolean |
CurveSegment
One segment of a curve.
| Field | Type | Required | Description |
|---|---|---|---|
to | number[] | yes | |
controls | number[][] | 0 = straight line, 1 = quadratic, 2 = cubic Bézier control points. |
DimType
One of: horizontal | vertical | radius | diameter | linear | aligned | angular
linear: Horizontal or vertical, whichever the points are further apart in.aligned: Straight distance (two points, a line's length, or a point to a line).angular: Between two lines, in degrees.
DxfLayerOp
What to do with a DXF layer on import.
One of: cut | score | engrave | no_output | skip
skip: Leave the layer out.
ImageMode
One way the machine's software engraves an image: greyscale or a dither.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Scriber's id, stored on layers, e.g. "bayer". |
name | string | yes | What people see, e.g. "Bayer". |
value | string | yes | What the export writes for the machine's software, e.g. "Bayer" in an xTool .xs project. |
ImageModes
A machine's image modes: the name of a built-in set (machines/image-modes/<name>.json, shared by the machines of one vendor's software) or the machine's own list.
One of: string | ImageMode[]
Kind
What a constraint keeps true. The geometric kinds are AutoCAD's GEOMCONSTRAINT, the dim_* kinds its DIMCONSTRAINT.
One of: parallel | perpendicular | dim_radial | dim_diameter | coincident | collinear | concentric | fix | horizontal | vertical | tangent | smooth | symmetric | equal | regular | dim_horizontal | dim_vertical | dim_aligned | dim_angular
coincident: Two points on top of each other, or a point on a line (its extension) or a circle/arc.collinear: Two lines on one infinite line.concentric: Two arcs/circles with the same centre.fix: A point, segment, centre or whole item stays where it is.horizontal: A line, or two points, level.vertical: A line, or two points, plumb.tangent: A line and an arc/circle, or two arcs/circles, touching without crossing.smooth: Two segments joined end to end with no kink (G1); two arcs also get the same radius (G2).symmetric: Two points, lines or arcs/circles mirrored over a symmetry line (the third reference).equal: Two lines the same length, or two arcs/circles the same radius.regular: A closed straight-sided item (one contour) stays a regular polygon: equal sides, equal corners.dim_horizontal: Horizontal distance between two points (or a line's ends).dim_vertical: Vertical distance between two points (or a line's ends).dim_aligned: Straight distance between two points, a line's length, or a point's distance to a line.dim_angular: Angle between two lines, in degrees.
Laser
One laser module of a machine.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique within the machine, e.g. "diode-20w". |
name | string | yes | |
kind | LaserKind | yes | |
power_w | number | yes | Laser power in watts. |
ops | Operation[] | What it can do. | |
area | number[] | Work area [width, height] in mm when it differs from the machine's. | |
xtool_laser | string | xTool Studio's name for this module, e.g. "laser_blue_10W"; missing = derived (xtool_default). |
LaserKind
One of: diode | co2 | fiber | infrared
Machine
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique key, e.g. "xtool-m2". |
name | string | yes | |
vendor | string | ||
model | string | ||
width | number | yes | Work area width in mm. |
height | number | yes | Work area height in mm. |
lasers | Laser[] | ||
notes | string | ||
source | string | Where the numbers come from, and which ones are unverified. | |
xtool | XtoolIds | xTool Studio's ids for this machine (.xs export, importing xTool materials). | |
image_modes | ImageModes | How its software can engrave images (greyscale, dithers); the first is the default. Missing = none to choose from. |
NewItem
| Field | Type | Required | Description |
|---|---|---|---|
shape | ShapeInput | yes | |
layer | integer | Layer id (see list_layers); wins over op. | |
op | Op | Without a layer: the first layer with this op (made if there is none). Default cut; engrave for text; no_output for dimensions and guides. | |
fill | boolean | Deprecated, kept for old clients: true means op engrave. | |
name | string | ||
note | string |
ObjectPick
An object picked at a point: the point chooses the segment, the side kept and which corner is meant.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | yes | |
at | number[] | yes |
OnConflict
What to do when an imported machine or material has the id of a different one already in the library.
One of: replace | skip | keep_both
keep_both: Import it under a new id.
Op
What the laser does with an item (the four operations of xTool Studio).
One of: cut | score | engrave | no_output
cut: Cut through the material along the line (red in SVG).score: Mark a line without cutting through (blue in SVG).engrave: Burn the area inside closed shapes, text and images (holes stay empty; black in SVG). Open shapes have no area: they are scored (seeItem::effective_op).no_output: Notes, guides and dimensions for people; never sent to the laser (grey). Old files and clients may say "annotate" or "none".
Operation
What the laser does, as far as settings go (the item ops that reach the laser).
One of: cut | score | engrave
cut: Cut through.score: Mark a thin line.engrave: Engrave a whole area, line by line. Older libraries had separate "engrave" (line) and "fill" keys.
Overrides
A layer's own laser numbers; a missing one comes from the material library's preset for the op.
| Field | Type | Required | Description |
|---|---|---|---|
power | number | Power in percent (0–100). | |
speed | number | Speed in mm/s. | |
passes | integer |
Ref
A piece of geometry a constraint points at: always in a path item (contour defaults to 0).
kind: point: A vertex: a line's end, a polyline corner, an arc's end.
| Field | Type | Required | Description |
|---|---|---|---|
kind | point | yes | |
item | integer | yes | |
contour | integer | ||
vertex | integer | yes |
kind: segment: The segment from vertex segment to the next one: a line, or an arc (its circle). For a circle, segment 0 is the whole circle.
| Field | Type | Required | Description |
|---|---|---|---|
kind | segment | yes | |
item | integer | yes | |
contour | integer | ||
segment | integer | yes |
kind: centre: The centre of the arc or circle segment, used as a point.
| Field | Type | Required | Description |
|---|---|---|---|
kind | centre | yes | |
item | integer | yes | |
contour | integer | ||
segment | integer | yes |
kind: item: The whole item (every vertex), for fix.
| Field | Type | Required | Description |
|---|---|---|---|
kind | item | yes | |
item | integer | yes |
ShapeInput
kind: line
| Field | Type | Required | Description |
|---|---|---|---|
kind | line | yes | |
x1 | number | yes | |
y1 | number | yes | |
x2 | number | yes | |
y2 | number | yes |
kind: rect: Rectangle with top-left corner (x, y); corner_radius rounds the corners.
| Field | Type | Required | Description |
|---|---|---|---|
kind | rect | yes | |
x | number | yes | |
y | number | yes | |
w | number | yes | |
h | number | yes | |
corner_radius | number |
kind: circle
| Field | Type | Required | Description |
|---|---|---|---|
kind | circle | yes | |
cx | number | yes | |
cy | number | yes | |
r | number | yes |
kind: arc: Arc around (cx, cy) from start to end degrees, clockwise on screen (0° = right, 90° = down).
| Field | Type | Required | Description |
|---|---|---|---|
kind | arc | yes | |
cx | number | yes | |
cy | number | yes | |
r | number | yes | |
start | number | yes | |
end | number | yes |
kind: polygon: Regular polygon; r is the distance from centre to corners; the first corner points up before rotation.
| Field | Type | Required | Description |
|---|---|---|---|
kind | polygon | yes | |
cx | number | yes | |
cy | number | yes | |
r | number | yes | |
sides | integer | yes | |
rotation | number |
kind: polyline: Straight segments through the points.
| Field | Type | Required | Description |
|---|---|---|---|
kind | polyline | yes | |
points | number[][] | yes | |
closed | boolean |
kind: path: Full control: one or more contours with arc bulges (several = compound path).
| Field | Type | Required | Description |
|---|---|---|---|
kind | path | yes | |
contours | Contour[] | yes |
kind: curve: Bézier curves (as in SVG paths): from start, each segment goes to to straight (no controls), as a quadratic (one control point) or a cubic curve (two). Curves become arcs within tolerance mm (default 0.01). For SVG path data (a d string) use import_svg with data instead.
| Field | Type | Required | Description |
|---|---|---|---|
kind | curve | yes | |
start | number[] | yes | |
segments | CurveSegment[] | yes | |
closed | boolean | ||
tolerance | number |
kind: text: Text; (x, y) is the start of the baseline; size is the font size in mm. font is an installed family (see list_fonts) or sans-serif (default), serif or monospace. It is lasered as the glyph outlines.
| Field | Type | Required | Description |
|---|---|---|---|
kind | text | yes | |
x | number | yes | |
y | number | yes | |
size | number | yes | |
text | string | yes | |
rotation | number | ||
font | string | ||
bold | boolean | ||
italic | boolean |
kind: dimension: A measurement from point 1 to point 2, drawn offset mm to the left of that direction.
| Field | Type | Required | Description |
|---|---|---|---|
kind | dimension | yes | |
x1 | number | yes | |
y1 | number | yes | |
x2 | number | yes | |
y2 | number | yes | |
offset | number |
kind: xline: Guide line (construction line, never lasered or exported): endless through (x, y) at angle degrees (clockwise, 0 = right).
| Field | Type | Required | Description |
|---|---|---|---|
kind | xline | yes | |
x | number | yes | |
y | number | yes | |
angle | number | yes |
kind: ray: Guide ray from (x, y) to infinity at angle degrees.
| Field | Type | Required | Description |
|---|---|---|---|
kind | ray | yes | |
x | number | yes | |
y | number | yes | |
angle | number | yes |
kind: centerline: Guide centre line between two lines: give of (the two line ids; it then follows them) or the end points.
| Field | Type | Required | Description |
|---|---|---|---|
kind | centerline | yes | |
x1 | number | ||
y1 | number | ||
x2 | number | ||
y2 | number | ||
of | integer[] |
kind: centermark: Guide centre mark (cross) on a circle or arc: give of (its id; it then follows it) or centre and radius.
| Field | Type | Required | Description |
|---|---|---|---|
kind | centermark | yes | |
cx | number | ||
cy | number | ||
r | number | ||
of | integer |
Status
One of: open | resolved
Track
What a source follows.
object: New commits on this branch ("" = the repository's default branch).
| Field | Type | Required | Description |
|---|---|---|---|
branch | string | yes |
object: Locked to this tag's commit (re-checked on sync, in case the tag moved).
| Field | Type | Required | Description |
|---|---|---|---|
tag | string | yes |
object: GitHub's latest release ("latest"); a new release is an update.
| Field | Type | Required | Description |
|---|---|---|---|
release | string | yes |
object: Locked to this commit; sync does nothing.
| Field | Type | Required | Description |
|---|---|---|---|
commit | string | yes |
Vertex
| Field | Type | Required | Description |
|---|---|---|---|
x | number | yes | |
y | number | yes | |
bulge | number | Arc to the next vertex: tan(sweep/4). 0 = straight line, 1 = half circle; positive = clockwise on screen (y points down). |
XtoolIds
How xTool Studio knows a machine.
| Field | Type | Required | Description |
|---|---|---|---|
device | string | yes | xTool's device code, e.g. "JS002" (M2). |
name | string | xTool's short name, e.g. "M2"; missing = the machine's model. |