Kalka
v0.2.0-rc.1-1Lets AI agents edit designs in Kalka, the design app where every layer is real HTML and CSS.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_selection
Get the selected nodes: the place to start when the user points at layers. Returns each selected node with its direct children by default; children past the depth are counted as childCount. Use get_node or describe for deeper branches.
| Parameter | Type | Description |
|---|---|---|
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_node
Get detailed properties of a node by ID. Use depth to limit child recursion (0 = node only, 1 = direct children, etc). Default: unlimited.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
find_nodes
Find layers by name, type, text, CSS style value, or variable (token), for audits and bulk edits. Filters combine (all must match). Searches the current page unless within, page, or root_id says otherwise. - style { property, value }: matches the CSS Kalka projects for each layer (its fields as CSS plus its own CSS). Colors are equivalent across hex, rgb, hsl and oklch within tolerance; lengths compare in px. Each match names the variables bound to that property. - variable: name, ID, or CSS custom property (--color-primary) of a variable. variable_match "bound" (default) finds layers bound t…
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
limit | ||
name | string | Layer name: substring, or a pattern with * and ? (case-insensitive) |
page | string | With within "page": page name or ID instead of current |
page_id | string | Optional page ID to target within the document |
root_id | string | |
style | object | Match layers by a CSS declaration of their projected CSS |
text | string | Text layer content: substring, or a pattern with * and ? (case-insensitive) |
tolerance | ||
type | string | Node type filter |
variable | string | Variable name (color/primary), ID, or CSS custom property (--color-primary) |
variable_match | string | With variable: bound layers (default), unbound layers holding its value, or both |
within | string | Search the current page (default), the selected layers, or every page |
get_jsx
Get JSX representation of a node and its children. Compact round-trip format — same syntax as the render tool. JSX longer than 12000 characters is cut, and the result says so.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path | string | Write the complete JSX to this path instead of returning it (requires KALKA_MCP_ROOT) |
get_html
Get a layer and its children as HTML with CSS, the same code Kalka exports, each element marked with its layer id in data-kalka-node-id. style "inline" puts CSS on each element; "tailwind" uses Tailwind classes. Images are not embedded: each is a kalka-image:<hash> reference, listed in images with its type, pixel size and byte length. write_html accepts these references back as the same images; to see one, call export_image with the id of the element that shows it.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
style | string | CSS form |
get_screenshot
See a layer as it looks: a PNG of the layer, or of the whole current page when no id is given. Use after writing or restyling to check the result.
| Parameter | Type | Description |
|---|---|---|
delivery | string | "inline" (default) returns the file in the response, plus a short-lived URL when the server has one; "url" returns only the URL and metadata, which keeps the response small and allows files too large… |
document_id | string | Optional Kalka document/tab ID to target |
id | string | Node ID |
maxEdge | ||
page_id | string | Optional page ID to target within the document |
scale |
get_computed_styles
Get the CSS the browser computed for a layer as the canvas draws it: the final values after layout, inheritance and defaults, such as resolved widths in px. Use it to check why a layout looks the way it does. Works on layers of the page shown on the canvas.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
properties | array | CSS property names; a layout and type set by default, [] for all |
render
Render JSX to design nodes. Supports inline SVG paths, including open stroked paths: <svg viewBox="0 0 24 24" size={24}><path d="M2 12 L22 12" stroke="#000" fill="none" /></svg>. Use replace_id to replace a placeholder while preserving its position. Render one visual group per call, such as one section of a page into its parent, so the user watches the design build.
| Parameter | Type | Description |
|---|---|---|
jsx * | string | JSX string to render |
document_id | string | Optional Kalka document/tab ID to target |
insert_index | ||
page_id | string | Optional page ID to target within the document |
parent_id | string | Parent node ID to render into |
replace_id | string | Node ID to replace — new node takes its position in parent, old node is deleted |
x | ||
y |
write_html
Write HTML and CSS into the design as editable layers: elements become frames and text, flex layouts become auto layout, inline styles and <style> rules are kept, and a rule for one class (.btn { ... }) becomes a document class its layers share. Scripts and event handlers are dropped; a kalka-image:<hash> source from get_html is the document image it names. <kalka-instance component="Button"></kalka-instance>, with a component name or id, places an instance of it, so sections are composed from the design system components. Use parent_id to write into a frame and replace_id to replace a placeho…
| Parameter | Type | Description |
|---|---|---|
html * | string | HTML to write, optionally with <style> |
document_id | string | Optional Kalka document/tab ID to target |
insert_index | ||
page_id | string | Optional page ID to target within the document |
parent_id | string | Frame or page to write into |
replace_id | string | Layer to replace; the new layers take its place |
x | ||
y |
edit_html
Change part of a layer with an exact find and replace in its HTML, as get_html returns it (inline style): copy, a color, one element, a spacing value. find must occur exactly once: include enough surrounding markup to make it unique. The layer is rewritten in place, so its layers get new ids, listed in layers. Prefer it to resending the whole section with write_html for small changes.
| Parameter | Type | Description |
|---|---|---|
find * | string | Exact text to find, once |
id * | string | Node ID |
replace * | string | Text to put in its place |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
update_node
Update properties of an existing node: position, size, opacity, corner radius, visibility, text, font.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
corner_radius | ||
document_id | string | Optional Kalka document/tab ID to target |
flow_direction | string | Auto-layout flow direction for FRAME nodes |
font_size | ||
font_weight | ||
height | ||
name | string | Layer name |
opacity | ||
page_id | string | Optional page ID to target within the document |
text | string | Text content (TEXT nodes) |
text_direction | string | Text direction for TEXT nodes |
visible | boolean | Visibility |
width | ||
x | ||
y |
update_styles
Change a layer with CSS declarations, such as { "padding": "24px", "background-color": "#2F5BEA", "display": "flex", "gap": "12px", "border-radius": "16px" } or, on text, { "font-size": "40px", "color": "#121214" }. Only the given properties change.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
styles * | object | CSS properties in kebab-case and their values |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_html_element
Set the HTML tag and class names a layer is exported with, such as tag "h1" for a title, "nav" for a menu, "a" or "button" for an action, and classes "hero card". The tag changes the semantics only: the layer keeps its look. A class the layer did not have brings its CSS; a class the document lacks becomes one with the look the layer has now (see update_css_class). "auto" restores the tag its type gives (a frame is a div, a text a span). Vectors and images keep <svg> and <img>.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
classes | Class names, space-separated or as a list; replaces the current ones | |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
tag | string | HTML tag, or "auto" |
get_css_classes
List the document's CSS classes in stylesheet order: each one's CSS, whether it styles boxes or text, and how many layers use it. Layers name classes with set_html_element.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
update_css_class
Create a CSS class or change its CSS, such as { "background-color": "#2F5BEA", "border-radius": "999px", "padding": "14px 26px" }, or on a text class { "font-size": "18px", "color": "#121214" }. Only the given properties change, and every layer with the class follows unless it set that value itself. kind says whether a new class styles boxes or text.
| Parameter | Type | Description |
|---|---|---|
name * | string | Class name, without the dot |
styles * | object | CSS properties in kebab-case and their values |
document_id | string | Optional Kalka document/tab ID to target |
kind | string | For a new class |
page_id | string | Optional page ID to target within the document |
edit_css_class
Manage a CSS class: update_from_layer makes the layer's own values (id) part of the class, so all its layers take them; reset_layer drops the layer's own values for its classes'; rename gives the class and its layers new_name; delete removes the class and leaves its layers as they look.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
document_id | string | Optional Kalka document/tab ID to target |
id | string | Node ID |
name | string | Class name, without the dot |
new_name | string | Class name, without the dot |
page_id | string | Optional page ID to target within the document |
add_breakpoint
Add a breakpoint to a top-level artboard: a linked copy at a narrower width (810 for tablet, 390 for phone) placed next to it. Its layers follow the wider artboard until you change them in the breakpoint with update_styles or update_node; those changes become @media rules in the HTML export. Adding, deleting or moving a layer in any of the artboards changes the shared structure.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
width * | ||
document_id | string | Optional Kalka document/tab ID to target |
name | string | Artboard name, such as "Phone" |
page_id | string | Optional page ID to target within the document |
set_layout
Set auto-layout (flexbox) on a frame. Direction, alignment, spacing, padding.
| Parameter | Type | Description |
|---|---|---|
id * | string | Frame node ID |
align | string | Primary axis alignment (only changes if provided) |
counter_align | string | Cross axis alignment (only changes if provided) |
direction | string | Layout direction (keeps current if omitted) |
document_id | string | Optional Kalka document/tab ID to target |
flow_direction | string | Child flow direction for auto-layout. AUTO inherits from parent. |
padding | ||
padding_horizontal | ||
padding_vertical | ||
page_id | string | Optional page ID to target within the document |
spacing |
set_layout_child
Configure auto-layout child: sizing (FIXED/HUG/FILL), grow, alignment, absolute positioning.
| Parameter | Type | Description |
|---|---|---|
id * | string | Child node ID |
align_self | string | Self alignment override (cross-axis) |
document_id | string | Optional Kalka document/tab ID to target |
grow | ||
page_id | string | Optional page ID to target within the document |
positioning | string | ABSOLUTE to take node out of auto-layout flow |
sizing_horizontal | string | Horizontal sizing mode |
sizing_vertical | string | Vertical sizing mode |
set_radius
Set corner radius. Use individual corners for independent values.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
bottom_left | ||
bottom_right | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
radius | ||
top_left | ||
top_right |
set_fill
Set fill on a node. Solid: color="#ff0000". Linear gradient: gradient="top-bottom" or "left-right" with color (start) and color_end (end).
| Parameter | Type | Description |
|---|---|---|
color * | string | Color (hex). For gradient: start color. |
id * | string | Node ID |
color_end | string | End color for gradient (if omitted, solid fill) |
document_id | string | Optional Kalka document/tab ID to target |
gradient | string | Gradient direction |
page_id | string | Optional page ID to target within the document |
set_stroke
Set the stroke (border) of a node.
| Parameter | Type | Description |
|---|---|---|
color * | string | Stroke color (hex) |
id * | string | Node ID |
align | string | Stroke alignment |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
weight |
set_text
Set text content of a text node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
text * | string | Text content |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_text_properties
Set text layout properties: alignment, auto-resize, text case, decoration, truncation.
| Parameter | Type | Description |
|---|---|---|
id * | string | Text node ID |
align_horizontal | string | Horizontal text alignment |
align_vertical | string | Vertical text alignment |
auto_resize | string | Text auto-resize mode |
direction | string | Text direction |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
text_decoration | string | Text decoration |
delete_node
Delete a node by ID.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID to delete |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
reparent_node
Move a node into a different parent.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID to move |
parent_id * | string | New parent node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_resize
Resize a node.
| Parameter | Type | Description |
|---|---|---|
height * | ||
id * | string | Node ID |
width * | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
batch_update
Execute multiple modifications in one call, all or nothing: if any operation names a missing node or an invalid prop, nothing changes. Each operation is {id, props} where props can include: spacing, padding, padding_horizontal, padding_vertical, align, counter_align, sizing_horizontal, sizing_vertical, grow, name, visible, corner_radius, opacity, auto_resize, direction. Runs all updates with one layout recompute.
| Parameter | Type | Description |
|---|---|---|
operations * | string | JSON array: [{"id":"0:5","props":{"spacing":8}},{"id":"0:6","props":{"sizing_horizontal":"FILL","grow":1}}] |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
stock_photo
Search stock photos and apply to leaf image placeholders or closed area geometry. Pass a JSON array; each item is {id, query, index?, orientation?}. Containers with content, text, lines, and structural nodes are rejected.
| Parameter | Type | Description |
|---|---|---|
requests * | string | JSON array: [{"id":"0:5","query":"mountain sunset"},{"id":"0:8","query":"business team","orientation":"square"}] |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
search_fonts
Search the free font catalogue (every Google Fonts family and other open-licence ones) by family name. Returns families with their category, licence, weights, styles, whether they are variable, and whether the document already carries them. Use it when choosing a typeface, then add_font to keep the one you pick with the document.
| Parameter | Type | Description |
|---|---|---|
query * | string | Family name or part of it, e.g. "grotesk" |
document_id | string | Optional Kalka document/tab ID to target |
limit | integer | Default 20 |
page_id | string | Optional page ID to target within the document |
add_font
Download an open-licence family from the free font catalogue into the document, with its licence file, and load it, so text set in it draws the same offline, for teammates and in exported HTML. Call it for every family you set text in that the computer may not have. Returns the weights and styles it carries; an unknown name returns close names instead.
| Parameter | Type | Description |
|---|---|---|
family * | string | Exact family name, e.g. "Inter Tight" |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
describe
Semantic description of one or more nodes. Pass `id` for a single node, or `ids` for multiple nodes in one call. Omit depth for auto — adapts to subtree size (small block → deeper, large page → shallower).
| Parameter | Type | Description |
|---|---|---|
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
grid | ||
id | string | Node ID (single node) |
ids | array | Node IDs (multiple nodes in one call) |
page_id | string | Optional page ID to target within the document |
diff_create
Patch that turns one node tree into another, as JSX attribute changes per node plus moved, added, and removed children. Children are matched by name. Apply it to the first tree with diff_apply.
| Parameter | Type | Description |
|---|---|---|
from * | string | Source node ID |
to * | string | Target node ID |
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
diff_jsx
Structural diff between two nodes in JSX format. Shows added/removed children, changed props.
| Parameter | Type | Description |
|---|---|---|
from * | string | Source node ID |
to * | string | Target node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
diff_visual
Pixel diff between two rendered nodes. Returns a PNG with changed pixels in red over a faded copy of the source, the changed pixel ratio, and the changed region in source-node coordinates. Use it to confirm an edit only touched the intended area.
| Parameter | Type | Description |
|---|---|---|
from * | string | Source node ID |
to * | string | Target node ID |
delivery | string | "inline" (default) returns the file in the response, plus a short-lived URL when the server has one; "url" returns only the URL and metadata, which keeps the response small and allows files too large… |
document_id | string | Optional Kalka document/tab ID to target |
maxEdge | ||
page_id | string | Optional page ID to target within the document |
scale | ||
threshold |
calc
Arithmetic calculator. ALWAYS use instead of mental math. Pass one expression or a JSON array of expressions — all evaluated in one call. Supports: + - * / % ** ( ) min max floor ceil round abs sqrt pow. Examples: "844 - 56 - 96 - 82", '["1440 * 8 / 12", "(952 - 16) / 2", "floor(390 * 0.6)"]'
| Parameter | Type | Description |
|---|---|---|
expr * | string | Single expression or JSON array of expressions |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
viewport_zoom_to_fit
Zoom viewport to fit specified nodes.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to fit in view |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
finish_working_on_nodes
Tell the user you are done with layers you were building. While you work, the canvas marks the layers you write with your name; call this when a section or the whole design is finished. Pass node_ids for the sections you finished (layers inside them go too), or nothing to release everything you worked on.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
node_ids | array | Layers you finished. Omit to release everything you are working on. |
page_id | string | Optional page ID to target within the document |
set_status
Tell the user what you are doing now, in a few words such as "Composing the hero" or "Checking the phone layout"; the canvas shows it next to your name while you work. Call it when you start each step of a larger design. An empty text clears it.
| Parameter | Type | Description |
|---|---|---|
text * | string | What you are doing now, a few words |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
plan_sections
Announce the sections of the page you are about to design, top to bottom, before you draw the first one: each with a short name such as "Hero" or "Pricing" and its approximate height in pixels. The canvas shows them as empty outlines that turn into the real sections as you build them, so the user sees the whole page coming. Heights are estimates; the outlines follow what you really build. Call it again with the full list when the plan changes. An empty list clears it.
| Parameter | Type | Description |
|---|---|---|
sections * | array | Every section of the page, in order from the top |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_design_guide
Read how to design in Kalka: decide on a direction, set up variables and components, compose screens from them, and review your work, plus the anti-slop catalogue of what makes a design look machine-made and the style system (global rules, colour and type direction, and the index of styles you may pick from with read_style, or not). Call it once before you design a page or screen, and again if the conversation got long.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
read_style
Read the full guide of one style from the style index: its grid, type, spacing, colour, surfaces, hero and section patterns, imagery, signature moves, anti-patterns and self-check. Call it once the style is chosen (by you, or by the person when you offered the choice), before building the page. Skip it when no style fits the subject and you build your own direction. Without a name, it returns the style the current page was designed in, as its opening HTML comment recorded it, with that style's guide: call it before changing a page someone designed earlier.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
name | string | The chosen style, as named in the index; omit to read the page's own |
page_id | string | Optional page ID to target within the document |
find_references
Search the stock photo service the person connected, when they connected one, for mood photos that match a style or a subject, such as "bauhaus poster", "minimal coffee packaging", "bakery interior warm light". Use it during the kickoff, then pass the references to ask_user as the images of one question so the person picks those they like, refuses them all, or sends their own picture. Screenshots of real sites from a connected design-reference library come first and need no photo service; these photos are an extra. References are for direction only: never put them in the design. Write the quer…
| Parameter | Type | Description |
|---|---|---|
query * | string | What to look for, in English: a style, a medium, a subject |
count | integer | How many references, 4 to 8; 6 by default |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
ask_user
Ask the person what you need to know before designing: the product and its name, who it is for, what the page must do, its sections, colours they like or must avoid, references. The questions appear in Kalka one at a time, with your suggested answers as buttons and a field to type their own, and the call returns their answers. A question can also show pictures, such as references from find_references, which the person picks from or answers with a picture of their own; you then see the pictures they picked or sent. Ask only what the conversation and the document do not already tell you, and off…
| Parameter | Type | Description |
|---|---|---|
questions * | array | The questions, in the order to ask them |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_comments
Read the comment threads people pinned on layers and points of the design: who said what, on which layer, and whether a thread asks you (asks_agent). Annotations (notes for developers, with the layer properties they pin) and measurements kept on the canvas are threads too; read them before you build a layer in code. Threads waiting for an agent are yours once you read them: act on each, then answer with reply_to_comment, or ask your question there if you need a decision. Resolved threads are left out unless include_resolved.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
include_resolved | boolean | Also list resolved threads |
page_id | string | Optional page ID to target within the document |
reply_to_comment
Answer in a comment thread: say what you changed for a request, or ask the question you need answered before you act. The person sees it on the pin.
| Parameter | Type | Description |
|---|---|---|
text * | string | Your reply |
thread_id * | string | The thread id from get_comments |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
resolve_comment
Mark a comment thread resolved once what it asked is done, or reopen it with resolved false.
| Parameter | Type | Description |
|---|---|---|
thread_id * | string | The thread id from get_comments |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
resolved | boolean |
get_frame_reviews
Which top-level frames and sections people marked ready for development (status ready), which changed since and need review again (status review), and which are built (status completed). Frames not listed are drafts. Read it before you build a design in code: build what is ready.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_frame_review
Mark a top-level frame or a section ready for development, completed once built (status completed), or a draft again with ready false. Only when the person asks you to: approving a design is theirs to decide.
| Parameter | Type | Description |
|---|---|---|
id * | string | A section, or a frame at the top of a page or of a section |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
ready | boolean | |
status | string | Defaults to ready |
get_page_tree
Get the node tree of the current page. Returns lightweight hierarchy: id, type, name, size, and text for TEXT nodes. Use depth, root_id, or node_types to keep large pages small. Use get_node for full properties of a specific node.
| Parameter | Type | Description |
|---|---|---|
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
node_types | array | Keep only these node types and their ancestors, for example FRAME or TEXT |
page_id | string | Optional page ID to target within the document |
root_id | string | Return only this node subtree instead of the whole current page |
get_metadata
Lightweight XML outline of a node or the selection, as Figma's get_metadata returns: each layer's id, type (as the element name), name, x, y (relative to its parent), width, and height, with children nested. Use it to plan before fetching details with get_node, describe, or get_jsx. With no nodeId and no selection it lists the document's pages; pass a page ID to outline a page.
| Parameter | Type | Description |
|---|---|---|
clientFrameworks | string | Frameworks of the client project; accepted and ignored |
clientLanguages | string | Languages of the client project; accepted and ignored |
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
fileKey | string | Figma file key; ignored, Kalka reads the open document |
nodeId | string | |
page_id | string | Optional page ID to target within the document |
search_design_system
Search the design system for components, component sets, variables, and styles whose names match a query, as Figma's search_design_system does: the document's own and those of its enabled libraries. Pass several queries at once as a list. Every word of a query must appear in the name (Button/Primary matches "button primary"). Insert a library component with insert_library_component and bind a variable with bind_variable.
| Parameter | Type | Description |
|---|---|---|
query * | Text to search for, or a list of up to 10 searches | |
document_id | string | Optional Kalka document/tab ID to target |
fileKey | string | Figma file key; ignored, Kalka reads the open document |
includeComponents | boolean | Search components and component sets. Default: true |
includeStyles | boolean | Search styles. Default: true |
includeVariables | boolean | Search variables. Default: true |
limit | ||
page_id | string | Optional page ID to target within the document |
get_current_page
Get the current page name and ID.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
list_pages
List all pages in the document.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
select_nodes
Select one or more nodes by ID.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to select |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
query_nodes
Query nodes using XPath selectors. Returns id, name, and type, plus text for TEXT nodes. Node types are element names (FRAME, TEXT, RECTANGLE, ELLIPSE, etc.). Attributes: id, name, width, height, x, y, visible, opacity, cornerRadius, fontSize, fontFamily, fontWeight, layoutMode, itemSpacing, paddingTop/Right/Bottom/Left, strokeWeight, rotation, locked, blendMode, text, lineHeight, letterSpacing. Examples: //FRAME — all frames //FRAME[@width < 300] — frames narrower than 300px //COMPONENT[starts-with(@name, 'Button')] — components starting with "Button" //SECTION/FRAME — direct frame c…
| Parameter | Type | Description |
|---|---|---|
selector * | string | XPath selector |
document_id | string | Optional Kalka document/tab ID to target |
limit | ||
page | string | Page name (default: current page) |
page_id | string | Optional page ID to target within the document |
get_components
List reusable components from the document and enabled component libraries, optionally filtered by name.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
library_id | string | Filter library components by library ID |
limit | ||
name | string | Filter by name (case-insensitive substring) |
page_id | string | Optional page ID to target within the document |
source | string | Component source |
list_libraries
List available published component libraries.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
search_library_components
Search Kalka Fresh, the built-in library of design-forward components (live shader backgrounds, headline effects, glass and paper cards, buttons, hero devices, separators), by intent such as "animated background for a tech landing" or "playful stamp next to the headline". Returns the best matches with their variants, text properties, source and licence; insert one with insert_library_component (library_id "kalka-fresh"). Colours follow the document variables ground, ink, accent, muted and line. An optional toolbox, not a template: use one or two where they serve the idea of the page (its stron…
| Parameter | Type | Description |
|---|---|---|
query * | string | What the component is for, in a few words; empty lists the whole library |
category | string | Only this category |
document_id | string | Optional Kalka document/tab ID to target |
include_html | boolean | Add each match's HTML, to adapt and write with write_html instead |
limit | ||
page_id | string | Optional page ID to target within the document |
insert_library_component
Insert a reusable component from a library by stable library and asset identity. Components of Kalka Fresh (library_id "kalka-fresh", found with search_library_components) need no setup: the library is enabled in the document as they are placed, and properties sets their variant and text values by name, such as { "State": "Hover", "Label": "Book a table" }.
| Parameter | Type | Description |
|---|---|---|
asset_key * | string | Stable asset key |
library_id * | string | Library ID |
document_id | string | Optional Kalka document/tab ID to target |
insert_index | ||
page_id | string | Optional page ID to target within the document |
parent_id | string | Optional parent node ID |
properties | object | Variant and text property values by name (Kalka Fresh components) |
revision_id | string | Pinned revision ID |
variant_values | string | Optional JSON object of variant property values |
x | ||
y |
switch_page
Switch to a different page by name or ID.
| Parameter | Type | Description |
|---|---|---|
page * | string | Page name or ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
page_bounds
Get bounding box of all objects on the current page.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_font_status
Report whether fonts used on the current page are faithfully available. Returns requested faces, their loaded source, active substitutions, why an installed face could not be loaded, and affected nodes.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
list_fonts
List fonts used in the current page.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
family | string | Filter by family name (substring) |
page_id | string | Optional page ID to target within the document |
list_available_fonts
List font families the host can render (system fonts on desktop plus any bundled fonts). Use this to discover what fonts are available to set on a text node — distinct from list_fonts which only reports families currently used in the page.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
family | string | Filter by family name (substring, case-insensitive) |
page_id | string | Optional page ID to target within the document |
create_shape
Create a shape on the canvas. Use FRAME for containers/cards, RECTANGLE for solid blocks, ELLIPSE for circles, TEXT for labels, LINE for rules and dividers, STAR for starbursts and badges, POLYGON for triangles and regular polygons, and SECTION for page sections. Use create_vector with an SVG path for arbitrary shapes.
| Parameter | Type | Description |
|---|---|---|
height * | ||
type * | string | Node type |
width * | ||
x * | ||
y * | ||
document_id | string | Optional Kalka document/tab ID to target |
name | string | Node name shown in layers panel |
page_id | string | Optional page ID to target within the document |
parent_id | string | Parent node ID to nest inside |
search_icons
Search Iconify for icons by keyword. Accepts multiple queries — all searched in parallel. Returns results keyed by query.
| Parameter | Type | Description |
|---|---|---|
queries * | array | Search keywords (e.g. ["heart", "arrow", "settings"]) |
document_id | string | Optional Kalka document/tab ID to target |
limit | ||
page_id | string | Optional page ID to target within the document |
prefix | string | Filter by icon set prefix (e.g. "lucide", "mdi") |
insert_icon
Insert one or more vector icons onto the canvas. Pass a single name or multiple names to batch-insert into the same parent. If already cached by fetch_icons — instant, no network request.
| Parameter | Type | Description |
|---|---|---|
color | string | Icon color hex (replaces currentColor). Default: #000000 |
document_id | string | Optional Kalka document/tab ID to target |
name | string | Single icon name (shorthand for names with one icon) |
names | array | Icon names as prefix:name (e.g. ["lucide:heart"] or ["lucide:heart","lucide:home","lucide:star"]) |
page_id | string | Optional page ID to target within the document |
parent_id | string | Parent node ID for all icons |
size |
fetch_icons
Pre-fetch icons from Iconify into cache. Batches by prefix (one HTTP request per set). Call this once with all needed icons, then use insert_icon to place them instantly. Popular sets: lucide (outline), mdi (filled), heroicons, tabler, solar, mingcute, ri (remix).
| Parameter | Type | Description |
|---|---|---|
names * | array | Icon names as prefix:name (e.g. ["lucide:heart", "lucide:home", "mdi:star"]) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
size |
combine_as_variants
Combine components sharing a parent into a component set (variant set). Components named as Figma names variants, "State=On, Size=Large", get those variant properties; names like "Button/Primary" derive a Variant property from the segments after the first slash.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Component node IDs to combine |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
create_component
Convert a frame/group into a component.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID to convert |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
create_instance
Create an instance of a component: a copy that follows its main, so changing the main changes every instance. Put it in a frame with parent_id (at insert_index among its children) to compose a section from the system's components.
| Parameter | Type | Description |
|---|---|---|
component_id * | string | Component node ID |
document_id | string | Optional Kalka document/tab ID to target |
insert_index | ||
page_id | string | Optional page ID to target within the document |
parent_id | string | Frame or page to put it in |
x | ||
y |
expose_instance_swap
Expose nested instances as an instance-swap slot on their component.
| Parameter | Type | Description |
|---|---|---|
candidate_ids * | array | Candidate component node IDs |
instance_ids * | array | Instance node IDs |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
property_name | string | Property name |
create_slot
Make a frame inside a main component a slot, as Create slot does: instances can then hold their own content in it, and a behaviour can bind it as a part. Returns the slot name.
| Parameter | Type | Description |
|---|---|---|
id * | string | Frame ID inside a main component |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_behaviour
Read the behaviour of a main component, component set, or variant by property and slot names, with the required values and parts still missing. Without an ID, list every behaviour kind with the values and parts it binds.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
id | string | Component, set, or variant ID |
page_id | string | Optional page ID to target within the document |
set_behaviour
Make a main component or component set behave as a Reka UI control in preview and code, naming its own properties and slots: e.g. { kind: "switch", values: { value: "State" }, parts: { thumb: "Thumb" }, states: "Interaction" }. Variant on/off values are guessed from names like On and Off unless given as { property, on, off }. Pass null to remove it. Returns the behaviour and the required values and parts still missing; get_behaviour lists every kind with its values and parts.
| Parameter | Type | Description |
|---|---|---|
behaviour * | The behaviour by property and slot names, or null to remove it | |
id * | string | Main component or component set ID; a variant uses its set |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
create_page
Create a new page.
| Parameter | Type | Description |
|---|---|---|
name * | string | Page name |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
create_vector
Create a vector node from SVG path data or a VectorNetwork.
| Parameter | Type | Description |
|---|---|---|
x * | ||
y * | ||
document_id | string | Optional Kalka document/tab ID to target |
fill | string | Fill color (hex) |
name | string | Node name |
page_id | string | Optional page ID to target within the document |
parent_id | string | Parent node ID |
path | string | SVG path data (preferred, e.g. "M0 0 L100 0 L50 80 Z") or VectorNetwork JSON, e.g. {"vertices":[{"x":0,"y":0},{"x":10,"y":0}],"segments":[{"start":0,"end":1}],"regions":[]} |
stroke | string | Stroke color (hex) |
stroke_weight |
create_slice
Create a slice (export region) on the canvas.
| Parameter | Type | Description |
|---|---|---|
height * | ||
width * | ||
x * | ||
y * | ||
document_id | string | Optional Kalka document/tab ID to target |
name | string | Slice name |
page_id | string | Optional page ID to target within the document |
parent_id | string | Parent node ID |
import_svg
Import raw SVG markup onto the canvas as editable layers, as pasting it into Figma does: a frame (a group when the SVG has no width, height, or viewBox) with a group per <g>, a vector per shape, and a text layer per <text>, named by their ids, and a mask group around clipped content. Supports common SVG shapes, text with <tspan> styles, inherited presentation attributes, opacity, transforms, gradients, clip paths, and internal <use> references.
| Parameter | Type | Description |
|---|---|---|
svg * | string | SVG markup string (e.g. '<svg viewBox="0 0 24 24"><path d="M..."/></svg>') |
color | string | Default color for currentColor fills/strokes (default: #000000) |
document_id | string | Optional Kalka document/tab ID to target |
name | string | Name for the created frame or group (default: the root <svg> id, else "Frame" or "Group") |
page_id | string | Optional page ID to target within the document |
parent_id | string | Parent node ID |
x | ||
y |
set_effects
Add an effect to a node, or replace its effects with it: drop or inner shadow, layer or background blur (progressive with `progressive`), noise, texture, or glass.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
type * | string | Effect type |
clip_to_shape | boolean | Keep a texture in its layer |
color | string | Shadow or noise color (hex). Ignored for other effects. |
density | ||
depth | ||
dispersion | ||
document_id | string | Optional Kalka document/tab ID to target |
end_x | ||
end_y | ||
light_angle | ||
light_intensity | ||
noise_size | ||
noise_type | string | Noise grains |
offset_x | ||
offset_y | ||
opacity | ||
page_id | string | Optional page ID to target within the document |
progressive | boolean | Blur from start_radius at the start point to radius at the end point |
radius | ||
refraction | ||
replace | boolean | Replace the node effects instead of adding one |
secondary_color | string | Second grain color of a DUOTONE noise (hex) |
spread | ||
start_radius | ||
start_x | ||
start_y |
set_opacity
Set opacity of a node (0-1).
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
value * | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_font
Set font properties of a text node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
family | string | Font family name |
page_id | string | Optional page ID to target within the document |
size | ||
style | string | Font style (e.g. "Bold", "Regular", "Bold Italic") |
set_visible
Set visibility of a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
value * | boolean | Visible (true/false) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_constraints
Set resize constraints for a node within its parent.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
horizontal | string | Horizontal constraint |
page_id | string | Optional page ID to target within the document |
vertical | string | Vertical constraint |
set_rotation
Set rotation angle of a node in degrees.
| Parameter | Type | Description |
|---|---|---|
angle * | ||
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_minmax
Set min/max width and height constraints on a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
max_height | ||
max_width | ||
min_height | ||
min_width | ||
page_id | string | Optional page ID to target within the document |
set_font_range
Set font properties for a text range.
| Parameter | Type | Description |
|---|---|---|
end * | ||
id * | string | Node ID |
start * | ||
color | string | Text color (hex) |
document_id | string | Optional Kalka document/tab ID to target |
family | string | Font family name |
page_id | string | Optional page ID to target within the document |
size | ||
style | string | Font style |
set_text_resize
Set text auto-resize mode.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
mode * | string | Resize mode |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_blend
Set blend mode of a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
mode * | string | Blend mode |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_locked
Set locked state of a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
value * | boolean | Locked (true/false) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_stroke_align
Set stroke alignment of a node.
| Parameter | Type | Description |
|---|---|---|
align * | string | Stroke alignment |
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_stroke_draw
Set a vector's or line's Figma Draw stroke: a width profile that thickens and thins it along the path, and a brush it is drawn with. Leave a field out to keep it; "uniform" and "none" clear them. Returns the width profile points and the brush.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
brush | string | Brush as TYPE:id: a stretch brush bends one shape along the path, a scatter brush drops copies |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
width_profile | string | Width profile preset |
set_image_fill
Set an image fill on a node from base64-encoded image data.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
image_data * | string | Base64-encoded image bytes (PNG, JPEG, or WEBP) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
scale_mode | string | Image scale mode |
get_interactions
Read a layer's prototype interactions (triggers and actions) in the Figma Plugin API reactions shape, and the flow that starts at it when it is a frame.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_interactions
Replace a layer's prototype interactions: what a click, hover, key or delay does when the page is presented (navigate, overlays, scroll to, change to a variant, back, links, set variables and modes, conditionals). Read them first with get_interactions to edit one.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
reactions * | array | Interactions in the Figma Plugin API shape: [{ trigger: { type: "ON_CLICK" | "ON_HOVER" | "ON_PRESS" | "ON_DRAG" | "AFTER_TIMEOUT" (timeout s) | "MOUSE_ENTER" | "MOUSE_LEAVE" | "MOUSE_DOWN" | "MOUSE_U… |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
set_prototype_flows
Set the current page's prototype flows, in order: each starts at a top-level frame and is what Present plays first. An empty list removes them.
| Parameter | Type | Description |
|---|---|---|
flows * | array | Flows in order, by the frame each starts at |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
clone_node
Clone (duplicate) a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID to clone |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_move
Move a node to new coordinates.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
x * | ||
y * | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
rename_node
Rename a node in the layers panel.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
name * | string | New name |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
group_nodes
Group selected nodes.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to group |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
ungroup_node
Ungroup a group node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Group node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
flatten_nodes
Flatten nodes into a single vector.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to flatten |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_to_component
Convert one or more frames/groups into components.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to convert |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_bounds
Get absolute bounding box of a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_ancestors
Get the ancestor chain from a node to the page root.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_children
Get direct children of a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_tree
Get a node tree with types and hierarchy.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
depth | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_bindings
Get variable bindings for a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
node_replace_with
Replace a node with JSX content.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID to replace |
jsx * | string | JSX string for the replacement |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
arrange
Arrange top-level nodes on the canvas in a grid, row, or column layout. Useful after batch creation to tidy up overlapping frames.
| Parameter | Type | Description |
|---|---|---|
cols | ||
document_id | string | Optional Kalka document/tab ID to target |
gap | ||
ids | array | Node IDs to arrange (default: all top-level children) |
mode | string | Layout mode |
page_id | string | Optional page ID to target within the document |
get_variable_defs
Variables and styles a node or the selection uses, including its descendants, as Figma's get_variable_defs returns them. definitions maps each name to its value in the mode the layers use (colors as hex, aliases resolved); variables adds each variable's collection and its value in every mode; styles lists the shared styles with their values. With no nodeId and no selection it reads the current page.
| Parameter | Type | Description |
|---|---|---|
clientFrameworks | string | Frameworks of the client project; accepted and ignored |
clientLanguages | string | Languages of the client project; accepted and ignored |
document_id | string | Optional Kalka document/tab ID to target |
fileKey | string | Figma file key; ignored, Kalka reads the open document |
nodeId | string | |
page_id | string | Optional page ID to target within the document |
list_variables
List all design variables (colors, numbers, strings, booleans).
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
type | string | Filter by variable type |
list_collections
List all variable collections.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_variable
Get a variable by ID.
| Parameter | Type | Description |
|---|---|---|
id * | string | Variable ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
find_variables
Find variables by name pattern.
| Parameter | Type | Description |
|---|---|---|
query * | string | Name substring (case-insensitive) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
type | string | Filter by type |
create_variable
Create a new variable in a collection.
| Parameter | Type | Description |
|---|---|---|
collection_id * | string | Collection ID |
name * | string | Variable name |
type * | string | Variable type |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
value | string | Initial value (hex for COLOR, number for FLOAT, etc.) |
set_variable
Set the value of a variable for a specific mode.
| Parameter | Type | Description |
|---|---|---|
id * | string | Variable ID |
mode * | string | Mode ID |
value * | string | Value (hex for COLOR, number for FLOAT, etc.) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
delete_variable
Delete a variable.
| Parameter | Type | Description |
|---|---|---|
id * | string | Variable ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
bind_variable
Bind a variable to a node property. For fills/strokes color bindings use indexed format like "fills/0/color".
| Parameter | Type | Description |
|---|---|---|
field * | string | Property field path. For fills/strokes use indexed format: "fills/0/color", "strokes/0/color". For FLOAT scalars: "opacity", "width", "height", "cornerRadius", "fontSize", "letterSpacing", "lineHeight… |
node_id * | string | Node ID |
variable_id * | string | Variable ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
unbind_variable
Remove a variable binding from a node property.
| Parameter | Type | Description |
|---|---|---|
field * | string | Property field path to unbind. For fills/strokes use indexed format: "fills/0/color", "strokes/0/color". For FLOAT scalars: "opacity", "width", "height", "cornerRadius", "fontSize", "letterSpacing", "… |
node_id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_collection
Get a variable collection by ID.
| Parameter | Type | Description |
|---|---|---|
id * | string | Collection ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
create_collection
Create a new variable collection.
| Parameter | Type | Description |
|---|---|---|
name * | string | Collection name |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
delete_collection
Delete a variable collection and all its variables.
| Parameter | Type | Description |
|---|---|---|
id * | string | Collection ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
boolean_union
Union (combine) multiple nodes.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to union |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
boolean_subtract
Subtract the second node from the first.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs (first minus rest) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
boolean_intersect
Intersect multiple nodes.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to intersect |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
boolean_exclude
Exclude (XOR) multiple nodes.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node IDs to exclude |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path_get
Get vector path data of a node.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path_set
Set vector path data on a node. Provide a VectorNetwork JSON.
| Parameter | Type | Description |
|---|---|---|
id * | string | Node ID |
path * | string | VectorNetwork JSON |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path_scale
Scale vector path from center.
| Parameter | Type | Description |
|---|---|---|
factor * | ||
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path_flip
Flip vector path horizontally or vertically.
| Parameter | Type | Description |
|---|---|---|
axis * | string | Flip axis |
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path_move
Move all path points by an offset.
| Parameter | Type | Description |
|---|---|---|
dx * | ||
dy * | ||
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
viewport_get
Get current viewport position and zoom level.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
viewport_set
Set viewport position and zoom.
| Parameter | Type | Description |
|---|---|---|
x * | ||
y * | ||
zoom * | ||
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
export_svg
Export nodes as SVG markup. Returns the SVG string.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
ids | array | Node IDs to export. Omit to export all top-level nodes on the current page. |
page_id | string | Optional page ID to target within the document |
path | string | Write exported data to this path instead of returning it (requires KALKA_MCP_ROOT) |
export_pdf
Export nodes as a vector PDF document. Text remains selectable, paths stay sharp at any zoom. Returns base64-encoded PDF data.
| Parameter | Type | Description |
|---|---|---|
delivery | string | "inline" (default) returns the file in the response, plus a short-lived URL when the server has one; "url" returns only the URL and metadata, which keeps the response small and allows files too large… |
document_id | string | Optional Kalka document/tab ID to target |
ids | array | Node IDs to export. Omit to export all top-level nodes on the current page. |
page_id | string | Optional page ID to target within the document |
path | string | Write exported data to this path instead of returning it (requires KALKA_MCP_ROOT) |
export_image
Export nodes as a raster image (PNG, JPG, or WEBP). Returns base64-encoded image data. Use to visually verify designs.
| Parameter | Type | Description |
|---|---|---|
delivery | string | "inline" (default) returns the file in the response, plus a short-lived URL when the server has one; "url" returns only the URL and metadata, which keeps the response small and allows files too large… |
document_id | string | Optional Kalka document/tab ID to target |
format | string | Image format |
ids | array | Node IDs to export. Omit to export all top-level nodes on the current page. |
maxEdge | ||
page_id | string | Optional page ID to target within the document |
path | string | Write exported data to this path instead of returning it (requires KALKA_MCP_ROOT) |
scale |
analyze_colors
Analyze color palette usage across the current page. Shows frequency, variable bindings, and optionally clusters similar colors.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
limit | ||
page_id | string | Optional page ID to target within the document |
show_similar | boolean | Include similar-color clusters for potential merging |
threshold |
analyze_typography
Analyze typography usage across the current page. Shows font families, sizes, weights, and their frequencies.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
group_by | string | Group results by a property |
limit | ||
page_id | string | Optional page ID to target within the document |
lint
Check the design for accessibility and consistency issues: low text contrast, small touch targets and text, off-scale spacing and radius, colors that match a variable but are not bound, and structure hygiene. Findings are sorted by severity. A `fix` is safe to apply with lint_fix; `suggestions` change values and need judgment.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
ids | array | Layers to check, with their descendants (default: the current page) |
limit | ||
page_id | string | Optional page ID to target within the document |
preset | string | Rule preset: recommended (default), strict, or accessibility (contrast, touch targets, text size) |
rules | array | Check only these rules of the preset |
lint_fix
Apply lint fixes: bind colors to the variable they match and round geometry to whole pixels. With suggestions: true, also apply each finding’s first suggestion (snap radius and spacing to the scale, raise text to the minimum size, convert groups to frames, delete hidden layers). Returns what was applied and what remains.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
ids | array | Layers to check, with their descendants (default: the current page) |
page_id | string | Optional page ID to target within the document |
preset | string | Rule preset: recommended (default), strict, or accessibility (contrast, touch targets, text size) |
rules | array | Check only these rules of the preset |
suggestions | boolean | Also apply the first suggestion of each finding |
analyze_spacing
Analyze spacing values (gap, padding) across the current page. Checks grid compliance.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
grid | ||
page_id | string | Optional page ID to target within the document |
analyze_clusters
Find repeated design patterns (potential components). Groups nodes by structural signature — type, size, and child structure.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
limit | ||
min_count | ||
min_size | ||
page_id | string | Optional page ID to target within the document |
analyze_overlaps
Detect visual overlaps and layout overflows across the current page. Useful for finding content that covers footers, text that bleeds outside frames, and accidental sibling overlaps.
| Parameter | Type | Description |
|---|---|---|
category | string | Comma-separated categories: sibling-overlap, parent-overflow, overlay (default: all) |
document_id | string | Optional Kalka document/tab ID to target |
include_absolute | boolean | Include absolutely-positioned nodes in the analysis |
include_hidden | boolean | Include hidden nodes in the analysis |
include_locked | boolean | Include locked nodes in the analysis |
limit | ||
min_area | ||
min_ratio | ||
page | string | Limit analysis to nodes on the named page |
page_id | string | Optional page ID to target within the document |
scope | string | Which pairs to inspect: all, same-parent, cross-parent, top-level, inside-parent (default: all) |
severity | string | Minimum severity to include: critical, major, minor, info (default: info) |
type | string | Comma-separated node types to analyze, e.g. FRAME,TEXT |
diff_show
Preview setting JSX attributes on a node, without changing it. Returns the patch, which diff_apply applies.
| Parameter | Type | Description |
|---|---|---|
attributes * | string | JSX attributes to set, named as the JSX export writes them. Example: w={200} bg="#FF0000" opacity={0.5} |
id * | string | Node ID |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
diff_apply
Apply a patch from diff_create, diff_show, or diff_changes. Each node must still have the patch's old values unless force is set, and nothing changes unless every hunk applies. Use dryRun to check first.
| Parameter | Type | Description |
|---|---|---|
patch * | string | Patch text from diff_create, diff_show, or diff_changes |
document_id | string | Optional Kalka document/tab ID to target |
dryRun | boolean | Check and report changes without applying |
force | boolean | Apply even when current values differ from the patch |
page_id | string | Optional page ID to target within the document |
use_figma
Run Figma Plugin API JavaScript on the open document, as Figma's use_figma does. The code runs with top-level await and return; the `figma` global is the Plugin API (with `figma.variables`) and `kalka` adds what Figma has no API for. Return the IDs of the layers you create or change. The result has the JSON return value as `result`, plus `createdNodeIds`, `changedNodeIds`, `removedNodeIds`, and `logs` (console output). A Plugin API member Kalka lacks throws a TypeError naming it; a failed script reports `safeToRetryWithoutCanvasRead`. Each call is one undo step.
| Parameter | Type | Description |
|---|---|---|
code * | string | Plugin API JavaScript; top-level await and return are allowed |
description | string | What the script does; accepted and ignored |
document_id | string | Optional Kalka document/tab ID to target |
fileKey | string | Figma file key; ignored, Kalka reads the open document |
page_id | string | Optional page ID to target within the document |
skillNames | string | Skills that wrote the script, for logging; ignored |
design_to_tokens
Write the document variables as a stylesheet of CSS custom properties: defaults in :root, every other mode under its condition (a selector such as [data-theme="dark"] or an @media query), aliases as var() references. The tailwind format puts tokens with a Tailwind v4 namespace (--color-*, --spacing-*, --radius-*, --text-*, …) in @theme and adds a @custom-variant per mode. The dtcg format returns W3C design token files instead: one per collection mode, text and effect styles as typography and shadow tokens, and a resolver document; collection and type filters do not apply to it. Issues lists…
| Parameter | Type | Description |
|---|---|---|
collection | string | Filter by collection name (substring, case-insensitive) |
document_id | string | Optional Kalka document/tab ID to target |
format | string | css: :root and mode scopes; tailwind: @theme, mode scopes and variants; dtcg: W3C design token files |
page_id | string | Optional page ID to target within the document |
type | string | Filter by variable type |
import_design_tokens
Import W3C design token (DTCG) files into the document as variables, and typography and shadow tokens as text and effect styles. Pass each file with its path: a file per mode grouped by folder (as Figma exports modes), a .resolver.json with the files it refers to, or a Tokens Studio file with $themes. Collections and modes with the same names as existing ones are updated, variables are matched by name, and nothing is deleted. Returns what was added, updated, and skipped and why.
| Parameter | Type | Description |
|---|---|---|
files * | array | Token files, each with its path (folders name collections) and JSON text |
add_missing | boolean | Add tokens that match no variable (default true) |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
styles | boolean | Make text and effect styles (default true) |
design_to_component_map
Analyze the document and return a structured component decomposition: components (with variants, props, instance counts), screens, and a dependency overview.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page | string | Page name to analyze (default: current page) |
page_id | string | Optional page ID to target within the document |
list_documents
List open Kalka documents/tabs with their IDs, file paths, current pages, and pages.
save_file
Save the current document to disk as a .fig file, or a .kalka file for a path ending in .kalka. If path is provided, it must be inside the configured MCP root.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path | string | Path for the .fig file, absolute or relative to the MCP root |
open_file
Open a .fig or .pen file from inside the configured MCP root.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to the design file, absolute or relative to the MCP root |
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
new_document
Create a new empty document with an optional save path inside the configured MCP root.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path | string | Path for the new file, absolute or relative to the MCP root |
close_file
Close an open document tab. With unsaved changes it fails unless unsaved is "save" or "discard"; it never prompts in the app.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
path | string | With unsaved "save": .fig path for a document never saved, inside the MCP root |
unsaved | string | What to do with unsaved changes: "error" (default) fails, "save" saves first, "discard" drops them |
activate_document
Bring an open document tab to the front in the app, optionally switching it to a page.
| Parameter | Type | Description |
|---|---|---|
document_id * | string | Document/tab ID from list_documents |
page_id | string | Optional page ID to target within the document |
undo
Undo the newest change made through MCP or the CLI in a document. Fails if the newest change was made in the editor, so the user's work is never reverted.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
redo
Redo the newest change undone through MCP or the CLI. Fails if the newest undone change was made in the editor.
| Parameter | Type | Description |
|---|---|---|
document_id | string | Optional Kalka document/tab ID to target |
page_id | string | Optional page ID to target within the document |
get_settings
Read app settings: appearance (theme, language, animations), snapping, canvas rendering, recovery, AI chat (follow agents, reasoning display, step limit), AI model and thinking level, Code panel, and design check preferences.
list_settings
List every setting update_settings accepts, by dotted key, with its current value and accepted values (model profiles by ID with their names).
update_settings
Change app settings live with a partial object shaped like get_settings output. Returns the applied patch. ai.designModel picks one of the configured model profiles; credentials, model connections, MCP connections, storage, and tool access are not exposed.
| Parameter | Type | Description |
|---|---|---|
settings * | object | Partial settings, e.g. {"appearance":{"theme":"light"},"chat":{"followAgents":false},"ai":{"thinkingLevel":"high"}}. Unknown keys and invalid values are rejected. |
get_codegen_prompt
Get design-to-code generation guidelines. Call before generating frontend code.