Skip to main content
Glama

design_patch

Apply design patches to modify the canvas: insert, replace, remove, update, move, or tokenize nodes. Locked nodes reject patches, so resolve conflicts instead of retrying.

Instructions

Apply design patches (insert / replace / remove / update / move / token). This is the only way to modify the canvas. Nodes locked by the user reject your operations; if a patch is rejected, explain the conflict instead of retrying blindly.

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": {
      "ops": "<ops>"
    },
    "name": "design_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYesPatch ops, e.g. {"op":"insert","parentId":"root","node":{"id":"hero","type":"box","children":[]}}, {"op":"update","targetId":"t1","patch":{"text":"新标题"}}, {"op":"update","targetId":"t1","patch":{"style":{}},"unset":["x","y"]} (return to flow layout), {"op":"token","name":"color","key":"brand.primary","value":"#2f6fed"}, {"op":"token","name":"color","key":"obsolete","value":"","unset":true} (delete token)
projectIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose one important behavior: user-locked nodes reject operations, and rejected patches should be surfaced rather than retried. It omits other material traits — atomicity of the ops array, whether changes are persisted immediately or need design_commit, permission requirements, and what a rejection response looks like.

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

Conciseness5/5

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

Two sentences, zero filler, with the mutation scope front-loaded before the failure-handling note. Every clause carries operational information.

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

Completeness3/5

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

For a no-annotation mutation tool with no output schema, the definition covers the main hazard (locked nodes / rejected patches) but leaves the agent guessing about return values, whether partial application is possible, and how this relates to design_commit. Adequate but not complete for a write path.

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

Parameters3/5

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

Schema coverage is 50%: 'ops' is documented in-schema with concrete examples, while 'projectId' has no description anywhere. The description contributes the full op vocabulary (including replace/remove/move, which the schema examples do not show) but says nothing about projectId or op ordering, so it only partially compensates for the coverage gap.

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

Purpose5/5

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

The description gives a specific verb plus resource ('Apply design patches') and enumerates the operation set (insert / replace / remove / update / move / token). 'This is the only way to modify the canvas' cleanly separates it from read/export/commit siblings without needing to name them.

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

Usage Guidelines4/5

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

It states the core usage condition clearly: this is the sole path for canvas mutation, so the agent knows when to reach for it. It also gives failure guidance ('explain the conflict instead of retrying blindly'). It stops short of naming a concrete alternative or exclusion, so it is strong but not exhaustive.

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