Skip to main content
Glama

create_document_from_html

Convert HTML/CSS pages into editable DingCard canvas documents, turning text, images, shapes, and SVG into movable nodes with CSS-based layout, styling, and layer order.

Instructions

把你写的 HTML/CSS 网页转成在叮卡里能逐个修改的自由画布文档(v44)。适合模板排不出来的版式:直接用网页写法排版,叮卡在浏览器里排好后,把每个色块、文字、图片和 SVG 图形读成形状、文字框、图片和图形节点,位置、字号、颜色、圆角、阴影、渐变等全部照网页来,层叠顺序按 CSS(含 z-index)。返回 documentId、每页 id 和尺寸、notes(哪里没转过来),默认附缩略图。之后 check_document 检查、apply_actions 修改、render_document 出图、open_in_editor 交给人。HTML 怎么写(section 分页、内置字体、图片、svg、表格、data-name)见 get_guide("html-import")。

Input Schema

NameRequiredDescriptionDefault
htmlNo网页源码(可以只写 <style> 和若干 <section>)
widthNo没写尺寸的页面的宽度,也是 100vw,默认 1080
heightNo没写尺寸的页面的高度,也是 100vh,默认 1440
htmlPathNo网页文件路径,可替代 html;里面的相对路径按这个文件所在的目录找
previewsNo是否附上缩略图,默认 true
includeDocumentNo同时返回完整文档 JSON(默认只返回 documentId 和 version)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 explains what properties are preserved (position, font size, color, radius, shadow, gradient, stacking order) and flags the 'notes' field reporting what failed to convert — valuable behavioral context. It still doesn't state permissions or size/rate limits, keeping it below a 5.

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?

Front-loads the core purpose, then conversion mechanics, then return values and workflow. Dense but every sentence conveys a distinct fact; slightly long but no clear filler to cut.

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?

Even without an output schema, it describes the return payload (documentId, per-page ids and sizes, notes, optional thumbnail) and the follow-up tool chain, plus a guide reference for HTML authoring. An agent has everything needed to call and act on the result.

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 description coverage is 100%, so all six parameters (html, width, height, htmlPath, previews, includeDocument) are already documented in the schema. The description adds only scattered hints (default thumbnail) without new syntax or format guidance, so baseline 3 applies.

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?

States a specific verb+resource: converts HTML/CSS web pages into an editable freeform canvas document (v44). The 'template can't do it' framing and detailed conversion mechanics (shapes, text boxes, images, SVG nodes, CSS z-index stacking) clearly differentiate it from sibling creators like create_document_from_template and create_document_from_content.

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?

Gives a clear condition for use ('适合模板排不出来的版式'), names the downstream workflow (check_document → apply_actions → render_document → open_in_editor), and points to get_guide("html-import") for HTML authoring details. It does not explicitly name the alternative sibling to use when a template does fit, so it stops just short of full alternative routing.

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