MCP tools
The 226 tools an assistant can call when Klayson is connected from a connector directory: 83 read, 115 write and 28 sensitive writes.
Read tools only look. Write tools add to or change the connected workspace. Sensitive writes delete, overwrite, turn off or share something and may not be undoable: an assistant asks the person before calling one.
Connect
Klayson is a remote MCP server. Directory listings connect to https://api.klayson.com/mcp/directory; a custom connector can use https://api.klayson.com/mcp.
Sign-in is OAuth 2.1 with PKCE (S256) and dynamic client registration (RFC 7591). The server's 401 carries a WWW-Authenticate header pointing at its protected-resource metadata.
The person approves on Klayson's own page, signed in to the workspace the assistant will work in. The access token is a workspace key they can see and revoke in Settings.
Scopes: brand:read, brand:write, projects:read, projects:write, generate, references:read.
Read only: ticking Read only when approving gives a key with the read scopes alone. The server then lists and runs only the Read tools below.
Usage and limits
Every workspace has an amount of usage a month, set by its plan, that resets on the 1st. Making ads uses more of it than reading.
Tool calls are limited to 120 a minute and 20,000 a day for each workspace, and to a number of calls a month by plan.
Over a limit, the call returns a plain sentence saying which limit and when it opens again. Nothing is charged on top of the plan.
Ad search answers from Klayson's own ad index. The directory listings never read Meta, TikTok or Instagram live.
Errors
A tool that cannot do what it was asked returns isError: true with one sentence that says what went wrong and what to do next, for example get_frame_tree needs design_id. A tool this connection cannot use says it is not available here. A read-only connection asked for a write says it was connected read only.
Read tools (83)
get_me Get me
Who am I: user, workspace, brand summary, and this month's usage. Read-only: call it to verify the connection.
Inputs: none. Side effects: none, it only reads.
get_brand_extract Get brand extract
One brand read as Brand Extract v1: brand and facts, identity, materials, composition and page.
Inputs: read_id (string, required). Side effects: none, it only reads.
find_templates Find templates
The library templates that best fit what the person asked for, matched on their words.
Inputs: ask (string, required), limit, kit, type. Side effects: none, it only reads.
ad_details Ad details
One ad in full: copy, script (transcript, on-screen text, scenes), every tag (hook, angle, offer, price, persuasion, why it works), media with sizes and duration, how long it has run, relaunch history, the advertiser, and the sibling variations with what differs.
Inputs: ad_id (string, required), read. Side effects: none, it only reads.
ad_trend Ad trend
How many ads started per month (and how many are still running) for a filter: an industry, a city, an advertiser.
Inputs: industry, city, country, business_type, advertiser, media_type, active_only, days, months. Side effects: none, it only reads.
aggregate_ads Aggregate ads
Count and compare ads in the index by one dimension: angle, format, talent, production, storyline, industry, advertiser, media_type, platform, month, offer_present, has_person, has_price, language, city.
Inputs: group_by (string: angle, format, talent, production, storyline, industry, advertiser, media_type, required), industry, city, country, business_type, advertiser, media_type, active_only, days, limit. Side effects: none, it only reads.
copy_style Copy style
Copy a layer's properties: its fills, stroke, corners, effects, opacity, blend and mask, and on a text its type (face, size, weight, line, letter, colour, decoration, outline, its text style).
Inputs: design_id (string, required), node_id (string, required), if_changed_since. Side effects: none, it only reads.
export_creators Export creators
Up to 200 ids.
Inputs: ids (string, required). Side effects: none, it only reads.
find_nodes Find nodes
Find layers by what they are, across one ad, a whole canvas or the workspace: a word in the name or text (query), the kind (tag), the words of a text (text_value: a substring, or a pattern with *), and styles (filters: a list of {style_name, style_value}, all must match; * is a wildcard in both, e.g. style_name "border*").
Inputs: design_id, canvas_id, scope, query, tag, text_value, filters, style_name, style_value, limit, if_changed_since. Side effects: none, it only reads.
get_ad_search Get ad search
Reopen one recent ad search (list_ad_searches): the same words, the same filters and the same ads, read back from the index.
Inputs: thread_id (string, required). Side effects: none, it only reads.
get_ad_thread Get ad thread
One conversation over the ads data: every question, answer and its blocks.
Inputs: thread_id (string, required). Side effects: none, it only reads.
get_brand Get brand
The workspace's brand kit: url, about, voice, colors, style, assets.
Inputs: none. Side effects: none, it only reads.
get_brand_context Get brand context
The brand as an agent should read it: name, category, what it is, audience, voice with tone examples, value props, offers, proof points, calls to action, products with pictures, logo, colours by role, typefaces, the creative styles to lean on, socials, the person's own rules (your_rules), words_to_avoid and allowed_claims.
Inputs: none. Side effects: none, it only reads.
get_brand_facts Get brand facts
The brand's numbers and claims: the lines the person kept with save_brand_facts, else the ones the site read found (its stated stats and proof points, word for word).
Inputs: none. Side effects: none, it only reads.
get_brand_materials Get brand materials
The brand materials this workspace has read (extract_brand, or the brand read with the materials step on): the measured description and, for one read_id, every kept file as a link that expires in seven days (fonts, logos, pictures, stylesheets, the page, a screenshot).
Inputs: read_id. Side effects: none, it only reads.
get_brand_pieces Get brand pieces
The brand's own pieces: its running ads and social posts, as pictures, campaign ads first.
Inputs: limit. Side effects: none, it only reads.
get_brand_style Get brand style
The brand's style as its ads use it (onboarding's "This is your brand style"): the headline and label faces, the colours (primary, secondary, accent, background, ink), the button (colour, shape, case, arrow), the logo and its light version, what the site read found, whether the site gave little (then three starter styles), the fonts to choose from, whether the person confirmed it, and a sample ad (a canvas document) drawn in it with their product.
Inputs: none. Side effects: none, it only reads.
get_canvas Get canvas
One canvas at a glance: its name, its rev and how many frames, groups, pictures, notes and shapes it holds. get_canvas_items reads the board itself.
Inputs: canvas_id (string, required). Side effects: none, it only reads.
get_canvas_guide Get canvas guide
How to design a good ad on Klayson's canvas, for any agent: the method (brief first, a proven layout before free composition, one section at a time, a screenshot and a verdict after each, fix in place, never start over), the checklist the lint measures, then the HTML contract, type, spacing, the brand rule and the tools.
Inputs: method. Side effects: none, it only reads.
get_canvas_info Get canvas info
Start here on a canvas, before reading any one ad: one call that tells you everything on it.
Inputs: canvas_id (string, required). Side effects: none, it only reads.
get_canvas_items Get canvas items
What is on a canvas (the board: frames, groups of frames, text notes, images), as an outline: one line an item with its kind, title, id, box [x,y wxh], a frame's size, design_id and status (done, queued, making, waiting, failed) and how it is shown (a Facebook or Instagram post, else the creative alone), a group's layout and progress. words=true adds every ad's words.
Inputs: canvas_id (string, required), if_changed_since, words. Side effects: none, it only reads.
get_comment_thread Get comment thread
One comment thread in full: where it is pinned (the ad, the layer, the point as fractions of the layer's box), every comment in order with who wrote it (a person or an agent) and whether it is resolved.
Inputs: thread_id (string, required). Side effects: none, it only reads.
get_competitors Get competitors
The last competitor read: each competitor with its strongest running still ads (Meta's impression order, days running, the index score, the angle, the hook, why it works) and the three chosen as sources.
Inputs: none. Side effects: none, it only reads.
get_computed_styles Get computed styles
The exact values a node is drawn with, as the browser computed them: every var() resolved to its token's value, the face, size and ink a text inherits, colours in hex, and its box in px of the export size (1080 wide for a feed ad) and in % (of the frame, and its offsets and size in % of its parent).
Inputs: design_id (string, required), node_ids (array, required), if_changed_since. Side effects: none, it only reads.
get_design Get design
One creative in full: its picture (render_url), the words to publish it with (ad_copy: primary_text, headline, description and cta, its button), and asset_ids: the person's photos it shows, in order (a before and after shows two).
Inputs: design_id (string, required). Side effects: none, it only reads.
get_first_ads Get first ads
The onboarding's first ads step: the brand's main product (name, price, its cutout or photo, asset_id), every product with a photo and the person's other photos to choose from instead, the brand card shown when there is no product (name, domain, logo, a line from the site, its colours), the three frame titles, and started (canvas_id and url) when the first ads were made already.
Inputs: none. Side effects: none, it only reads.
get_font_info Get font info
Which typefaces to use on a frame: the brand's own display and body faces (as tokens), the curated catalogue with what each feels like, and the rule that any Google Fonts family name works as a font-family value.
Inputs: none. Side effects: none, it only reads.
get_frame_html Get frame html
The frame as HTML with inline styles and layer-name attributes: copy as code, or read exactly what is there.
Inputs: design_id (string, required), if_changed_since. Side effects: none, it only reads.
get_frame_tree Get frame tree
Orient yourself on an ad: its layers as an outline, one line each (kind, name, id, the box it is drawn in as [x,y wxh] in frame pixels, a text's first words, hidden or locked), about 1 to 2k tokens.
Inputs: design_id (string, required), depth, node_id, fields, full, if_changed_since. Side effects: none, it only reads.
get_job Get job
Status of a background job: queued | running | done | failed. done carries output, failed carries error.
Inputs: job_id (string, required), wait. Side effects: none, it only reads.
get_layout Get layout
One layout of the library with all its metadata (as list_library gives it): its argument, formats, angles, goals, occasions, offer, copy budget per slot, tone, product types, inputs, sizes, the reference ad and why it works.
Inputs: layout_id (string, required). Side effects: none, it only reads.
get_library_template Get library template
One library template with its ad as a canvas document (the layout, the proven ad's words and products): what the Templates page's dialog draws and what a canvas copies into its Template frame.
Inputs: template_id (string, required). Side effects: none, it only reads.
get_node_image Get node image
The picture inside an image node (or a frame's background-image), to look at it closely: its source url, its natural size, its fit and crop, and a downscaled JPEG (768 px on the long side) you can see.
Inputs: design_id (string, required), node_id (string, required). Side effects: none, it only reads.
get_node_info Get node info
Everything about nodes: their styles as set, text or picture, parent and children, and the box the browser laid them out in (x, y, width, height in frame pixels, and whether text overflows; a turned node also its rotate and unrotated_box, an absolute one its constraints, a hidden one hidden, a locked one locked (layer_state has both), a cropped picture its crop; the ad's root its background as seen, resolved, with its token (background: hex, token, via, how_to_change); a style set by a token or in container units also comes resolved, e.g. resolved.fontSize_px; a shader picture its shader: name, every param with its range and current value, changed with set_shader).
Inputs: design_id (string, required), node_ids, fields, if_changed_since. Side effects: none, it only reads.
get_onboarding_product Get onboarding product
The onboarding's product step: the brand's main product with its cutout (a transparent PNG of the product, url, grade, whether the edges look rough and the one line to show then), the other photos it could be cut from (candidates) and the brand colour it sits on.
Inputs: none. Side effects: none, it only reads.
get_plan Get plan
A plan with its rows, each row's creative (render_url, ad copy) once made, and the person's verdicts.
Inputs: plan_id (string, required). Side effects: none, it only reads.
get_selection Get selection
What the person has selected on the canvas right now: the frame and the node, with its name and kind, so 'make this bigger' can mean the thing under their cursor.
Inputs: none. Side effects: none, it only reads.
get_selection_colors Get selection colors
Every colour the given layers use (and the layers inside them); leave node_ids out for the whole ad.
Inputs: design_id (string, required), node_ids, if_changed_since. Side effects: none, it only reads.
get_settings Get settings
Workspace settings, including the use_proven_ads toggle.
Inputs: none. Side effects: none, it only reads.
get_template Get template
One published template, no sign-in: its page (title, author, summary, about, the questions and answers, how it works per assistant, a seasonal countdown's date), its set of ads, how many times it was used and up to four related templates. use_workflow with its token copies the set onto your canvas.
Inputs: slug (string, required), preview. Side effects: none, it only reads.
get_tokens Get tokens
The frame's design tokens: colours (--color-primary, --color-secondary, --color-accent, --color-bg, --color-ink, --color-muted), typefaces (--font-display, --font-body) and --radius, as CSS variables every style can use with var().
Inputs: design_id (string, required), if_changed_since. Side effects: none, it only reads.
list_ad_categories List ad categories
The Ad Library's categories (food and drink, supplements, skincare, AI tools, restaurants…) with how many active ads the index holds in each, grouped by segment (consumer brands, software and apps, local businesses, agencies and creators).
Inputs: none. Side effects: none, it only reads.
list_ad_searches List ad searches
A search reopens with get_ad_search at no cost.
Inputs: limit. Side effects: none, it only reads.
list_ad_templates List ad templates
Klayson's own ad templates: generated outputs that look good, curated by hand, usable as a reference ad (an asset frame with kind template).
Inputs: none. Side effects: none, it only reads.
list_ad_threads List ad threads
The caller's conversations over the ads data, newest first.
Inputs: limit. Side effects: none, it only reads.
list_assets List assets
Assets in this workspace.
Inputs: kind, brief, limit, offset. Side effects: none, it only reads.
list_bookmarks List bookmarks
The saved ads, newest first, with the ads themselves.
Inputs: collection_id, limit. Side effects: none, it only reads.
list_canvases List canvases
The workspace's canvases.
Inputs: q, sort, limit. Side effects: none, it only reads.
list_category_ads List category ads
One Ad Library category's ads from the index, best first (the index score: days running, variations, recency), 24 a page.
Inputs: slug (string, required), q, country, media_type, chip, sort, limit, offset. Side effects: none, it only reads.
list_collections List collections
The collections of saved ads, with their size and a thumbnail each.
Inputs: none. Side effects: none, it only reads.
list_comments List comments
The comment threads on a canvas (Figma's comments): each pinned to an ad (design_id) and a layer (node_id) or to the canvas, with its first and last comment, the number of replies and whether it is resolved. status open (default), resolved or all; design_id keeps one ad's.
Inputs: canvas_id (string, required), design_id, status, if_changed_since. Side effects: none, it only reads.
list_components List components
List the workspace's components (Figma's Assets panel): each with its name, the ad and layer of its main, its revision, how many instances each ad holds, and the main's layers (node). canvas_id keeps one canvas's. main_missing says the main's layer was deleted (its instances keep the last version).
Inputs: canvas_id. Side effects: none, it only reads.
list_creator_lists List creator lists
The workspace's creator lists with their creators.
Inputs: list_id. Side effects: none, it only reads.
list_designs List designs
The workspace's creatives, newest first, each with its name and the page it is on (page_id; see list_pages). page=<a page's name or id> gives one page's creatives ('the ads on the launch page'); Miscellaneous is the page for creatives on no page of their own. slim=true leaves the documents out.
Inputs: page, limit, slim. Side effects: none, it only reads.
list_library List library
The layout library: every layout Klayson designs ads with, and what each is for: its argument (proof stat, this vs that, offer, scene, …), the formats and angles it serves, the goals and occasions it suits, the offer kinds it has a place for, its copy budget in words, tone, the product types it suits, how many products it shows, what the brand must give for it (a cutout, an offer, a stat, a review), the sizes and placements it fills, the reference ad it was rebuilt from and why it works.
Inputs: format, argument, goal, occasion, include_removed. Side effects: none, it only reads.
list_library_templates List library templates
The Templates page's ads: every library template (a proven ad rebuilt as a Klayson layout, shown as a finished example), with its picture, its layout and whether this workspace bookmarked it. q searches the library's metadata (format, angle, goal, occasion, offer, tone, product type) and each template's words.
Inputs: q, kit, type, bookmarked, collection_id, admin, limit, offset. Side effects: none, it only reads.
list_pages List pages
The workspace's pages of creatives, in order, each with its name, how many creatives are on it and one picture.
Inputs: none. Side effects: none, it only reads.
list_plans List plans
The workspace's plans, newest first.
Inputs: limit. Side effects: none, it only reads.
list_shaders List shaders
Every shader Klayson can draw in an ad, as a still baked into a picture: its name, what it looks like, its kind (background: a ground or a light; filter: over a backdrop or lifestyle photo, never the product; shape: a logo or a word in a material), where it fits (ground, backdrop, treatment, kit).
Inputs: kind, use, name, brief, fields, limit, offset. Side effects: none, it only reads.
list_template_bookmarks List template bookmarks
The saved templates, newest first: library ad templates with their pictures (kind ad) and workflow templates (kind workflow, workflow:{token}).
Inputs: collection_id. Side effects: none, it only reads.
list_text_styles List text styles
An ad's text styles: each {id, name, styles (face, size, weight, line height, letter spacing, case, decoration), resolved (in px and the face's name, never var()), uses (the text layers on it)}. suggested are the brand's five (Headline, Sub, Body, Label, CTA) from its design system and the ad's type scale, not stored yet: apply_text_style with one stores it.
Inputs: design_id (string, required), if_changed_since. Side effects: none, it only reads.
list_versions List versions
An ad's version history: the named versions (save_version) and the automatic ones (every save, folded into one entry per stretch of editing by the same hand), newest first, each {version_id, name, named, created_at, by: you | an agent | Klayson, saves}.
Inputs: design_id (string, required), limit, detail, if_changed_since. Side effects: none, it only reads.
list_workflow_templates List workflow templates
The templates Klayson curates and has published, in order, no sign-in: each a set of ads with its title, slug (its page is /ad-templates/{slug}), category, one-line summary, author, pictures, how many times it was used, and its token. use_workflow with the token copies the set onto your canvas; get_template reads one template's page.
Inputs: preview. Side effects: none, it only reads.
measure_nodes Measure nodes
Measure spacing: the distances in frame px from one layer (node_id) to another (to_node_id) or, without to_node_id, to the ad's edges.
Inputs: design_id (string, required), node_id (string, required), to_node_id, boxes, if_changed_since. Side effects: none, it only reads.
meta_account_read Meta account read
What Klayson read from the connected Meta ad account: whether the read is queued, reading, done or waiting on Meta, and the account context it built (what is live, the last 30 days and the last 7 against the 7 before, the top ads by spend and by results with what each says and shows, formats, and anything broken: rejected ads, no pixel, live ads with no spend).
Inputs: none. Side effects: none, it only reads. Only where Meta publishing is switched on for the workspace.
meta_ad_results Meta ad results
Where these ads stand on Meta (publishing, paused, active, rejected, couldn't publish) and, for ads on Meta, the last 7 days from Meta: spend, impressions, clicks, CTR and cost per result.
Inputs: design_ids (array, required), refresh. Side effects: none, it only reads. Only where Meta publishing is switched on for the workspace.
meta_campaigns Meta campaigns
The recent campaigns and ad sets in an ad account, to add new ads to an existing one.
Inputs: ad_account_id. Side effects: none, it only reads. Only where Meta publishing is switched on for the workspace.
meta_preflight Meta preflight
Check ads before they are published to Meta, reading only (nothing is published, nothing spent): for each ad its size for each placement (feed takes 4:5 or 1:1 whole, stories and reels 9:16), words cut off or outside the text-safe area (the same lint as screenshot_frame), the primary text, headline and description against what Meta takes and shows, the export's file size and whether there is one, and a call to action on the creative and as Meta's button.
Inputs: design_ids, canvas_id, measure. Side effects: none, it only reads. Only where Meta publishing is switched on for the workspace.
meta_status Meta status
Whether this workspace's Meta ad account is connected: the default ad account (currency, timezone), the Page and Instagram account ads run as, the pixel, every ad account it can publish to, and whether the login expired. refresh=true reads them from Meta again.
Inputs: refresh. Side effects: none, it only reads. Only where Meta publishing is switched on for the workspace.
my_ads_performance My ads performance
How this workspace's own Meta ads are doing over the last days, from the connected ad account: spend, impressions, reach (people), clicks, results, cost per result, click rate per ad, the account's own reach (reach never adds up across ads), with a maturity (fresh, early, proven) that says how much to trust each number, and a plain-words summary.
Inputs: days. Side effects: none, it only reads.
own_ads Own ads
The brand's own ads running on Facebook and Instagram now, still pictures first, with whether the person wants new creatives to match their style (the brand document's match_own_style, set with update_brand).
Inputs: none. Side effects: none, it only reads.
pick_color Pick color
The eyedropper: the colour drawn at a point of the ad (x and y from 0 to 1 of the frame, 0.5, 0.5 is the middle), read off the rendered ad, pictures and gradients included, with the ad's token of that colour when one matches.
Inputs: design_id (string, required), x (number, required), y (number, required), radius, if_changed_since. Side effects: none, it only reads.
preview_brand_style Preview brand style
The sample ad drawn with these style fields, nothing saved: for showing a change before it is kept.
Inputs: style. Side effects: none, it only reads.
read_page Read page
Read one public web page (a competitor's landing page, a product page, a reviews page, an article) and return its title, description, main text and pictures.
Inputs: url (string, required). Side effects: none, it only reads. Results come from Klayson's own ad index.
search_fonts Search fonts
The font picker as data: the brand's own faces first (the ad's display and body tokens), then the faces this workspace used recently, then every Google font that matches query (by name, or category: sans, serif, display, handwriting, mono).
Inputs: query, category, limit. Side effects: none, it only reads.
search_icons Search icons
Every lucide icon the web app ships (about 1,700, the Icon picker's set), by name: q matches the name and lucide's aliases (leaf, zap, truck, shield-check; home finds house), exact and prefix first; without q the kit's own icons first, then the rest. total is how many match; limit (default 60, at most 200) and offset page through them. svg false gives the names alone (an agent choosing by name); each comes with its 24x24 svg by default. add_layer kind icon places one, set_icon swaps an icon layer for another.
Inputs: q, limit, offset, svg. Side effects: none, it only reads.
show_ads Show ads
Show the person a canvas's ads in Klayson's card, once: a gallery that keeps itself up to date (every few seconds it reads the ads again), so an ad you make, change or add later shows up in it without another call.
Inputs: canvas_id (string, required), group_id, design_ids. Side effects: none, it only reads.
slack_channels Slack channels
The channels Klayson can post the morning's ads into: public channels, and private ones it has been invited to.
Inputs: none. Side effects: none, it only reads.
slack_install_url Slack install url
The link that adds Klayson to a Slack workspace.
Inputs: back. Side effects: none, it only reads.
slack_status Slack status
Whether this workspace has Klayson in Slack, and which Slack team.
Inputs: none. Side effects: none, it only reads.
suggested_questions Suggested questions
Questions this workspace could ask Klayson, written for its own brand: its category, its competitors, its products, its city.
Inputs: none. Side effects: none, it only reads.
todays_ads Todays ads
The workspace's newest set of ad creatives from Klayson (the three made at signup, or the morning's set once the mornings are on), with the read of the connected ad account when there is one and the earlier sets.
Inputs: wait. Side effects: none, it only reads.
Write tools (115)
extract_brand Extract brand
Read a brand from its website and keep its materials: every stylesheet and the rendered page, the webfont files it serves, every logo candidate, its largest pictures and a screenshot.
Inputs: url (string, required), label, depth, fresh. Side effects: adds to or changes the connected workspace.
check_against_brand Check against brand
Check a picture or a canvas frame against the brand's own pieces: the palette, the ground, the case, where the logo sits, how large the product is.
Inputs: design_id, asset_id, image_url. Side effects: adds to or changes the connected workspace.
add_board_shape Add board shape
Draw a shape on the canvas itself, outside any ad (the rail's Rectangle, Ellipse, Line, Arrow, Polygon, Star, Pen and Icon on the empty canvas): a mark-up, an arrow pointing at an ad, a box around a group.
Inputs: canvas_id (string, required), shape (string: rect, ellipse, line, arrow, polygon, star, path, icon, required), x, y, w, h, fill, stroke, stroke_width, radius, sides, ratio, path, view, closed, icon, rotation, title, item_id, rev. Side effects: adds to or changes the connected workspace.
add_brand_piece Add brand piece
Keep one picture as a piece of the brand's own work (an ad or post the person uploaded, by asset id).
Inputs: asset_id (string, required), tag. Side effects: adds to or changes the connected workspace.
add_comment Add comment
Comment on a canvas: pin a new thread to an ad (design_id), a layer of it (node_id) and a point (x, y as fractions 0 to 1 of the layer's box, else of the ad; the centre by default), or reply to a thread (thread_id).
Inputs: canvas_id (string, required), body (string, required), design_id, node_id, x, y, thread_id, rev. Side effects: adds to or changes the connected workspace.
add_frames Add frames
Add frames: n empty ads (a blank document in the brand's tokens, to design with write_html) or, with template_ids, the canvas's own editable copies of those library templates (list_library_templates), one frame each. size 4:5 (default), 1:1 or 9:16.
Inputs: canvas_id (string, required), n, size, template_ids, group_id, group_title, x, y, item_ids, rev. Side effects: adds to or changes the connected workspace.
add_image Add image
It keeps the picture's own shape, 288 wide: an upload is measured when it is stored; w and h are the picture's size in pixels when you know it and the stored picture has none.
Inputs: canvas_id (string, required), asset_id, url, ad_id, template_id, x, y, title, w, h, item_id, rev. Side effects: adds to or changes the connected workspace.
add_layer Add layer
Add a text or a picture layer to an ad. kind text with text (the words; it takes the ad's body face and ink through its tokens) or kind image with asset_id or url (Klayson's storage).
Inputs: design_id (string, required), kind (string: text, image, icon, required), text, asset_id, url, icon, color, size, after, parent_id, index, box, styles, name, rev. Side effects: adds to or changes the connected workspace.
add_product Add product
Add one of the person's own products to their brand guide from its page link: the product's name, price, description and picture are read from the page, and the picture is stored so creatives can place it.
Inputs: url (string, required). Side effects: adds to or changes the connected workspace.
add_shader Add shader
Place a shader on the canvas, as the rail's Shader tool does: a new frame (an ad of its own, 4:5 unless size says) whose one layer is the shader filling it, baked from its recipe.
Inputs: canvas_id (string, required), name (string, required), params, frame, size, x, y, w, title, item_id, png_base64, recipe, rev. Side effects: adds to or changes the connected workspace.
add_shape Add shape
Draw a shape on an ad, O ellipse, polygon, star, L line, ⇧L arrow): shape and where, box {x, y, w, h} as fractions of the frame (x, y the top left; a line or an arrow takes from {x, y} and to {x, y} instead, also fractions).
Inputs: design_id (string, required), shape (string: rectangle, ellipse, polygon, star, line, arrow, required), box, from, to, fill, stroke, weight, points, ratio, corner, start, end, w, h, name, parent_id, rev. Side effects: adds to or changes the connected workspace.
add_text Add text
Put a note on the canvas (text that belongs to the canvas, never to an ad, never exported): a reminder, a heading over a group, what to do next. x, y in canvas px (default: right of everything). style: size (px), color (text, muted, accent or #RRGGBB), weight, align.
Inputs: canvas_id (string, required), text (string, required), x, y, w, title, style, item_id, rev. Side effects: adds to or changes the connected workspace.
align_nodes Align nodes
Align components: left, center, right, top, middle, bottom, or distribute_horizontal / distribute_vertical (three or more, equal gaps).
Inputs: design_id (string, required), node_ids (array, required), align (string: left, center, right, top, middle, bottom, distribute_horizontal, distribute_vertical, required), to, boxes, rev. Side effects: adds to or changes the connected workspace.
apply_style Apply style
Copy one layer's properties onto others in one call (copy_style then paste_style): from_node_id in this ad, or in from_design_id (another ad of the workspace).
Inputs: design_id (string, required), node_ids (array, required), from_node_id (string, required), from_design_id, rev. Side effects: adds to or changes the connected workspace.
apply_text_style Apply text style
Put a text style on text layers (Figma's text style picker): its values are written onto them and they stay linked, so set_text_style later changes them all.
Inputs: design_id (string, required), node_ids (array, required), style_id, rev. Side effects: adds to or changes the connected workspace.
approve_ad Approve ad
Yes, skip, or change on one of today's ads.
Inputs: design_id (string, required), verdict (string: yes, skip, change, required), note. Side effects: adds to or changes the connected workspace.
batch_edit Batch edit
Many edits to one ad in one call, applied in order, all or nothing: one save, one version, one undo step, one receipt. ops is a list of {tool, args}: tool one of the canvas's edits (the enum), args that tool's own arguments (design_id is this one).
Inputs: design_id (string, required), ops (array, required), rev. Side effects: adds to or changes the connected workspace.
batch_edit_many Batch edit many
batch_edit on many ads in one call: edits = [{design_id, rev?, ops}], each ad's ops as batch_edit takes them (the same tools and arguments).
Inputs: edits (array, required). Side effects: adds to or changes the connected workspace.
bookmark_ad Bookmark ad
Saving keeps our own copy of the creative.
Inputs: ad_id (string, required), collection_id, collection_name, note. Side effects: adds to or changes the connected workspace.
bookmark_template Bookmark template
Save a template for later, a library ad template or a workflow template (workflow:{token}), on its own or into a collection (the same collections as saved ads: collection_id from list_collections, or a new one by name).
Inputs: template_id (string, required), collection_id, collection_name. Side effects: adds to or changes the connected workspace.
confirm_product_cutout Confirm product cutout
The person confirmed that a product's cutout is their product and looks right: stored on the cutout with who and when.
Inputs: product. Side effects: adds to or changes the connected workspace.
create_canvas Create canvas
Start a new canvas: an empty board named "Untitled canvas" unless a name is given.
Inputs: name, reference_ad_id. Side effects: adds to or changes the connected workspace.
create_canvas_from_templates Create canvas from templates
Make a new canvas from library templates (list_library_templates) or from a collection of bookmarked ones: one frame per template ad, each the canvas's own editable copy, in a group named after the set, with the brand's product placed in each (its cutout; never a product whose cutout was rejected). asset_id picks the product photo; the brand's first usable product when left out. run true also makes the set for the brand in a new group beside it (remake_group): only when the person asked to make the ads; its frames are remade_frames and get_job with wait true gives their design_ids, the ads to tailor.
Inputs: template_ids, collection_id, asset_id, run, name. Side effects: adds to or changes the connected workspace. Starts background work; its result comes back from get_job.
create_collection Create collection
Make a collection to save ads into.
Inputs: name (string, required). Side effects: adds to or changes the connected workspace.
create_component Create component
Make a layer of an ad a component, Figma's ⌥⌘K: the layer becomes the MAIN, and every instance placed with create_instance (in this ad or any other ad of the workspace) follows the main's edits while keeping its own words, colours and picture.
Inputs: design_id (string, required), node_id (string, required), name, rev. Side effects: adds to or changes the connected workspace.
create_frame Create frame
Start a canvas frame: an ad laid out as HTML and CSS (flexbox), the way a design tool lays out a frame.
Inputs: name, size, w, h, page. Side effects: adds to or changes the connected workspace.
create_instance Create instance
Place an instance of a component in an ad (Figma: drag a component from the Assets panel).
Inputs: component_id (string, required), design_id (string, required), parent_id, index, box, boxes, rev. Side effects: adds to or changes the connected workspace.
create_page Create page
Make a new, empty page of creatives, like a page in a design tool.
Inputs: name (string, required). Side effects: adds to or changes the connected workspace.
create_tokens Create tokens
Add design tokens to an ad, typed: tokens=[{name, value, type, description?}] with type color, spacing, radius, font_family, font_size, font_weight, line_height, letter_spacing, shadow, opacity or number.
Inputs: design_id (string, required), tokens (array, required), rev. Side effects: adds to or changes the connected workspace.
create_upload_link Create upload link
Get a link that puts images straight into this workspace, for a file attached in chat or on the person's computer (a chat attachment cannot be passed as an argument).
Inputs: kind. Side effects: adds to or changes the connected workspace.
duplicate_canvas Duplicate canvas
Copy a canvas into a new one named "{name} copy": the same frames and connections, the assets and the reference kept, the research without its ads, the brief without its rows, the outputs empty (its creatives stay on the original).
Inputs: canvas_id (string, required). Side effects: adds to or changes the connected workspace.
duplicate_items Duplicate items
Duplicate items beside themselves (⌘D): a frame's ad is copied into a new ad of its own (the same document, edit it freely), a group with copies of its frames and images, a note or an image as itself. dx, dy: where the copy goes relative to the original (default: just to its right).
Inputs: canvas_id (string, required), item_ids (array, required), dx, dy, copy_ids, rev. Side effects: adds to or changes the connected workspace.
duplicate_nodes Duplicate nodes
Copy nodes in place (each lands right after its original) with fresh ids; the answer maps old ids to new, children included, so you can set_text or update_styles on the copy at once.
Inputs: design_id (string, required), node_ids, into_design_id, parent_id, index, nodes, boxes, rev. Side effects: adds to or changes the connected workspace.
export_frame Export frame
Render the frame to a PNG at 2x through the same DOM the canvas shows, and set it as the creative's picture. format png (default), jpg (smaller, for Meta's upload limits) or webp; scale 1x, 2x (default) or 3x, or an exact size: "1080w" (1080 pixels wide) or "1350h" (1350 tall), the frame's shape kept. set_as_picture false keeps the creative's picture as it is and only makes the file.
Inputs: design_id (string, required), wait, scale, format, set_as_picture. Side effects: adds to or changes the connected workspace. Starts background work; its result comes back from get_job.
export_items Export items
The files of ads on the canvas: frames, or groups (every frame in them).
Inputs: canvas_id (string, required), item_ids (array, required), format, scale. Side effects: adds to or changes the connected workspace. Starts background work; its result comes back from get_job.
fit_text Fit text
Shrink texts to fit their boxes, like a design tool's auto size: each text whose words run past its box (more lines than its height shows, or a line wider than it) gets a smaller font, measured by the same render as the export, until the words fit or it reaches min_size.
Inputs: design_id (string, required), node_ids, min_size, rev. Side effects: adds to or changes the connected workspace.
flip_nodes Flip nodes
Flip layers: each mirrored about its own centre; a turned layer turns the other way (6 degrees reads -6), so it looks mirrored where it stands.
Inputs: design_id (string, required), node_ids (array, required), axis (string: horizontal, vertical, required), rev. Side effects: adds to or changes the connected workspace.
get_creative_direction Get creative direction
The creative direction for a batch of ads, for you to write the Brief and the copy yourself: what Klayson's own planner is told (the brand's real facts and products, the top performing ads in its category and from the competitors named, the concepts this brand can run with each role's budget, how many rows each concept takes, the seasonal angles) and the copy rules.
Inputs: n, query, competitors, product, focus, source_ad_ids, engine, asset_ids. Side effects: adds to or changes the connected workspace.
group_items Group items
Group frames and images (⌘G): a new group of these items, in this order, where the first of them was, titled title (else Group n).
Inputs: canvas_id (string, required), item_ids (array, required), title, layout, item_id, rev. Side effects: adds to or changes the connected workspace.
make_ad_size Make ad size
For any change the person asks to an ad Klayson made or showed in this conversation, even when they don't say Klayson.
Inputs: design_id (string, required), size (string: 4:5, 1:1, 9:16, feed, square, story, required), rev. Side effects: adds to or changes the connected workspace.
make_design Make design
Make an ad from words, in the brand: the HTML template from Klayson's library that fits the brief, filled with the brand's product, logo, colours, type and words, every layer editable (headline, body, button, product, logo), plus the primary text and headline to publish it with.
Inputs: prompt, photo_url, product, size, title, page. Side effects: adds to or changes the connected workspace.
make_frames Make frames
Make ads on the canvas for the brand: a new group of n frames (one loose frame when n is 1), every frame titled at once and filled in as each ad lands.
Inputs: canvas_id (string, required), prompt, n, group_title, product, asset_ids, size, plan_id, engine, from_item, group_id, template_ids, x, y, rev. Side effects: adds to or changes the connected workspace. Starts background work; its result comes back from get_job.
make_plan Make plan
Make the plan's ads: every row becomes a creative in the brand's colours and type, on the plan's page, three at a time.
Inputs: plan_id (string, required), rows. Side effects: adds to or changes the connected workspace. Starts background work; its result comes back from get_job.
make_sizes Make sizes
The other sizes of ads on the canvas, linked to their originals (make_ad_size: a layout ad is laid out again for the size with the edits carried, any other ad fitted; words changed on the original follow): for a group, a new group per size titled '{title} · 1:1' beside it; for frames, frames titled '{title} · 1:1' beside them. sizes from 4:5, 1:1, 9:16.
Inputs: canvas_id (string, required), item_ids (array, required), sizes (array, required), rev. Side effects: adds to or changes the connected workspace.
meta_publish_defaults Meta publish defaults
The publish settings Klayson would use for these ads, ready to show a person: ad account, objective (Sales when the account has a pixel, else Traffic), a modest daily budget, country, Advantage+ audience and placements, and each ad's link, primary text, headline and button.
Inputs: design_ids (array, required), ad_account_id, canvas_name. Side effects: adds to or changes the connected workspace. Only where Meta publishing is switched on for the workspace.
meta_publish_prepare Meta publish prepare
Prepare publishing ads to the connected Meta ad account, for the person to confirm.
Inputs: design_ids (array, required), go_live, ad_account_id, campaign, ad_set, ads, canvas_name. Side effects: adds to or changes the connected workspace. Only where Meta publishing is switched on for the workspace.
move_items Move items
Move items: each {item_id, x, y} (where it goes) or {item_id, dx, dy} (by how much).
Inputs: canvas_id (string, required), moves (array, required), rev. Side effects: adds to or changes the connected workspace.
move_nodes Move nodes
Reorder or reparent: put node_id inside parent_id at index (omit index for last), the way a layer is dragged in the Layers or inside an auto layout on the canvas.
Inputs: design_id (string, required), node_id, parent_id, index, node_ids, to, into_design_id, moves, rev. Side effects: adds to or changes the connected workspace.
move_to_page Move to page
Move creatives onto a page: pass the design ids and either a page_id from list_pages or a page_name (a new name makes the page; Miscellaneous is the page that is always there).
Inputs: design_ids (array, required), page_id, page_name. Side effects: adds to or changes the connected workspace.
paste_style Paste style
Paste properties onto layers: style is the payload copy_style returned (from this ad or another).
Inputs: design_id (string, required), node_ids (array, required), style (object, required), rev. Side effects: adds to or changes the connected workspace.
plan_creatives Plan creatives
The Brief before a batch: a table of N ads for this brand, every row different in angle, visual or hook, each with the ad it borrows from and what it tests.
Inputs: n, query, competitors, product, focus, page, source_ad_ids, engine, asset_ids, direction_id, rows, title, summary. Side effects: adds to or changes the connected workspace.
plan_verdict Plan verdict
Approve or skip one of a plan's creatives (yes or skip, with a word of why).
Inputs: plan_id (string, required), design_id (string, required), verdict (string: yes, skip, required), note. Side effects: adds to or changes the connected workspace.
read_brand_pieces Read brand pieces
Read the brand's own pieces now: its running ads from the Ad Library (by the pages the brand read found) and the Instagram posts of the handle its site links, tagged and kept.
Inputs: none. Side effects: adds to or changes the connected workspace.
redo Redo
Redo what undo stepped back, like ⇧⌘Z: the ad takes the document it had before the undo.
Inputs: design_id (string, required), steps, rev. Side effects: adds to or changes the connected workspace.
release_mask Release mask
Release a Mask group (Figma's Release mask): its layers go back to its frame where they are drawn and the mask shape is drawn again.
Inputs: design_id (string, required), node_id (string, required), boxes, rev. Side effects: adds to or changes the connected workspace.
remake_group Remake group
Remake a group of ads for this brand (a template, or any group of layout ads): a NEW group to the right of it, one frame per frame of it with the same titles and layout, each remade with the template engine for the brand: the template's layout, the person's edits on it, the brand's words and facts (never an invented number), the product photo cut out. asset_id is the photo (the person's upload in the chat), else product by name, else the brand's first product.
Inputs: canvas_id (string, required), group_id (string, required), asset_id, product, title, rev. Side effects: adds to or changes the connected workspace.
remember Remember
Keep or drop one of the brand's standing rules for every creative and answer from now on ('always use our green', 'never show prices', 'no lifestyle shots', 'our customers are nurses'). add a rule, or remove one by its words.
Inputs: add, remove. Side effects: adds to or changes the connected workspace.
remix_ad Remix ad
Make this ad's idea for the caller's own brand: the HTML template from Klayson's library that matches the ad's angle and format, with the caller's product, logo, colours and type, none of the other brand's logos or marks, and every line of copy written in the brand's voice from the brand document; every layer is editable.
Inputs: ad_id (string, required), instruction, product, photo_url, size, search_id, page. Side effects: adds to or changes the connected workspace.
remix_picture Remix picture
Remake an ad the person uploaded (a screenshot or saved image of another brand's ad) for their brand: Klayson reads the uploaded ad and makes an HTML template ad with the same idea, their product, words, colours and type, every layer editable.
Inputs: asset_id (string, required), instruction, product, photo_url, size, page. Side effects: adds to or changes the connected workspace.
rename_canvas Rename canvas
Rename a canvas.
Inputs: canvas_id (string, required), name (string, required). Side effects: adds to or changes the connected workspace.
rename_collection Rename collection
Rename a collection of saved ads.
Inputs: collection_id (string, required), name (string, required). Side effects: adds to or changes the connected workspace.
rename_creative Rename creative
Give a creative a name: the label on its frame on the canvas ('Etsy flat lay, blue button').
Inputs: design_id (string, required), name (string, required). Side effects: adds to or changes the connected workspace.
rename_item Rename item
Rename an item: a frame's title is its ad's name too; a group's title is drawn above it; an image's title is its name on the canvas.
Inputs: canvas_id (string, required), item_id (string, required), title (string, required), rev. Side effects: adds to or changes the connected workspace.
rename_nodes Rename nodes
Name nodes so the layers panel and later calls read well: [{node_id, name}].
Inputs: design_id (string, required), updates (array, required), rev. Side effects: adds to or changes the connected workspace.
rename_page Rename page
Rename a page of creatives.
Inputs: page_id (string, required), name (string, required). Side effects: adds to or changes the connected workspace.
resize_frame Resize frame
Change the frame's size (200 to 4000 px a side): feed 1080x1350, square 1080x1080, story 1080x1920, or any w and h.
Inputs: design_id (string, required), size, w, h, rev. Side effects: adds to or changes the connected workspace.
resize_items Resize items
Resize items: each {item_id, w, h}.
Inputs: canvas_id (string, required), sizes (array, required), rev. Side effects: adds to or changes the connected workspace.
resolve_comment Resolve comment
Resolve a comment thread (Figma's ✓), or reopen it with resolved=false.
Inputs: thread_id (string, required), resolved. Side effects: adds to or changes the connected workspace.
restore_items Restore items
Put items back exactly as they were, the undo and redo of a board edit: every item in items is written as given (its id, box, group, title and words; a frame's ad must be one of this workspace's), every id in remove is taken off the canvas, and order (item ids, back to front) puts them in that order.
Inputs: canvas_id (string, required), items, remove, order, template, rev. Side effects: adds to or changes the connected workspace.
rewrite_copy Rewrite copy
Change the words that run with an ad on Meta (its primary text, headline, description and button) without making a new picture.
Inputs: design_id (string, required), headline, primary_text, description, cta, instruction. Side effects: adds to or changes the connected workspace.
save_creator Save creator
Save a creator to a list (a new list by name, or an existing list_id).
Inputs: creator_id (string, required), list_id, list_name, note. Side effects: adds to or changes the connected workspace.
save_frame Save frame
Replace the whole document (the canvas page's autosave).
Inputs: design_id (string, required), doc (object, required), name, rev. Side effects: adds to or changes the connected workspace.
save_version Save version
Save the ad as it is now as a named version (Figma's Save to version history), so it can be found and restored later by name.
Inputs: design_id (string, required), name (string, required). Side effects: adds to or changes the connected workspace.
screenshot_frame Screenshot frame
A quick picture of the frame as it is now (a JPEG at most 1024 px on its long side, about a thousand tokens), for looking at your own work after a whole section, with the lint's issues in words (the same lint as check_layout: errors first, then warnings). check_layout alone is cheaper when you only need the findings.
Inputs: design_id (string, required), node_id, scale, if_changed_since. Side effects: adds to or changes the connected workspace.
set_ad_preview Set ad preview
How ads are shown on the canvas: as the creative alone, or as the Facebook or Instagram post they run as, with their primary text, headline, description and button around the picture.
Inputs: canvas_id (string, required), item_ids (array, required), preview (string: creative, facebook, instagram, required), rev. Side effects: adds to or changes the connected workspace.
set_auto_layout Set auto layout
Turn an ad's auto layout off or on. auto=false freezes every component (headline, sub, CTA, photos, labels, logo, badges) where it is drawn now: each becomes a child of the frame with position absolute and its left, top, width and height in % of the frame (normalized 0 to 1), so update_styles moves and resizes each one on its own; the layout's rows and columns and the fit pass stop applying. auto=true puts the layout back, with the words and styles changed since and without the manual positions.
Inputs: design_id (string, required), auto (boolean, required), boxes, rev. Side effects: adds to or changes the connected workspace.
set_blend_mode Set blend mode
Set layers' blend mode: pass_through (a frame's default), normal, darken, multiply, color_burn, lighten, screen, color_dodge, plus_lighter, overlay, soft_light, hard_light, difference, exclusion, hue, saturation, color, luminosity. opacity (0 to 100) beside it, optional.
Inputs: design_id (string, required), node_ids (array, required), mode (string, required), opacity, rev. Side effects: adds to or changes the connected workspace.
set_corner_radius Set corner radius
Round a layer's corners: radius (px, all four) or radii [top left, top right, bottom right, bottom left] for independent corners (Figma's toggle).
Inputs: design_id (string, required), node_ids (array, required), radius, radii, rev. Side effects: adds to or changes the connected workspace.
set_effects Set effects
Set a layer's effects, the whole list at once (send [] to remove them all): each {type: drop_shadow | inner_shadow | layer_blur | background_blur, x, y, blur, spread, color, visible?}.
Inputs: design_id (string, required), node_ids (array, required), effects (array, required), rev. Side effects: adds to or changes the connected workspace.
set_fill Set fill
Fill layers: solid, linear gradient or radial gradient, or none. fill = {type: "solid", color} | {type: "linear", angle (degrees, 180 runs top to bottom, 90 left to right), stops: [{color, position 0 to 100}, …]} | {type: "radial", center: [x%, y%], radius: [x%, y%] (50, 50 reaches the edges), stops} | null (no fill).
Inputs: design_id (string, required), node_ids (array, required), fill (object or string or null, required), rev. Side effects: adds to or changes the connected workspace.
set_fills Set fills
Paint layers with several fills: fills is a list, the TOP fill first, each {type: solid, color} | {type: linear, angle, stops} | {type: radial, center: [x%, y%], radius: [x%, y%], stops} | {type: angular, angle (where it starts), center, stops} (a conic sweep round the centre) | {type: diamond, stops} (from the middle out to the edges' midpoints); visible false keeps one without drawing it.
Inputs: design_id (string, required), node_ids (array, required), fills (array, required), rev. Side effects: adds to or changes the connected workspace.
set_group_layout Set group layout
How a group's frames and images sit: mode grid (columns a row, 1 to 12), row (one row, top aligned) or column (one column, left aligned), each keeping its own size; gap between them in px; title renames it.
Inputs: canvas_id (string, required), group_id (string, required), mode, columns, gap, title, rev. Side effects: adds to or changes the connected workspace.
set_icon Set icon
Swap an icon on an ad for another, like an instance swap in Figma: the icon rows', icon grid's, CTA arrow's, seal's and this-vs-that's icons are svg layers drawn from lucide (get_node_info says icon: {name, color, stroke}).
Inputs: design_id (string, required), node_id (string, required), icon (string, required), color, rev. Side effects: adds to or changes the connected workspace.
set_image Set image
Replace a picture on an ad: the product cutout, a photo, the logo, a picture ground or plate, or any frame filled with a picture.
Inputs: design_id (string, required), node_id (string, required), asset_id, url, rev. Side effects: adds to or changes the connected workspace.
set_image_adjustments Set image adjustments
Adjust a picture: adjustments = {exposure, contrast, saturation, temperature, tint, highlights, shadows}, each -100 to 100 (0 is the photo as it is).
Inputs: design_id (string, required), node_ids (array, required), adjustments, reset, rev. Side effects: adds to or changes the connected workspace.
set_intent Set intent
Remember which Klayson template the person came for (the template page they landed on), so it is offered first: get_me then answers pending_template until the template is copied onto the workspace with use_workflow. app is the AI app they picked (claude, chatgpt, claude-code, codex, cursor, gemini-cli, or web). at is when they landed; an intent already kept is replaced only by a newer one.
Inputs: template (string, required), app, at. Side effects: adds to or changes the connected workspace.
set_layer_state Set layer state
Hide or show, lock or unlock layers, like the Layers' eye and padlock: updates=[{node_id, hidden?, locked?}].
Inputs: design_id (string, required), updates (array, required), rev. Side effects: adds to or changes the connected workspace.
set_layout_grid Set layout grid
Set an ad's layout grids, Figma's layout grids: columns, rows or a square grid, each {type: columns | rows | grid, count, gutter, margin, align: stretch | start | center | end, size (a column's width when align is not stretch; a grid's cell), color (hex with alpha), visible}, in the frame's pixels. grids="default" puts the engine's grid on (12 columns, 24 gutters, a 72 margin at 1080 wide: the grid every layout ad is composed on); [] takes them off.
Inputs: design_id (string, required), grids (array or string, required), rev. Side effects: adds to or changes the connected workspace.
set_mask Set mask
Mask a layer (a photo, a group) without another layer: mask = {shape: ellipse | circle | rectangle | polygon | star, inset (px), radius (px, a rectangle's corners), points, ratio} clips it to that shape in its own box; {gradient: {type: linear | radial, angle, stops}} fades it (opaque stops show, transparent hide: a photo melting into the ground); {image: a Klayson picture's url, fit: contain | cover | stretch} shows it through the picture's outline (a cutout). null removes the mask.
Inputs: design_id (string, required), node_ids (array, required), mask, rev. Side effects: adds to or changes the connected workspace.
set_path Set path
Draw a vector path on an ad, or change one: d is SVG path data (M, L, H, V, C, S, Q, T, A, Z; absolute or relative), in the frame's pixels by default (coords="frame": M 100 900 is 100 px from the left and 900 from the top of a 1080 x 1350 ad), or in the layer's own box (coords="box").
Inputs: design_id (string, required), d, node_id, coords, closed, fill, stroke, weight, cap, join, name, parent_id, rev. Side effects: adds to or changes the connected workspace.
set_product_cutout Set product cutout
Make a product's cutout, the transparent PNG its flat ads use (about 10 seconds, about 2 cents of model time, cached per photo).
Inputs: product, asset_id, source_url. Side effects: adds to or changes the connected workspace.
set_product_photo Set product photo
Give one of the brand's products its photo: the asset id of a picture the person uploaded (in the chat, it is the attachment's id), or url, one of the photos read from that product's own page (its photos, as get_brand lists them).
Inputs: product (string, required), asset_id, url. Side effects: adds to or changes the connected workspace.
set_selection Set selection
Select nodes on the person's canvas (the editor follows): design_id and node_ids.
Inputs: design_id (string, required), node_ids. Side effects: adds to or changes the connected workspace.
set_shader Set shader
Change a shader on an ad: its colours, any slider, its frame (shuffle: true picks another still), or switch it to another shader (name).
Inputs: design_id (string, required), node_id, name, params, frame, shuffle, parent_id, box, png_base64, recipe, if_recipe, rev. Side effects: adds to or changes the connected workspace.
set_shape Set shape
Change a polygon, star, line or arrow drawn with add_shape (Figma's shape properties): points (3 to 60), ratio (a star's inner radius, 0.05 to 1; 0.38 is the classic star, 0.8 a burst), corner (px, rounds every point), fill, stroke and weight (px), and a line's start and end (none, arrow, triangle, circle).
Inputs: design_id (string, required), node_id (string, required), points, ratio, corner, fill, stroke, weight, start, end, w, h, rev. Side effects: adds to or changes the connected workspace.
set_stroke Set stroke
Stroke layers: stroke = {weight (px), color, style: solid | dashed | dotted, dash?, gap?} or null for none.
Inputs: design_id (string, required), node_ids (array, required), stroke (object or null, required), rev. Side effects: adds to or changes the connected workspace.
set_text Set text
For any change the person asks to an ad Klayson made or showed in this conversation, even when they don't say Klayson.
Inputs: design_id (string, required), updates (array, required), rev. Side effects: adds to or changes the connected workspace.
set_text_format Set text format
Format whole text layers.
Inputs: design_id (string, required), node_ids (array, required), decoration, outline, shadow, list, indent, paragraph_spacing, rev. Side effects: adds to or changes the connected workspace.
set_text_style Set text style
Create, change or rename a text style of an ad (Figma's Create style and Edit style).
Inputs: design_id (string, required), style_id, name, styles, from_node_id, rev. Side effects: adds to or changes the connected workspace.
set_text_wrap Set text wrap
How a text breaks its lines: wrap = "balance" (lines of even length: the right choice for a headline of two to four lines, no lonely last word), "pretty" (no orphan on the last line of a paragraph: body copy) or "auto" (the browser's greedy wrap).
Inputs: design_id (string, required), node_ids (array, required), wrap (string: auto, balance, pretty, required), rev. Side effects: adds to or changes the connected workspace.
set_tokens Set tokens
Change the frame's tokens: {"--color-primary": "#0033FF", "--font-display": "Inter"}.
Inputs: design_id, design_ids, canvas_id, tokens (object or array, required), rev. Side effects: adds to or changes the connected workspace.
start_first_ads Start first ads
Make the workspace's first 3 ads on a new canvas named after the product (or the brand): three aesthetic shots that look nothing alike (with a product: the product in a spotlight, a close-up on a shader, and its reviews on a sky or notebook notes on what is in it; with none, led by the brand's words: its offer or why people come, a line from its site, its name on a shader).
Inputs: asset_id. Side effects: adds to or changes the connected workspace. Starts background work; its result comes back from get_job.
style_text_range Style text range
Style some words of a text layer, like selecting them in Figma and pressing B, I, U, S, a colour or superscript, or changing the font, size or letter spacing of the selection in the right panel: the rest of the text keeps its look.
Inputs: design_id (string, required), node_id (string, required), match, occurrence, from, to, marks (object, required), rev. Side effects: adds to or changes the connected workspace.
undo Undo
Undo the last edit to an ad, like ⌘Z: one step is one save (every tool call that changed the ad is one, a batch_edit is one, a person's edit on the canvas is one), whoever made it. steps undoes several at once.
Inputs: design_id (string, required), steps, rev. Side effects: adds to or changes the connected workspace.
ungroup Ungroup
Ungroup (⇧⌘G): the group's frames and images stay where they are drawn, loose on the canvas; the group goes.
Inputs: canvas_id (string, required), group_id (string, required), rev. Side effects: adds to or changes the connected workspace.
unwrap_node Unwrap node
Take a frame's layers out of it and remove the frame: its children go into its parent where it was.
Inputs: design_id (string, required), node_id (string, required), boxes, rev. Side effects: adds to or changes the connected workspace.
update_board_shape Update board shape
Change a shape on the canvas (add_board_shape's): its fill, stroke, stroke_width, corner radius, sides, a star's ratio, rotation, an icon's name, a path's points (path with view, and x, y, w, h when the box moved with them). null or none takes a fill or stroke off.
Inputs: canvas_id (string, required), item_id (string, required), shape, x, y, w, h, fill, stroke, stroke_width, radius, sides, ratio, path, view, closed, icon, rotation, title, rev. Side effects: adds to or changes the connected workspace.
update_plan Update plan
Edit a plan's rows (the Brief on the canvas): pass the whole rows list in order.
Inputs: plan_id (string, required), rows, roles. Side effects: adds to or changes the connected workspace.
update_styles Update styles
For any change the person asks to an ad Klayson made or showed in this conversation, even when they don't say Klayson.
Inputs: design_id (string, required), updates (array, required), boxes, rev. Side effects: adds to or changes the connected workspace.
update_text Update text
Change a canvas note: its words, its width, its style (size, color, weight, align).
Inputs: canvas_id (string, required), item_id (string, required), text, w, style, rev. Side effects: adds to or changes the connected workspace.
upload_asset Upload asset
Upload one of the USER'S OWN images: the product that must appear in generated ads exactly as photographed (kind=product), a screenshot of their app or website for a software, app or service brand (kind=screen: shown in the product's place), their logo (kind=logo), or other brand imagery (kind=upload).
Inputs: kind (string: logo, product, upload, screen, file, required), filename, data_base64, url, cut, files. Side effects: adds to or changes the connected workspace.
use_as_mask Use as mask
Figma's Use as mask (⌃⌘M): the lowest of node_ids is the mask and the others are shown only inside its shape; with one node, every layer above it in its frame is masked.
Inputs: design_id (string, required), node_ids (array, required), boxes, rev. Side effects: adds to or changes the connected workspace.
use_workflow Use workflow
Copy a template (a set of ads: a token from list_workflow_templates, get_template or a /w/{token} link) onto this workspace as a new canvas: its ads as editable frames in a group. asset_id is the person's product photo; with it and run true the set is made for this brand at once, in a new group beside it (remake_group on the group does the same later).
Inputs: token (string, required), asset_id, run. Side effects: adds to or changes the connected workspace.
wrap_nodes Wrap nodes
Put layers in a new frame. layout "flex" makes the frame an auto layout: inside an auto layout it takes its parent's direction, gap and alignment so nothing moves (then give the group its own gap or padding with update_styles); around components that sit on their own (an ad with auto layout off, absolute layers) it sits at their bounding box as a row or a column. layout "frame" keeps every layer exactly where it is drawn, pinned in % inside the new frame.
Inputs: design_id (string, required), node_ids (array, required), layout, name, boxes, rev. Side effects: adds to or changes the connected workspace.
write_html Write html
Add to a frame by writing HTML with inline styles, the way you would write to a design canvas: flexbox (display, flex-direction, gap, padding, align-items, justify-content), real text in elements, <img> for pictures from the workspace's assets (upload_asset, the product's cutout), inline <svg> for shapes. layer-name="…" names a layer.
Inputs: design_id (string, required), html (string, required), target_node_id, mode, rev. Side effects: adds to or changes the connected workspace.
Sensitive writes (28)
scrape_brand Scrape brand
Scrape a website to (re)build the brand kit: colors, logo, about, voice. Replaces the scraped fields, keeps manual assets.
Inputs: url (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first. Starts background work; its result comes back from get_job.
delete_ad_thread Delete ad thread
Delete one conversation over the ads data.
Inputs: thread_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_asset Delete asset
Remove one asset from the workspace: the file and the row.
Inputs: asset_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_canvas Delete canvas
Delete a canvas: its frames go, its creatives move to Miscellaneous (no creative is ever deleted by this).
Inputs: canvas_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_collection Delete collection
Delete a collection.
Inputs: collection_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_items Delete items
Take items off the canvas: a group goes with its frames and images (keep_frames true leaves them loose, as ungroup does).
Inputs: canvas_id (string, required), item_ids (array, required), keep_frames, rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_nodes Delete nodes
Remove nodes from a frame (never the root, never the creative itself).
Inputs: design_id (string, required), node_ids (array, required), rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_page Delete page
Delete a page.
Inputs: page_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
delete_text_style Delete text style
Delete a text style of an ad (Figma's Delete style): the text layers that used it keep their look, unlinked.
Inputs: design_id (string, required), style_id (string, required), rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
detach_instance Detach instance
Detach an instance, Figma's ⌥⌘B: its layers stay exactly as they are but no longer follow the component's main.
Inputs: design_id (string, required), node_id (string, required), rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
meta_publish_confirm Meta publish confirm
Confirm a prepared publish with its confirmation token.
Inputs: token (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first. Only where Meta publishing is switched on for the workspace.
read_products Read products
Read the brand's whole product catalogue again from its website: every product with its name, price, link and picture, merged into the catalogue.
Inputs: none. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first. Starts background work; its result comes back from get_job.
remove_brand_piece Remove brand piece
Take a picture out of the brand's own pieces (it no longer shapes the designs).
Inputs: asset_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
replace_colors Replace colors
Change one colour everywhere it is used in the given layers (the whole ad without node_ids): replacements = [{from, to}]. from is a row's value from get_selection_colors (a token as var(--color-primary), or a colour, matched as a colour so #F54E00 also finds rgb(245, 78, 0)); to is a colour or a token.
Inputs: design_id, node_ids, design_ids, canvas_id, replacements (array, required), rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
replace_text Replace text
For any change the person asks to an ad Klayson made or showed in this conversation, even when they don't say Klayson.
Inputs: design_id, design_ids, canvas_id, node_ids, replacements (array, required), match_case, rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
reset_instance Reset instance
Reset an instance's overrides (Figma's Reset all changes): its words, colours and picture go back to the main's; its place on the ad stays.
Inputs: design_id (string, required), node_id (string, required), rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
restore_version Restore version
Put an ad back to a version from list_versions: the ad takes that version's document (its words, layers, colours, everything), and the ad as it was a moment ago stays in the history, so a restore can itself be undone by restoring the entry above it (on the canvas it is one ⌘Z).
Inputs: design_id (string, required), version_id (string, required), rev. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
save_brand_facts Save brand facts
Save the brand's numbers and claims as the person gives them (word for word theirs or the site's; never write one for them), only when they ask to change them.
Inputs: facts, skip, words_to_avoid, allowed_claims, from_person. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
save_brand_style Save brand style
Save the brand's style: the fields given go onto the workspace's design system, which every designed ad, the Template canvases, the Brand frame and the picture engine read. confirm=true (the default) records that the person confirmed it, with who and when; only after the person said it looks right.
Inputs: style, confirm. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
select_products Select products
Say which of the brand's products the person sells and wants ads for, and which one the ads lead with. selling: the products' names to keep (at least one).
Inputs: selling (array, required), main. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
slack_disconnect Slack disconnect
Remove Klayson from this workspace's Slack.
Inputs: none. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
stop_making Stop making
Stop a make on the canvas: the ads made stay.
Inputs: canvas_id (string, required), job_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
unbookmark_ad Unbookmark ad
Remove a saved ad from the bookmarks (and from any collection).
Inputs: ad_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
unbookmark_template Unbookmark template
Remove a saved template (a library ad template, or a workflow template as workflow:{token}) from the bookmarks (and from any collection).
Inputs: template_id (string, required). Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
unsave_creator Unsave creator
Remove a creator from every list of the workspace, or from one list_id.
Inputs: creator_id (string, required), list_id. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
update_brand Update brand
Edit brand fields directly (url, name, description, audience, voice, colors, style_descriptor).
Inputs: url, name, description, audience, voice, colors, font_link, product_kind, products, proof_points, document, logo_asset_id, style_descriptor. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.
update_settings Update settings
Change workspace settings. brand_adherence (default true) makes every design carry the brand's colors, name and voice; false designs brand-blind. use_proven_ads toggles whether generation analyzes proven ads from your space first. style_mode sets how a style reference is applied: 'literal' reproduces it as closely as possible, 'inspiration' borrows it loosely.
Inputs: brand_adherence, use_proven_ads, style_mode, meta_spend, ads_running. Side effects: deletes, overwrites, turns off or sends something; it may not be undoable. Ask the person first.