Kalka

v0.2.0-rc.1-1
io.github.leyscore/kalka Checked 11 hours ago Published 11 hours ago

Lets 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.

ParameterTypeDescription
depth
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
id *stringNode ID
depth
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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…

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
limit
namestringLayer name: substring, or a pattern with * and ? (case-insensitive)
pagestringWith within "page": page name or ID instead of current
page_idstringOptional page ID to target within the document
root_idstring
styleobjectMatch layers by a CSS declaration of their projected CSS
textstringText layer content: substring, or a pattern with * and ? (case-insensitive)
tolerance
typestringNode type filter
variablestringVariable name (color/primary), ID, or CSS custom property (--color-primary)
variable_matchstringWith variable: bound layers (default), unbound layers holding its value, or both
withinstringSearch 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.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
pathstringWrite 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.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
stylestringCSS 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.

ParameterTypeDescription
deliverystring"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_idstringOptional Kalka document/tab ID to target
idstringNode ID
maxEdge
page_idstringOptional 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.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
propertiesarrayCSS 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.

ParameterTypeDescription
jsx *stringJSX string to render
document_idstringOptional Kalka document/tab ID to target
insert_index
page_idstringOptional page ID to target within the document
parent_idstringParent node ID to render into
replace_idstringNode 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…

ParameterTypeDescription
html *stringHTML to write, optionally with <style>
document_idstringOptional Kalka document/tab ID to target
insert_index
page_idstringOptional page ID to target within the document
parent_idstringFrame or page to write into
replace_idstringLayer 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.

ParameterTypeDescription
find *stringExact text to find, once
id *stringNode ID
replace *stringText to put in its place
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

update_node

Update properties of an existing node: position, size, opacity, corner radius, visibility, text, font.

ParameterTypeDescription
id *stringNode ID
corner_radius
document_idstringOptional Kalka document/tab ID to target
flow_directionstringAuto-layout flow direction for FRAME nodes
font_size
font_weight
height
namestringLayer name
opacity
page_idstringOptional page ID to target within the document
textstringText content (TEXT nodes)
text_directionstringText direction for TEXT nodes
visiblebooleanVisibility
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.

ParameterTypeDescription
id *stringNode ID
styles *objectCSS properties in kebab-case and their values
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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>.

ParameterTypeDescription
id *stringNode ID
classesClass names, space-separated or as a list; replaces the current ones
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
tagstringHTML 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
name *stringClass name, without the dot
styles *objectCSS properties in kebab-case and their values
document_idstringOptional Kalka document/tab ID to target
kindstringFor a new class
page_idstringOptional 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.

ParameterTypeDescription
action *string
document_idstringOptional Kalka document/tab ID to target
idstringNode ID
namestringClass name, without the dot
new_namestringClass name, without the dot
page_idstringOptional 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.

ParameterTypeDescription
id *stringNode ID
width *
document_idstringOptional Kalka document/tab ID to target
namestringArtboard name, such as "Phone"
page_idstringOptional page ID to target within the document

set_layout

Set auto-layout (flexbox) on a frame. Direction, alignment, spacing, padding.

ParameterTypeDescription
id *stringFrame node ID
alignstringPrimary axis alignment (only changes if provided)
counter_alignstringCross axis alignment (only changes if provided)
directionstringLayout direction (keeps current if omitted)
document_idstringOptional Kalka document/tab ID to target
flow_directionstringChild flow direction for auto-layout. AUTO inherits from parent.
padding
padding_horizontal
padding_vertical
page_idstringOptional page ID to target within the document
spacing

set_layout_child

Configure auto-layout child: sizing (FIXED/HUG/FILL), grow, alignment, absolute positioning.

ParameterTypeDescription
id *stringChild node ID
align_selfstringSelf alignment override (cross-axis)
document_idstringOptional Kalka document/tab ID to target
grow
page_idstringOptional page ID to target within the document
positioningstringABSOLUTE to take node out of auto-layout flow
sizing_horizontalstringHorizontal sizing mode
sizing_verticalstringVertical sizing mode

set_radius

Set corner radius. Use individual corners for independent values.

ParameterTypeDescription
id *stringNode ID
bottom_left
bottom_right
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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).

