Agents & MCP
Tool reference
This is the full list of tools Nox gives an agent: 45, in five groups. Each entry says what the tool does and names the arguments you will use most. Required arguments are in bold. The ten tools an agent uses most have an example of arguments, each one run on a real document. The tools describe themselves to the agent in more detail, so use this page to know what to ask for.
Rules every tool shares#
- Ids. A node is named by its id, such as
100:5. Replies give ids, andget_treeandfindlook them up. Wherever an id is asked for, a Nox link (what Edit › Copy Link to Selection, ⌘L, copies) is taken too. - The page shown. Tools that measure, draw and export work on the page that is shown.
- Units and colors. Lengths are the document's units, one pixel at scale 1.
xandyare relative to the parent. Colors are#RRGGBBor#RRGGBBAA. - Errors. A call that cannot be done changes nothing and says what was wrong and what would be right. An unknown property is refused, with the list of properties, and never ignored.
- Undo. Every change is a step that can be taken back. See How agents work in Nox.
- Limits.
create_nodes2,000 nodes a call.update_nodes,move_nodes,delete_nodes500.get_nodes,duplicate_nodes,export_assets,focus_nodes100.batch50 operations.
The tools#
Looking#
| Tool | What it does | Most used arguments |
|---|---|---|
get_context | The pages, the page shown, the selection and the view. Call it first. | none |
get_tree | The outline: id, kind and name of each node, nested. Deeper nodes are counted as child_count. | root, depth (2), limit (200) |
find | Nodes by name, text or kind; all given must hold. With in: "library" it searches what linked libraries offer. | name, text, kind, under, limit (50) |
get_nodes | Every property of the nodes named. | ids |
resolve_link | What a nox:// link names: each node's id, kind, name, path, page and box. | link |
inspect | One node for whoever builds it: its box, its distance to its parent's edges or to another node, what it follows, and the node as CSS and SwiftUI. | node, to, shape |
import_icons | Icon files or folders (SVG, PDF, PNG, JPEG, WebP) brought in as components, one a file. Nox comes with no icons of its own. | paths, size, color, existing |
list_assets | The document's icons, pictures and fonts, and whether this Mac has each font. | kind, query |
embed_fonts | Puts the font files the texts use inside the document, or removes or lists them. | action |
list_colors | Each color used in some nodes, with how often. | ids |
check_design | What a reviewer would raise: contrast, clipped layers, small targets, near colors, unused components and variables, missing fonts, token and flow problems. | root, checks, modes, limit |
check_icon | One icon checked: edges between pixels, unlike stroke weights, open paths, what reaches into the margin. | node, padding |
check_prototype | A page's flows, what each screen reaches, and interactions that do nothing. play follows events. | page, play |
comments | Lists the comments of a page, or adds, resolves, reopens or deletes one. | add, resolve, node, unresolved |
versions | Lists the versions kept, keeps one now, restores or deletes one, or says what differs between two. | keep, restore, diff |
get_tree, one level of a card:
{ "root": "100:1", "depth": 1 }
find, every text that says "trial":
{ "kind": "text", "text": "trial" }
get_nodes, all properties of one node:
{ "ids": ["100:5"] }
check_design, one frame and what is in it:
{ "root": "100:1" }
A finding names the node, the problem in numbers and the fix: #B8BCC6 on #FFFFFF: a contrast of 1.90 to 1, where 4.5 to 1 is asked for ordinary text.
Changing#
Each change these make is one step that can be undone. A few sit in this group and change nothing: list_variables, play_flow, export_strings, export_tokens and get_document_text.
| Tool | What it does | Most used arguments |
|---|---|---|
create_nodes | Makes nodes, each with nested children, inside parent or on the page shown. See Drawing with create_nodes. | nodes, parent |
update_nodes | Changes nodes. Each change names an id and only what changes; null removes a property. | changes |
move_nodes | Another parent, or another place in the stacking order. Also reorders pages. | ids, parent, before, after, at |
duplicate_nodes | Copies nodes, dx and dy apart, count times. fill repeats across or down until the frame is full. | ids, dx, dy, count, fill, into |
arrange_nodes | What the Arrange menu does: group, frame, component, auto layout, ungroup, align, distribute. Not in a batch. | ids, action |
delete_nodes | Deletes nodes with everything in them. | ids |
add_states | Gives a component the states Normal, Pressed, Disabled and Selected as variants; ["Hover"] adds a fifth. | node, states |
replace_color | One color for another throughout some nodes: fills, strokes, gradient stops, shadows. | ids, from, to |
batch | Several changes as one step, all or none. "@0.0" names the first node the first operation made. | operations |
list_variables | Every variable set with its modes, and every variable with its values and its name in CSS, Swift and JSON. | none |
set_variables | Makes or changes many variables of one set by name. A new set needs modes. | set, variables, modes |
play_flow | Plays the prototype where you see it and fires events. Changes nothing. | start, events, stop |
libraries | Another Nox document used as a library: link it, place a component from it, list and apply updates. | action, path, component |
extract_strings | Makes a text variable for each text of a frame, in the set Language, and binds the text to it. | node, set, language |
import_strings | Translations in, from .xcstrings, .strings, JSON or CSV. A language is a mode. | path or text, format, language, create |
export_strings | The strings out, in the same formats. | format, language, path |
export_tokens | The variables as CSS custom properties, a Swift Tokens namespace, or Design Tokens JSON. | format, set, path |
get_document_text | The document, or one node, as text with one property a line. | node |
undo | Takes back the agent's own last step, never yours. redo makes it again. | redo, steps |
import_file | Brings in a .fig or .sketch file as new pages, or an .svg or .pdf as frames of shapes. | path, component, width |
create_nodes, a button that hugs its label:
{
"nodes": [
{
"kind": "frame", "name": "Button", "x": 0, "y": 400, "width": "hug", "height": 44,
"fill": "#5B5BD6", "corner_radius": 10,
"layout": { "direction": "horizontal", "padding": [0, 20], "align": "center", "cross_align": "center" },
"children": [
{ "kind": "text", "name": "Label", "text": "Start free trial",
"font_family": "Inter", "font_size": 15, "font_weight": 600, "fill": "#FFFFFF" }
]
}
]
}
update_nodes, two nodes changed in one call:
{
"changes": [
{ "id": "100:4", "fill": "#5E6472", "font_size": 15, "line_height": 22 },
{ "id": "100:5", "height": 44 }
]
}
batch, a badge made, moved to the top of its card, and a button rounded, as one step:
{
"operations": [
{ "tool": "create_nodes", "arguments": { "parent": "100:1", "nodes": [
{ "kind": "frame", "name": "Badge", "width": "hug", "height": 24, "fill": "#EEF0FF", "corner_radius": 12,
"layout": { "direction": "horizontal", "padding": [0, 10], "cross_align": "center" },
"children": [
{ "kind": "text", "name": "Badge label", "text": "Most popular",
"font_family": "Inter", "font_size": 12, "font_weight": 600, "fill": "#4338CA" }
] }
] } },
{ "tool": "move_nodes", "arguments": { "ids": ["@0.0"], "before": "100:2" } },
{ "tool": "update_nodes", "arguments": { "changes": [{ "id": "100:5", "corner_radius": 22 }] } }
]
}
The tools a batch can hold are create_nodes, update_nodes, move_nodes, delete_nodes, duplicate_nodes, add_states and replace_color.
Showing#
| Tool | What it does | Most used arguments |
|---|---|---|
show_page | Makes a page the one shown, in the app too. | page |
focus_nodes | Shows the nodes to you: their page, selected, and the view filled with them. | ids, zoom (true) |
Out#
| Tool | What it does | Most used arguments |
|---|---|---|
render_preview | A picture of one node, returned in the reply, to check work by eye. It can draw the node in another mode, at another width, with instances in another state, or an icon at several sizes. | node, max_size (800), mode, width, sizes, states |
export_image | One node to one PNG, WebP or JPEG file. | node, path, scale, background, quality |
export_assets | Nodes to files in a folder at each of scales, named after the node, with @2x and @3x. All or none. | ids, folder, format, scales, mode, effects, metadata |
export_svg | A node as SVG, returned in the reply. current_color writes one plain color as currentColor. | node, current_color |
export_pdf | Nodes as the pages of one PDF, shapes as shapes and text as text. | nodes, path |
export_layer | One layer of what an instance shows, alone, as PNG, JPEG, WebP, SVG or PDF. | instance, inside, path, scale |
get_design_spec | A frame as what is to be built: its tree with boxes, colors, typography, tokens, states and the list of assets. | node, depth (12), scales, mode |
render_preview, a card drawn in the Dark mode of its variables, 640 pixels on its longest side:
{ "node": "100:1", "max_size": 640, "mode": "Dark" }
get_design_spec, a whole frame:
{ "node": "100:1" }
export_assets, a card and its button at 1x and 2x, with room for their shadows:
{ "ids": ["100:1", "100:5"], "folder": "/Users/me/Project/assets", "scales": [1, 2], "effects": true }
This run wrote Plan card.png, Plan card@2x.png, Button.png and Button@2x.png. The folder must exist.
Checking#
| Tool | What it does | Most used arguments |
|---|---|---|
compare_image | Holds a PNG of the built thing against the node it was built from. Says how much differs, where, and on which nodes, and returns a picture with the differences in red. | node, image, tolerance (24), mode |
Which tool, when#
- To start:
get_context, thenget_treeorfind. - To draw:
create_nodesfor something new,update_nodesfor a change,batchwhen several changes are one thing to you. - To finish:
check_design, thenrender_preview. - To hand off:
get_design_spec,export_assets,export_tokens, thencompare_imageon the build.
Agent recipes shows these loops call by call.