Skip to content

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.

ParameterTypeRequiredDescription
documentintegeryesThe 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.

ParameterTypeRequiredDescription
textstringyes
atnumber[]Where the pin goes (mm); default the centre of items.
itemsinteger[]Item ids it is about.
authorstringYour name, shown on the comment (default "agent").
documentintegerThe 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.

ParameterTypeRequiredDescription
typeKindyesA geometric constraint (not dim_*). Two-object constraints keep the first object and move the second, as in AutoCAD.
refsRef[]yesThe geometry: e.g. [{"kind":"segment","item":3,"segment":0}, {"kind":"point","item":4,"vertex":1}]. Symmetric takes the two objects, then the symmetry line.
documentintegerThe 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.

ParameterTypeRequiredDescription
typeDimTypeyes
refsRef[]yesTwo points, or one line (linear, aligned); two lines (angular); an arc or circle segment (radius, diameter).
namestringParameter name; default d1, ang1, rad1, dia1, ….
valueanyA number (mm or degrees) or an expression of other parameters such as "d1 / 2". Default: what it measures now.
offsetnumberWhere 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
itemsNewItem[]
pathstringOr a JSON file (absolute path) holding the same items array (or {"items": [...]}), for big batches.
selectbooleanSelect the new items in the GUI (default false: the user's selection stays as it is).
inferbooleanJoin 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.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
namestringyes
opOpyes
currentbooleanMake it the layer new shapes drawn in the GUI go on.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Items to move; empty = the selection.
source1number[]yes
dest1number[]yes
source2number[]Second pair: the items also turn so source1→source2 lies along dest1→dest2.
dest2number[]
scalebooleanWith a second pair: also scale so the two lines have the same length.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]
countintegeryesItems in total, the original included.
centrenumber[]yes
anglenumberDegrees to spread them over, positive = clockwise; default 360 (evenly round).
rotatebooleanTurn the copies with the angle (default true); false only moves them.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]
rowsintegeryes
columnsintegeryes
dxnumberDistance between columns in mm (negative = to the left).
dynumberDistance between rows in mm (positive = down).
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the selection.
tolerancenumberDistance tolerance in mm (default 0.05).
angle_tolerancenumberAngle tolerance in degrees (default 1).
documentintegerThe 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).

ParameterTypeRequiredDescription
idsinteger[]Two or more closed paths; empty = the selection. For difference the first one is the base.
operationBoolOpyes
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegerItem id; missing = the single selected item.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegeryes
atnumber[]yesBreak point (the nearest point on the path).
at2number[]Second point: the piece between at and at2 is removed (on a closed shape the shorter way round).
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the selection. Two open lines/polylines are joined where they meet, and that corner is cut.
distancenumberyesHow far back along the incoming side (or the first item) the cut starts, in mm.
distance2numberAlong the outgoing side (or the second item); default = distance.
atnumber[]Only cut the corner nearest this point; missing = every sharp corner.
firstObjectPickTwo-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.
secondObjectPickThe second object and where it was picked.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
documentintegeryesThe document's id (list_documents).
discard_changesbooleanClose 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Constraint ids.
itemsinteger[]Also every constraint on these items (AutoCAD DELCONSTRAINT).
documentintegerThe 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).

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegeryes
move_tointegerLayer to move the items to; without it a layer that has items is not deleted.
documentintegerThe 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.

ParameterTypeRequiredDescription
idstringyesMachine id (list_machines).
forcebooleanDelete it even though materials have settings for it (those settings stay, unused).
documentintegerThe 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.

ParameterTypeRequiredDescription
idstringyesMaterial id (list_materials).
documentintegerThe 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.

ParameterTypeRequiredDescription
materialstringyesMaterial id.
machinestringyesMachine id.
laserstringyesLaser module id of that machine.
operationOperationyes
namestringProfile name; "" or missing = the default (unnamed) profile.
documentintegerThe 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).

ParameterTypeRequiredDescription
idsinteger[]
dxnumber
dynumber
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyesWhere to write the .dxf.
include_no_outputbooleanInclude no_output layers (notes, helpers). Default false, because laser software would burn them.
documentintegerThe 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).

ParameterTypeRequiredDescription
pathstringyesWhere to write the library file: .scrlib, or .zip for a library zip (your own items only).
machinesstring[]Machine ids; with both lists missing everything is exported.
materialsstring[]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.