ParameterTypeDescription
color *stringColor (hex). For gradient: start color.
id *stringNode ID
color_endstringEnd color for gradient (if omitted, solid fill)
document_idstringOptional Kalka document/tab ID to target
gradientstringGradient direction
page_idstringOptional page ID to target within the document

set_stroke

Set the stroke (border) of a node.

ParameterTypeDescription
color *stringStroke color (hex)
id *stringNode ID
alignstringStroke alignment
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
weight

set_text

Set text content of a text node.

ParameterTypeDescription
id *stringNode ID
text *stringText content
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_text_properties

Set text layout properties: alignment, auto-resize, text case, decoration, truncation.

ParameterTypeDescription
id *stringText node ID
align_horizontalstringHorizontal text alignment
align_verticalstringVertical text alignment
auto_resizestringText auto-resize mode
directionstringText direction
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
text_decorationstringText decoration

delete_node

Delete a node by ID.

ParameterTypeDescription
id *stringNode ID to delete
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

reparent_node

Move a node into a different parent.

ParameterTypeDescription
id *stringNode ID to move
parent_id *stringNew parent node ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_resize

Resize a node.

ParameterTypeDescription
height *
id *stringNode ID
width *
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
operations *stringJSON array: [{"id":"0:5","props":{"spacing":8}},{"id":"0:6","props":{"sizing_horizontal":"FILL","grow":1}}]
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
requests *stringJSON array: [{"id":"0:5","query":"mountain sunset"},{"id":"0:8","query":"business team","orientation":"square"}]
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
query *stringFamily name or part of it, e.g. "grotesk"
document_idstringOptional Kalka document/tab ID to target
limitintegerDefault 20
page_idstringOptional 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.

ParameterTypeDescription
family *stringExact family name, e.g. "Inter Tight"
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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).

ParameterTypeDescription
depth
document_idstringOptional Kalka document/tab ID to target
grid
idstringNode ID (single node)
idsarrayNode IDs (multiple nodes in one call)
page_idstringOptional 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.

ParameterTypeDescription
from *stringSource node ID
to *stringTarget node ID
depth
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

diff_jsx

Structural diff between two nodes in JSX format. Shows added/removed children, changed props.

ParameterTypeDescription
from *stringSource node ID
to *stringTarget node ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
from *stringSource node ID
to *stringTarget node ID
deliverystring"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_idstringOptional Kalka document/tab ID to target
maxEdge
page_idstringOptional 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)"]'

ParameterTypeDescription
expr *stringSingle expression or JSON array of expressions
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

viewport_zoom_to_fit

Zoom viewport to fit specified nodes.

ParameterTypeDescription
ids *arrayNode IDs to fit in view
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
node_idsarrayLayers you finished. Omit to release everything you are working on.
page_idstringOptional 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.

ParameterTypeDescription
text *stringWhat you are doing now, a few words
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
sections *arrayEvery section of the page, in order from the top
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
namestringThe chosen style, as named in the index; omit to read the page's own
page_idstringOptional 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…

ParameterTypeDescription
query *stringWhat to look for, in English: a style, a medium, a subject
countintegerHow many references, 4 to 8; 6 by default
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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…

ParameterTypeDescription
questions *arrayThe questions, in the order to ask them
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
include_resolvedbooleanAlso list resolved threads
page_idstringOptional 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.

ParameterTypeDescription
text *stringYour reply
thread_id *stringThe thread id from get_comments
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
thread_id *stringThe thread id from get_comments
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
resolvedboolean

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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
id *stringA section, or a frame at the top of a page or of a section
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
readyboolean
statusstringDefaults 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.

ParameterTypeDescription
depth
document_idstringOptional Kalka document/tab ID to target
node_typesarrayKeep only these node types and their ancestors, for example FRAME or TEXT
page_idstringOptional page ID to target within the document
root_idstringReturn 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.

ParameterTypeDescription
clientFrameworksstringFrameworks of the client project; accepted and ignored
clientLanguagesstringLanguages of the client project; accepted and ignored
depth
document_idstringOptional Kalka document/tab ID to target
fileKeystringFigma file key; ignored, Kalka reads the open document
nodeIdstring
page_idstringOptional 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.

