Skip to main content
Glama

export_canvas

Export the full canvas to a specified directory as a ZIP project tree or a single self-contained HTML file for offline viewing.

Instructions

把整张画布导出成一个文件,写到 outDir 下(文件名自动取项目名)。format="zip"(默认)导出目录树(index.html + lib/ + pages/.../preview.html,标注定位/高亮在纯 file:// 下会静默失效,其它都正常);format="html" 导出单个自包含 .html(所有画板、库都内联,双击即看,无跨源限制,但画板越多文件越大)。渲染逻辑跟实时预览(render_canvas)完全一样——只是渲一次落盘/拼字符串,不是另一套。跟画布页面右上角「导出」按钮菜单走的是同一份逻辑,区别是按钮触发浏览器下载、这个工具直接写到你指定的目录

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirNo覆盖默认工作目录(项目所在父目录);相对路径按当前工作目录解析;缺省用 PROTOFLOW_HOME 或启动时的 cwd
formatNo导出格式,默认 zip(目录树);html 是单文件
outDirYes文件要写到的目录(绝对路径,或相对 dir 参数解析);目录不存在会自动创建
projectIdYes项目 id(同时也是项目文件夹名)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses where files are written, that annotation positioning/highlighting silently fails under file://, and that html inlines all artboards and libraries. However, it does not mention overwrite behavior or what the tool returns/confirms after writing, which would be useful for a file-export operation.

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 purpose is front-loaded and nearly every clause contributes decision-relevant information. The text is dense and slightly run-on, mixing format tradeoffs and behavioral caveats in one paragraph, but it avoids fluff and is much more useful than a short generic sentence.

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?

For a two-format file-export tool with no output schema, the description covers the essential choices, output structure, known failure mode, and similarity to render_canvas. The main gaps are overwrite semantics and any success/failure return value, which an agent might need to confirm the operation's result.

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 100%, so the baseline is 3, but the description adds real meaning beyond the schema: it explains the zip vs html format consequences in depth, the file:// caveat, and the automatic project-name-based file naming. It adds little for projectId or dir, but those are already well-described in the schema.

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 opens with a concrete action and resource: '把整张画布导出成一个文件,写到 outDir 下', then enumerates the two formats. It also differentiates from render_canvas by stating the same rendering logic is reused but persisted once, so export and preview cannot be confused.

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?

The description gives explicit format-selection guidance: zip is the default directory-tree export, while html is the self-contained, double-clickable option with tradeoffs explained. It contrasts with render_canvas and the browser export button, but it does not crisply state when to use export_doc or other siblings instead.

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