ParameterTypeRequiredDescription
dirstringyesThe repository's folder (its root): a new folder, or an existing (git) repository to update in place.
machinesstring[]Machine ids of the user's own; both lists missing = all the user's own machines and materials.
materialsstring[]Material ids of the user's own.
namestringOnly for a new repository (no .scriber.json yet): its name (default: the folder name) and description.
descriptionstring

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.

ParameterTypeRequiredDescription
pathstringWhere to write the PNG. Without a path the image is returned so you can look at it.
dpinumberResolution; default: 2048 px on the material's longest side. Images returned inline stay under 8000 px.
include_annotationsbooleanDefault true.
previewbooleanRender 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).
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyes
include_annotationsbooleanInclude no_output items (notes, dimensions, helpers). Default false, because laser software would burn them.
documentintegerThe 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).

ParameterTypeRequiredDescription
pathstringyesWhere to write the .xs project.
include_no_outputbooleanPut no_output layers in as reference: on the canvas, marked not to be processed. Default true; false leaves them out.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegeryes
atnumber[]yesA point near the open end to extend.
boundariesinteger[]Boundary items; empty = every other path and guide line.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the selection. Two open lines/polylines are joined where they meet, and that corner is rounded.
radiusnumberyesArc radius in mm (0 with two open items just joins them into a sharp corner).
atnumber[]Only round the corner nearest this point; missing = every sharp corner.
firstObjectPickTwo-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.
secondObjectPickThe second object and where it was picked.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Only these items; empty = all. Picked items come with their geometry unless geometry is false.
geometrybooleantrue: 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.
documentintegerThe 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).

ParameterTypeRequiredDescription
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyesDXF file to import (ASCII or binary, R12 to 2018).
layersobjectOp 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.
xnumberLeft edge of the drawing in mm; default: where the file puts it (DXF origin = the material's bottom-left corner).
ynumberTop edge of the drawing in mm (give x and y together).
tolerancenumberLargest distance in mm between an ellipse or spline and the arcs that replace it. Default 0.01.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringFile to import (PNG, JPEG, WebP, BMP, GIF, TIFF).
data_base64stringOr the image bytes, base64 encoded.
xnumber
ynumber
widthnumberWidth in mm; height follows the aspect ratio. Default 10 px per mm, capped to the material.
namestring
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyesA .scrlib file or a library zip (.zip).
on_conflictOnConflictyesFor 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).

ParameterTypeRequiredDescription
pathstringSVG file to import.
datastringOr the SVG itself: its text, or base64.
xnumberLeft edge of the drawing in mm; default: where the file puts it.
ynumberTop edge of the drawing in mm; default: where the file puts it.
widthnumberScale the drawing to this width in mm (overrides scale).
scalenumberExtra factor on the file's own size; 1.333 (96/72) for 72 DPI files. Default 1.
tolerancenumberLargest distance in mm between a curve and the arcs that replace it. Default 0.01.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyesPath to the xTool Studio project (.xs).
activatebooleanShow 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.

ParameterTypeRequiredDescription
idsstring[]yesMaterial ids from search_xtool_materials, e.g. "123".
machinestringThe Scriber machine to import the settings for; missing = the document's machine if it has settings for it, else the first machine that has.
overwritebooleanReplace materials imported earlier from the same xTool entry instead of adding copies.
dirstringxTool Studio's data folder, when it is not in the usual place.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyesPath to an xTool Studio project (.xs).
overwriteboolean

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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegeryes
atnumber[]yesA point near the open end to change.
deltanumberChange in length, mm (negative shortens).
totalnumberOr the new total length of the contour, mm.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
statusStatusOnly open or only resolved ones.
since_revisionintegerOnly those changed after this revision (from an earlier reply).
documentintegerThe 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.

ParameterTypeRequiredDescription
documentintegerThe 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).

ParameterTypeRequiredDescription
documentintegerThe 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).

ParameterTypeRequiredDescription
machinestringOnly 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.

ParameterTypeRequiredDescription
dirstringAlso 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.

ParameterTypeRequiredDescription
sourceintegeryes
targetsinteger[]Items that get the source's laser operation (and font, text to text); empty = the selection.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]
fromnumber[]Also measure the straight distance between two points.
tonumber[]
documentintegerThe 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).