ParameterTypeDescription
query *Text to search for, or a list of up to 10 searches
document_idstringOptional Kalka document/tab ID to target
fileKeystringFigma file key; ignored, Kalka reads the open document
includeComponentsbooleanSearch components and component sets. Default: true
includeStylesbooleanSearch styles. Default: true
includeVariablesbooleanSearch variables. Default: true
limit
page_idstringOptional page ID to target within the document

get_current_page

Get the current page name and ID.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

list_pages

List all pages in the document.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

select_nodes

Select one or more nodes by ID.

ParameterTypeDescription
ids *arrayNode IDs to select
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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…

ParameterTypeDescription
selector *stringXPath selector
document_idstringOptional Kalka document/tab ID to target
limit
pagestringPage name (default: current page)
page_idstringOptional page ID to target within the document

get_components

List reusable components from the document and enabled component libraries, optionally filtered by name.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
library_idstringFilter library components by library ID
limit
namestringFilter by name (case-insensitive substring)
page_idstringOptional page ID to target within the document
sourcestringComponent source

list_libraries

List available published component libraries.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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…

ParameterTypeDescription
query *stringWhat the component is for, in a few words; empty lists the whole library
categorystringOnly this category
document_idstringOptional Kalka document/tab ID to target
include_htmlbooleanAdd each match's HTML, to adapt and write with write_html instead
limit
page_idstringOptional 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" }.

ParameterTypeDescription
asset_key *stringStable asset key
library_id *stringLibrary ID
document_idstringOptional Kalka document/tab ID to target
insert_index
page_idstringOptional page ID to target within the document
parent_idstringOptional parent node ID
propertiesobjectVariant and text property values by name (Kalka Fresh components)
revision_idstringPinned revision ID
variant_valuesstringOptional JSON object of variant property values
x
y

switch_page

Switch to a different page by name or ID.

ParameterTypeDescription
page *stringPage name or ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

page_bounds

Get bounding box of all objects on the current page.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

list_fonts

List fonts used in the current page.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
familystringFilter by family name (substring)
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
familystringFilter by family name (substring, case-insensitive)
page_idstringOptional 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.

ParameterTypeDescription
height *
type *stringNode type
width *
x *
y *
document_idstringOptional Kalka document/tab ID to target
namestringNode name shown in layers panel
page_idstringOptional page ID to target within the document
parent_idstringParent 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.

ParameterTypeDescription
queries *arraySearch keywords (e.g. ["heart", "arrow", "settings"])
document_idstringOptional Kalka document/tab ID to target
limit
page_idstringOptional page ID to target within the document
prefixstringFilter 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.

ParameterTypeDescription
colorstringIcon color hex (replaces currentColor). Default: #000000
document_idstringOptional Kalka document/tab ID to target
namestringSingle icon name (shorthand for names with one icon)
namesarrayIcon names as prefix:name (e.g. ["lucide:heart"] or ["lucide:heart","lucide:home","lucide:star"])
page_idstringOptional page ID to target within the document
parent_idstringParent 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).

ParameterTypeDescription
names *arrayIcon names as prefix:name (e.g. ["lucide:heart", "lucide:home", "mdi:star"])
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
ids *arrayComponent node IDs to combine
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

create_component

Convert a frame/group into a component.

ParameterTypeDescription
id *stringNode ID to convert
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
component_id *stringComponent node ID
document_idstringOptional Kalka document/tab ID to target
insert_index
page_idstringOptional page ID to target within the document
parent_idstringFrame or page to put it in
x
y

expose_instance_swap

Expose nested instances as an instance-swap slot on their component.

ParameterTypeDescription
candidate_ids *arrayCandidate component node IDs
instance_ids *arrayInstance node IDs
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
property_namestringProperty 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.

ParameterTypeDescription
id *stringFrame ID inside a main component
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
idstringComponent, set, or variant ID
page_idstringOptional 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.

ParameterTypeDescription
behaviour *The behaviour by property and slot names, or null to remove it
id *stringMain component or component set ID; a variant uses its set
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

create_page

Create a new page.

ParameterTypeDescription
name *stringPage name
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

create_vector

Create a vector node from SVG path data or a VectorNetwork.

