Skip to main content
Glama
shotluma-design-mcp

shotluma-design-mcp

by Aana11

Apply design operations

apply_operations

Apply a batch of validated design operations atomically: all edits save only if every schema, reference, and content check passes; any error leaves the project unchanged.

Instructions

Apply a batch of structured operations atomically: everything is validated (schema, references, content protection) before anything is saved; on any error nothing changes. No scripts or code are executed.

apply_operations reference

All coordinates are canvas pixels. Omitted ids are generated. Patches deep-merge (objects merge, arrays replace, null deletes).

Pages: add_page {page:{id?,name?,width,height,background?},index?} · duplicate_page {pageId,newPageId?,name?} · update_page {pageId,name?,width?,height?,background?} · remove_page {pageId} · move_page {pageId,index} · set_background {pageId,background} Layers: add_layer {pageId,layer,parentId?,index?} · update_layer {pageId,layerId,patch} · remove_layer {pageId,layerId} · reorder_layer {pageId,layerId,position:"front"|"back"|"forward"|"backward"|index} · group_layers {pageId,layerIds,groupId?,name?} · ungroup {pageId,groupId} Assets/brand: replace_asset {fromAssetId,toAssetId,pageIds?} · set_asset_protection {assetId,enabled?,grant?:{effect,authorization},revoke?,authorization?} · set_brand {brand|null} · rename_project {name}

Background: {type:"solid",color} | {type:"gradient",gradient:{type:"linear",angle,stops:[{color,at}]}|{type:"radial",cx,cy,stops}} | {type:"image",assetId,fit:"cover"|"contain",position:{x,y},overlay?,overlayOpacity?} | {type:"none"} (transparent). Any of them may add pattern:{kind:"dots"|"grid"|"diagonal"|"waves",color,size}.

Common layer fields: id?, name?, x, y, width, rotation=0, opacity=1, visible=true, shadow?:{x,y,blur,spread,color}.

  • device: {type:"device",frame:"none"|"thin"|"phone"|"tablet"|"laptop"|"browser"|"window",assetId?,frameOptions?:{color,bezel?,cornerRadius?,screenRadius?,screenCorners:"auto"|"inset"|"clip",buttons,depth(0..1, 3D edge),chromeColor?,addressText?,screenColor?},perspective?} — default "inset" corners: rounded display, screenshot fully inside (no pixel cut), band filled with the screenshot's own edge colors; "clip" rounds the screenshot itself and needs the cornerRadius grant for more than 3% — height is derived from width and the screenshot aspect; patch only "height" to resize by height.

  • image: {type:"image",assetId,height?,fit:"contain"|"cover"|"fill",crop?,cornerRadius,border?,perspective?} — height defaults to the asset aspect.

  • text: {type:"text",text,height?,style:{fontFamily,fontSize,fontWeight,italic,color,align,verticalAlign,lineHeight,letterSpacing,textTransform,underline,stroke?,textShadow?},highlights?:[{text,color?,backgroundColor?,bold?,italic?,underline?,fontFamily?,paddingX?,paddingY?,cornerRadius?,opacity?}],box?:{fill?,padding,cornerRadius,border?}}

  • shape: {type:"shape",shape:"rect"|"ellipse"|"pill"|"triangle"|"diamond"|"star"|"burst"|"spark"|"blob"|"arch"|"ring"|"line"|"arrow"|"wave",height,fill (color or gradient),stroke?:{width,color},cornerRadius}

  • group: {type:"group",x,y,width,height,children:[…]} — child coordinates are relative to the group. Colors: #rgb, #rrggbb, #rrggbbaa, rgb(), rgba(), transparent.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project": "<project>",
      "operations": "<operations>"
    },
    "name": "apply_operations"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectYesProject id returned by create_project/open_project in this session, or the project directory path.
operationsYesOrdered operations; see the tool description for every op and layer field.
expectedRevisionNoFail if the project revision differs (optimistic locking).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and discloses key traits: atomic validation, no partial saves on error, no code execution, generated ids, and patch merge semantics. It still omits some potentially relevant behaviors such as authentication requirements, idempotency, or what a successful apply returns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but appropriately structured for a complex batch-operation tool: it front-loads atomic behavior, then provides a dense reference organized by pages, layers, assets, background, and layer types. Most content earns its place, though the reference is still a wall of text that could benefit from tighter grouping.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity and the generic operations schema, the description is largely complete enough for an agent to construct valid operations. It covers operation variants, layer fields, defaults, and atomic error behavior, but does not describe return values or explicitly route between this tool and sibling validation/inspection tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the schema's operations array is generic and does not define the operation variants or layer fields. The description adds substantial meaning by cataloging each operation, layer type, coordinate system, defaults, color formats, and merge/patch behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: applying a batch of structured operations atomically to a design project. It clearly distinguishes the tool as a mutation operation with validation-before-save semantics. However, it does not explicitly contrast itself with sibling tools such as validate_design or inspect_design.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool by explaining atomic application and validation behavior, and it notes that no scripts or code are executed. It does not explicitly say when to use this tool versus validate_design, inspect_design, or other siblings, nor does it state prerequisites beyond what the schema provides.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.