ParameterTypeRequiredDescription
widthnumber
heightnumber
activatebooleanMake 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.

ParameterTypeRequiredDescription
idsinteger[]
distancenumberyesmm. Positive = outward for closed shapes (holes shrink), to the left on screen for open ones; negative = inward / right.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
pathstringyesPath to the .scrbr file.
activatebooleanShow 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.

ParameterTypeRequiredDescription
documentintegerThe 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.

ParameterTypeRequiredDescription
opOp
kindstringline, arc, circle, polyline, closed shape, compound path, text, dimension, image or guide.
min_sizenumberSize range on the longer side of the bounding box, mm.
max_sizenumber
documentintegerThe open document to work on (id from list_documents); missing = the active tab, the one the person sees.

redo ​

Redo the last undone change.

ParameterTypeRequiredDescription
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegeryes
textstringyes
resolvebooleantrue resolves it with the reply, false reopens it.
authorstringYour name (default "agent").
documentintegerThe 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).

ParameterTypeRequiredDescription
idintegeryes
authorstringYour name (default "agent").
documentintegerThe 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.

ParameterTypeRequiredDescription
idstringyesId of a deleted built-in machine.
documentintegerThe 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).

ParameterTypeRequiredDescription
pathstringPath to the .scrbr file; missing = the document's own file.
documentintegerThe 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.

ParameterTypeRequiredDescription
machineMachineyesThe 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.

ParameterTypeRequiredDescription
idstringExisting material to change; missing = add a new one (name and thickness needed).
namestring
thicknessnumbermm
categoryCategoryWhat kind of material (for filtering); a new material without one is "other".
notesstring
colorinteger[]The sheet's colour in the laser preview as [r, g, b] (0-255); [] clears it (back to wood).
burn_colourinteger[]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.

ParameterTypeRequiredDescription
querystringWords that must all appear in the name (case-insensitive); missing = all.
machinestringOnly materials that can be imported for this Scriber machine id (e.g. "xtool-m2").
include_other_machinesbooleanAlso list materials that only have settings for xTool machines not in the user's library.
dirstringxTool Studio's data folder, when it is not in the usual place (or set SCRIBER_XTOOL_DIR).
documentintegerThe 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).

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
documentintegerThe 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.

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
documentintegerThe 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.

ParameterTypeRequiredDescription
widthnumberyes
heightnumberyes
documentintegerThe 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.

ParameterTypeRequiredDescription
machinestringMachine id; "" = none; missing = unchanged.
laserstringLaser module id of the machine; missing = unchanged, or the machine's first module when the machine changes.
materialstringMaterial id; "" = none; missing = unchanged.
use_work_areabooleanAlso set the material (canvas) size to the machine's work area.
documentintegerThe 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.

ParameterTypeRequiredDescription
idstringyes
trackTrackFollow something else (syncs right away): {"branch": ""}, {"tag": "v1.2"}, {"release": "latest"} or {"commit": "<sha>"}.
enabledbooleanUse 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.

ParameterTypeRequiredDescription
materialstringyesMaterial id.
machinestringyesMachine id.
laserstringyesLaser module id of that machine.
operationOperationyes
namestringProfile 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.
powernumberyesPower in percent (0–100).
speednumberyesSpeed in mm/s.
passesinteger
line_intervalnumberEngrave only: distance between engraved lines in mm. People see it as lines per cm = 10 / this (0.1 mm = 100 lines/cm).
bidirectionalbooleanEngrave only: engrave in both directions.
preview_opacitynumberHow 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).

ParameterTypeRequiredDescription
notesstringyes
documentintegerThe 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.

ParameterTypeRequiredDescription
namestringyes
valueanyA number or an expression of other parameters ("d1 * 2 + 5"). Leave out to only rename.
renamestringRename the parameter (expressions that use it follow); a letter, then letters, digits or _, not taken.
documentintegerThe 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.

ParameterTypeRequiredDescription
windownumber[]yesCrossing window [x, y, width, height]: every point inside it moves.
dxnumberyes
dynumberyes
idsinteger[]Only these items; empty = every item the window catches.
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
urlstringyesowner/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].
trackTrackWhat 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).

ParameterTypeRequiredDescription
idstringSource 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).