ParameterTypeDescription
x *
y *
document_idstringOptional Kalka document/tab ID to target
fillstringFill color (hex)
namestringNode name
page_idstringOptional page ID to target within the document
parent_idstringParent node ID
pathstringSVG 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":[]}
strokestringStroke color (hex)
stroke_weight

create_slice

Create a slice (export region) on the canvas.

ParameterTypeDescription
height *
width *
x *
y *
document_idstringOptional Kalka document/tab ID to target
namestringSlice name
page_idstringOptional page ID to target within the document
parent_idstringParent 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.

ParameterTypeDescription
svg *stringSVG markup string (e.g. '<svg viewBox="0 0 24 24"><path d="M..."/></svg>')
colorstringDefault color for currentColor fills/strokes (default: #000000)
document_idstringOptional Kalka document/tab ID to target
namestringName for the created frame or group (default: the root <svg> id, else "Frame" or "Group")
page_idstringOptional page ID to target within the document
parent_idstringParent 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.

ParameterTypeDescription
id *stringNode ID
type *stringEffect type
clip_to_shapebooleanKeep a texture in its layer
colorstringShadow or noise color (hex). Ignored for other effects.
density
depth
dispersion
document_idstringOptional Kalka document/tab ID to target
end_x
end_y
light_angle
light_intensity
noise_size
noise_typestringNoise grains
offset_x
offset_y
opacity
page_idstringOptional page ID to target within the document
progressivebooleanBlur from start_radius at the start point to radius at the end point
radius
refraction
replacebooleanReplace the node effects instead of adding one
secondary_colorstringSecond grain color of a DUOTONE noise (hex)
spread
start_radius
start_x
start_y

set_opacity

Set opacity of a node (0-1).

ParameterTypeDescription
id *stringNode ID
value *
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_font

Set font properties of a text node.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
familystringFont family name
page_idstringOptional page ID to target within the document
size
stylestringFont style (e.g. "Bold", "Regular", "Bold Italic")

set_visible

Set visibility of a node.

ParameterTypeDescription
id *stringNode ID
value *booleanVisible (true/false)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_constraints

Set resize constraints for a node within its parent.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
horizontalstringHorizontal constraint
page_idstringOptional page ID to target within the document
verticalstringVertical constraint

set_rotation

Set rotation angle of a node in degrees.

ParameterTypeDescription
angle *
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_minmax

Set min/max width and height constraints on a node.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
max_height
max_width
min_height
min_width
page_idstringOptional page ID to target within the document

set_font_range

Set font properties for a text range.

ParameterTypeDescription
end *
id *stringNode ID
start *
colorstringText color (hex)
document_idstringOptional Kalka document/tab ID to target
familystringFont family name
page_idstringOptional page ID to target within the document
size
stylestringFont style

set_text_resize

Set text auto-resize mode.

ParameterTypeDescription
id *stringNode ID
mode *stringResize mode
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_blend

Set blend mode of a node.

ParameterTypeDescription
id *stringNode ID
mode *stringBlend mode
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_locked

Set locked state of a node.

ParameterTypeDescription
id *stringNode ID
value *booleanLocked (true/false)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

set_stroke_align

Set stroke alignment of a node.

ParameterTypeDescription
align *stringStroke alignment
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
id *stringNode ID
brushstringBrush as TYPE:id: a stretch brush bends one shape along the path, a scatter brush drops copies
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
width_profilestringWidth profile preset

set_image_fill

Set an image fill on a node from base64-encoded image data.

ParameterTypeDescription
id *stringNode ID
image_data *stringBase64-encoded image bytes (PNG, JPEG, or WEBP)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
scale_modestringImage 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.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
id *stringNode ID
reactions *arrayInteractions 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_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
flows *arrayFlows in order, by the frame each starts at
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

clone_node

Clone (duplicate) a node.

ParameterTypeDescription
id *stringNode ID to clone
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_move

Move a node to new coordinates.

ParameterTypeDescription
id *stringNode ID
x *
y *
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

rename_node

Rename a node in the layers panel.

ParameterTypeDescription
id *stringNode ID
name *stringNew name
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

group_nodes

Group selected nodes.

ParameterTypeDescription
ids *arrayNode IDs to group
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

ungroup_node

Ungroup a group node.

ParameterTypeDescription
id *stringGroup node ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

flatten_nodes

Flatten nodes into a single vector.

ParameterTypeDescription
ids *arrayNode IDs to flatten
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_to_component

Convert one or more frames/groups into components.

ParameterTypeDescription
ids *arrayNode IDs to convert
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_bounds

Get absolute bounding box of a node.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_ancestors

Get the ancestor chain from a node to the page root.

ParameterTypeDescription
id *stringNode ID
depth
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_children

Get direct children of a node.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_tree

Get a node tree with types and hierarchy.

ParameterTypeDescription
id *stringNode ID
depth
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_bindings

Get variable bindings for a node.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

node_replace_with

Replace a node with JSX content.

ParameterTypeDescription
id *stringNode ID to replace
jsx *stringJSX string for the replacement
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
cols
document_idstringOptional Kalka document/tab ID to target
gap
idsarrayNode IDs to arrange (default: all top-level children)
modestringLayout mode
page_idstringOptional 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.

ParameterTypeDescription
clientFrameworksstringFrameworks of the client project; accepted and ignored
clientLanguagesstringLanguages of the client project; accepted and ignored
document_idstringOptional Kalka document/tab ID to target
fileKeystringFigma file key; ignored, Kalka reads the open document
nodeIdstring
page_idstringOptional page ID to target within the document

list_variables

List all design variables (colors, numbers, strings, booleans).

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
typestringFilter by variable type

list_collections

List all variable collections.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

get_variable

Get a variable by ID.

ParameterTypeDescription
id *stringVariable ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

find_variables

Find variables by name pattern.

ParameterTypeDescription
query *stringName substring (case-insensitive)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
typestringFilter by type

create_variable

Create a new variable in a collection.

ParameterTypeDescription
collection_id *stringCollection ID
name *stringVariable name
type *stringVariable type
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
valuestringInitial value (hex for COLOR, number for FLOAT, etc.)

set_variable

Set the value of a variable for a specific mode.

ParameterTypeDescription
id *stringVariable ID
mode *stringMode ID
value *stringValue (hex for COLOR, number for FLOAT, etc.)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

delete_variable

Delete a variable.

ParameterTypeDescription
id *stringVariable ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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".

ParameterTypeDescription
field *stringProperty 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 *stringNode ID
variable_id *stringVariable ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

unbind_variable

Remove a variable binding from a node property.

ParameterTypeDescription
field *stringProperty 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 *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

get_collection

Get a variable collection by ID.

ParameterTypeDescription
id *stringCollection ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

create_collection

Create a new variable collection.

ParameterTypeDescription
name *stringCollection name
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

delete_collection

Delete a variable collection and all its variables.

ParameterTypeDescription
id *stringCollection ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

boolean_union

Union (combine) multiple nodes.

ParameterTypeDescription
ids *arrayNode IDs to union
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

boolean_subtract

Subtract the second node from the first.

ParameterTypeDescription
ids *arrayNode IDs (first minus rest)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

boolean_intersect

Intersect multiple nodes.

ParameterTypeDescription
ids *arrayNode IDs to intersect
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

boolean_exclude

Exclude (XOR) multiple nodes.

ParameterTypeDescription
ids *arrayNode IDs to exclude
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

path_get

Get vector path data of a node.

ParameterTypeDescription
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

path_set

Set vector path data on a node. Provide a VectorNetwork JSON.

ParameterTypeDescription
id *stringNode ID
path *stringVectorNetwork JSON
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

path_scale

Scale vector path from center.

ParameterTypeDescription
factor *
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

path_flip

Flip vector path horizontally or vertically.

ParameterTypeDescription
axis *stringFlip axis
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

path_move

Move all path points by an offset.

ParameterTypeDescription
dx *
dy *
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

viewport_get

Get current viewport position and zoom level.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

viewport_set

Set viewport position and zoom.

ParameterTypeDescription
x *
y *
zoom *
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

export_svg

Export nodes as SVG markup. Returns the SVG string.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
idsarrayNode IDs to export. Omit to export all top-level nodes on the current page.
page_idstringOptional page ID to target within the document
pathstringWrite 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.

ParameterTypeDescription
deliverystring"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_idstringOptional Kalka document/tab ID to target
idsarrayNode IDs to export. Omit to export all top-level nodes on the current page.
page_idstringOptional page ID to target within the document
pathstringWrite 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.

ParameterTypeDescription
deliverystring"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_idstringOptional Kalka document/tab ID to target
formatstringImage format
idsarrayNode IDs to export. Omit to export all top-level nodes on the current page.
maxEdge
page_idstringOptional page ID to target within the document
pathstringWrite 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
limit
page_idstringOptional page ID to target within the document
show_similarbooleanInclude similar-color clusters for potential merging
threshold

analyze_typography

Analyze typography usage across the current page. Shows font families, sizes, weights, and their frequencies.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
group_bystringGroup results by a property
limit
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
idsarrayLayers to check, with their descendants (default: the current page)
limit
page_idstringOptional page ID to target within the document
presetstringRule preset: recommended (default), strict, or accessibility (contrast, touch targets, text size)
rulesarrayCheck 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
idsarrayLayers to check, with their descendants (default: the current page)
page_idstringOptional page ID to target within the document
presetstringRule preset: recommended (default), strict, or accessibility (contrast, touch targets, text size)
rulesarrayCheck only these rules of the preset
suggestionsbooleanAlso apply the first suggestion of each finding

analyze_spacing

Analyze spacing values (gap, padding) across the current page. Checks grid compliance.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
grid
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
limit
min_count
min_size
page_idstringOptional 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.

ParameterTypeDescription
categorystringComma-separated categories: sibling-overlap, parent-overflow, overlay (default: all)
document_idstringOptional Kalka document/tab ID to target
include_absolutebooleanInclude absolutely-positioned nodes in the analysis
include_hiddenbooleanInclude hidden nodes in the analysis
include_lockedbooleanInclude locked nodes in the analysis
limit
min_area
min_ratio
pagestringLimit analysis to nodes on the named page
page_idstringOptional page ID to target within the document
scopestringWhich pairs to inspect: all, same-parent, cross-parent, top-level, inside-parent (default: all)
severitystringMinimum severity to include: critical, major, minor, info (default: info)
typestringComma-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.

ParameterTypeDescription
attributes *stringJSX attributes to set, named as the JSX export writes them. Example: w={200} bg="#FF0000" opacity={0.5}
id *stringNode ID
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
patch *stringPatch text from diff_create, diff_show, or diff_changes
document_idstringOptional Kalka document/tab ID to target
dryRunbooleanCheck and report changes without applying
forcebooleanApply even when current values differ from the patch
page_idstringOptional 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.

ParameterTypeDescription
code *stringPlugin API JavaScript; top-level await and return are allowed
descriptionstringWhat the script does; accepted and ignored
document_idstringOptional Kalka document/tab ID to target
fileKeystringFigma file key; ignored, Kalka reads the open document
page_idstringOptional page ID to target within the document
skillNamesstringSkills 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…

ParameterTypeDescription
collectionstringFilter by collection name (substring, case-insensitive)
document_idstringOptional Kalka document/tab ID to target
formatstringcss: :root and mode scopes; tailwind: @theme, mode scopes and variants; dtcg: W3C design token files
page_idstringOptional page ID to target within the document
typestringFilter 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.

ParameterTypeDescription
files *arrayToken files, each with its path (folders name collections) and JSON text
add_missingbooleanAdd tokens that match no variable (default true)
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
stylesbooleanMake 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
pagestringPage name to analyze (default: current page)
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
pathstringPath 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.

ParameterTypeDescription
path *stringPath to the design file, absolute or relative to the MCP root
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document

new_document

Create a new empty document with an optional save path inside the configured MCP root.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
pathstringPath 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional page ID to target within the document
pathstringWith unsaved "save": .fig path for a document never saved, inside the MCP root
unsavedstringWhat 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.

ParameterTypeDescription
document_id *stringDocument/tab ID from list_documents
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
document_idstringOptional Kalka document/tab ID to target
page_idstringOptional 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.

ParameterTypeDescription
settings *objectPartial 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.