Skip to main content
Glama

save_artboard_source

Save artboard JSX source after Babel validation, applying full code or unique-matched edits, and return sourceHash plus broken annotation audit.

Instructions

写画板 JSX 源码。source(全量)与 edits(补丁 [{oldText,newText}],oldText 须唯一匹配)二选一。Babel 编译校验失败不落盘。成功返回 sourceHash 与 idAudit(消失的元素 id 及 annotations.md 里对它们的断链引用)。画板 preview 和整站画布都是 source.jsx 的实时投影:刷新已打开的画布标签即最新,无需重新调用 render_preview / render_canvas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirNo覆盖默认工作目录(项目所在父目录);相对路径按当前工作目录解析;缺省用 PROTOFLOW_HOME 或启动时的 cwd
editsNo
sourceNo
projectIdYes项目 id(同时也是项目文件夹名)
artboardIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the behavioral burden and covers it thoroughly: Babel validation failures do not persist, successful calls return sourceHash and idAudit, and saved source is a live projection visible after refreshing tabs. It also discloses the uniqueness requirement for oldText, which is an important failure mode.

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?

Four short, dense sentences each carry a distinct fact: mode choice, validation/no-persist, return payload, and live-render implication. No filler or repetition; the core action is front-loaded.

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

Completeness5/5

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

Given no output schema and no annotations, the description covers outputs, failure behavior, mode semantics, and downstream rendering effects. This is sufficient for an agent to invoke save_artboard_source with the required parameters and understand the consequences.

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

Parameters4/5

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

Schema coverage is low (40%), and the description compensates for the two complex parameters: source is full content, edits are patches with unique-match oldText, and the two modes are mutually exclusive. It does not add artboardId semantics, but the tool name and parent context make that parameter self-evident.

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?

Description opens with a specific verb and resource ('写画板 JSX 源码' / write artboard JSX source) and distinguishes the tool from rendering siblings by stating that refreshed canvas tabs already reflect the latest source and render_preview / render_canvas need not be called again.

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 gives concrete mode-selection guidance ('source 全量 与 edits 补丁 二选一') and an explicit when-not (no need to call render_preview / render_canvas). It does not mention selection against other write siblings like upsert_artboard, but the mode and persistence semantics make the intended usage clear.

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