ParameterTypeRequiredDescription
idsinteger[]
dxnumber
dynumber
rotatenumberDegrees, positive = clockwise on screen.
scale_xnumberScale factors; 0 or missing means 1.
scale_ynumber
mirror_xbooleanMirror left-right / top-bottom.
mirror_yboolean
pivotnumber[]Centre of rotation/scale/mirror; defaults to the centre of the items' bounding box.
copybooleanTransform copies and leave the originals where they are (e.g. mirror_x with copy for a mirrored copy).
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegerThe item to trim; missing = the single selected item.
atnumber[]yesA point on the piece to remove.
edgesinteger[]Cutting edges; empty = every other path.
constrainbooleanKeep each new end on the edge it was trimmed against (a coincident constraint, as INFER does while drawing). Default true.
verbosebooleanReply 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.
documentintegerThe 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).

ParameterTypeRequiredDescription
documentintegerThe 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).

ParameterTypeRequiredDescription
idsinteger[]Item ids; empty = the user's current selection.
documentintegerThe 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.

ParameterTypeRequiredDescription
idstringyesSource 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.

ParameterTypeRequiredDescription
idintegeryes
namestring
layerintegerMove it to this layer (see list_layers); wins over op.
opOpMove it to the first layer with this op (made if there is none).
fillbooleanDeprecated, kept for old clients: true means op engrave.
notestring
shapeShapeInputReplace the geometry.
fontstringText only: change the font family (see list_fonts), keeping everything else.
rotationnumberTurn 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).
verbosebooleanReply 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.
documentintegerThe 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.

ParameterTypeRequiredDescription
idintegeryes
namestring
opOpChanges what the laser does with every item on the layer.
colorinteger[]Canvas colour as [r, g, b]; [] = the op's colour.
settingsOverridesReplaces 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_cmnumberEngrave layers: the layer's own line spacing in lines per cm (10 / mm between lines; 100 = 0.1 mm); null = the material library's.
profilestringThe material's profile for the layer's op (a setting's name, see list_materials); "" = the default one.
image_modestringEngrave 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.
visiblebooleanHidden layers are not drawn, lasered or exported.
lockedbooleanItems on a locked layer cannot be selected or edited.
orderintegerNew position in the list (0 = first).
currentbooleanMake it the current layer (where shapes drawn in the GUI go).
documentintegerThe 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.

ParameterTypeRequiredDescription
documentintegerOnly this open document's comments; missing = every open document (each reply names its document).
since_revisionintegerThe revision from the last list_annotations / wait_for_annotations reply; missing = now.
timeout_snumberSeconds 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.

FieldTypeRequiredDescription
verticesVertex[]yes
closedboolean

CurveSegment ​

One segment of a curve.

FieldTypeRequiredDescription
tonumber[]yes
controlsnumber[][]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.

FieldTypeRequiredDescription
idstringyesScriber's id, stored on layers, e.g. "bayer".
namestringyesWhat people see, e.g. "Bayer".
valuestringyesWhat 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/&lt;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.

FieldTypeRequiredDescription
idstringyesUnique within the machine, e.g. "diode-20w".
namestringyes
kindLaserKindyes
power_wnumberyesLaser power in watts.
opsOperation[]What it can do.
areanumber[]Work area [width, height] in mm when it differs from the machine's.
xtool_laserstringxTool Studio's name for this module, e.g. "laser_blue_10W"; missing = derived (xtool_default).

LaserKind ​

One of: diode | co2 | fiber | infrared

Machine ​

FieldTypeRequiredDescription
idstringyesUnique key, e.g. "xtool-m2".
namestringyes
vendorstring
modelstring
widthnumberyesWork area width in mm.
heightnumberyesWork area height in mm.
lasersLaser[]
notesstring
sourcestringWhere the numbers come from, and which ones are unverified.
xtoolXtoolIdsxTool Studio's ids for this machine (.xs export, importing xTool materials).
image_modesImageModesHow its software can engrave images (greyscale, dithers); the first is the default. Missing = none to choose from.

NewItem ​

FieldTypeRequiredDescription
shapeShapeInputyes
layerintegerLayer id (see list_layers); wins over op.
opOpWithout a layer: the first layer with this op (made if there is none). Default cut; engrave for text; no_output for dimensions and guides.
fillbooleanDeprecated, kept for old clients: true means op engrave.
namestring
notestring

ObjectPick ​

An object picked at a point: the point chooses the segment, the side kept and which corner is meant.

FieldTypeRequiredDescription
idintegeryes
atnumber[]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 (see Item::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.

FieldTypeRequiredDescription
powernumberPower in percent (0–100).
speednumberSpeed in mm/s.
passesinteger

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.

FieldTypeRequiredDescription
kindpointyes
itemintegeryes
contourinteger
vertexintegeryes

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.

FieldTypeRequiredDescription
kindsegmentyes
itemintegeryes
contourinteger
segmentintegeryes

kind: centre: The centre of the arc or circle segment, used as a point.

FieldTypeRequiredDescription
kindcentreyes
itemintegeryes
contourinteger
segmentintegeryes

kind: item: The whole item (every vertex), for fix.

FieldTypeRequiredDescription
kinditemyes
itemintegeryes

ShapeInput ​

kind: line

FieldTypeRequiredDescription
kindlineyes
x1numberyes
y1numberyes
x2numberyes
y2numberyes

kind: rect: Rectangle with top-left corner (x, y); corner_radius rounds the corners.

FieldTypeRequiredDescription
kindrectyes
xnumberyes
ynumberyes
wnumberyes
hnumberyes
corner_radiusnumber

kind: circle

FieldTypeRequiredDescription
kindcircleyes
cxnumberyes
cynumberyes
rnumberyes

kind: arc: Arc around (cx, cy) from start to end degrees, clockwise on screen (0° = right, 90° = down).

FieldTypeRequiredDescription
kindarcyes
cxnumberyes
cynumberyes
rnumberyes
startnumberyes
endnumberyes

kind: polygon: Regular polygon; r is the distance from centre to corners; the first corner points up before rotation.

FieldTypeRequiredDescription
kindpolygonyes
cxnumberyes
cynumberyes
rnumberyes
sidesintegeryes
rotationnumber

kind: polyline: Straight segments through the points.

FieldTypeRequiredDescription
kindpolylineyes
pointsnumber[][]yes
closedboolean

kind: path: Full control: one or more contours with arc bulges (several = compound path).

FieldTypeRequiredDescription
kindpathyes
contoursContour[]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.

FieldTypeRequiredDescription
kindcurveyes
startnumber[]yes
segmentsCurveSegment[]yes
closedboolean
tolerancenumber

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.

FieldTypeRequiredDescription
kindtextyes
xnumberyes
ynumberyes
sizenumberyes
textstringyes
rotationnumber
fontstring
boldboolean
italicboolean

kind: dimension: A measurement from point 1 to point 2, drawn offset mm to the left of that direction.

FieldTypeRequiredDescription
kinddimensionyes
x1numberyes
y1numberyes
x2numberyes
y2numberyes
offsetnumber

kind: xline: Guide line (construction line, never lasered or exported): endless through (x, y) at angle degrees (clockwise, 0 = right).

FieldTypeRequiredDescription
kindxlineyes
xnumberyes
ynumberyes
anglenumberyes

kind: ray: Guide ray from (x, y) to infinity at angle degrees.

FieldTypeRequiredDescription
kindrayyes
xnumberyes
ynumberyes
anglenumberyes

kind: centerline: Guide centre line between two lines: give of (the two line ids; it then follows them) or the end points.

FieldTypeRequiredDescription
kindcenterlineyes
x1number
y1number
x2number
y2number
ofinteger[]

kind: centermark: Guide centre mark (cross) on a circle or arc: give of (its id; it then follows it) or centre and radius.

FieldTypeRequiredDescription
kindcentermarkyes
cxnumber
cynumber
rnumber
ofinteger

Status ​

One of: open | resolved

Track ​

What a source follows.

object: New commits on this branch ("" = the repository's default branch).

FieldTypeRequiredDescription
branchstringyes

object: Locked to this tag's commit (re-checked on sync, in case the tag moved).

FieldTypeRequiredDescription
tagstringyes

object: GitHub's latest release ("latest"); a new release is an update.

FieldTypeRequiredDescription
releasestringyes

object: Locked to this commit; sync does nothing.

FieldTypeRequiredDescription
commitstringyes

Vertex ​

FieldTypeRequiredDescription
xnumberyes
ynumberyes
bulgenumberArc 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.

FieldTypeRequiredDescription
devicestringyesxTool's device code, e.g. "JS002" (M2).
namestringxTool's short name, e.g. "M2"; missing = the machine's model.