Skip to main content
Glama

render_document

Render freeform canvas documents to PNG, JPEG, or PDF headlessly, with per-page images and thumbnails for quick layout checks.

Instructions

把自由画布 v44 文档(v1–43 输入自动迁移)无头渲染为图片或 PDF(与编辑器导出同一管线:网页字体按字符子集嵌入、图片就绪等待、逐页导出),默认逐页 PNG 到 outputDir,另附每页小缩略图供你直接查看效果。长图、九宫格、PDF、JPEG、倍率等输出方式见 get_guide("render-export")。仅支持自由画布文档;文档中的图片 src 必须是浏览器可加载的 URL 或 data URL。文档怎么写见 dingcard://schema/freeform 资源或 get_guide("document-model")。

Input Schema

NameRequiredDescriptionDefault
gridNopng / jpeg:每个正方形页面切成九宫格(九个文件),代替逐页文件
longNopng / jpeg:所有页拼成一张长图,代替逐页文件
scaleNo像素倍率,默认 1
formatNopng(默认,保留透明)、jpeg(白底)或 pdf(所有页在一个文件里)
qualityNojpeg 和 pdf 的 JPEG 质量,默认 0.92
baseNameNo输出文件名前缀,默认 "dingcard"
documentNo完整的 v44(或 v1–43 旧版)文档 JSON,可替代 documentId
previewsNo是否附上缩略图,默认 true
slideIdsNo只渲染这些页(默认全部,按文档页序);长图和 PDF 也只包含这些页
outputDirYes输出目录(不存在会创建)
documentIdNo创建或修改文档的工具返回的 documentId(推荐:不必来回传整份文档)
documentPathNo文档 JSON 文件的路径,可替代 documentId

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?

No annotations are provided, so the description carries the full burden. It discloses several non-obvious behaviors: the renderer uses the same pipeline as the editor, embeds web fonts as per-character subsets, waits for images to be ready, exports page by page, and auto-migrates v1–43 documents to v44. It omits cost or duration expectations and failure behavior for unreachable image URLs, which keeps it below 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?

The content is front-loaded: the tool's action and default output appear first, followed by scope limits and pointers to related guides. It is dense but not padded, although the nested parentheticals and three separate cross-references make it slightly harder to scan.

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 12-parameter, annotation-free tool with no output schema, the description covers pipeline behavior, the required input constraints, and where to find more detail. However, it never says what the call returns (for example, output file paths or a thumbnail list), which is a meaningful gap when no output schema exists.

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 the schema already documents every parameter, including format defaults, previews default true, quality range, and the document/documentId/documentPath alternatives. The description mostly restates those defaults (page-by-page PNG, thumbnails attached) rather than adding new meaning, so the baseline 3 is appropriate.

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 states a specific verb and resource (headlessly render freeform-canvas v44 documents to images or PDF) and immediately names its differentiators: it uses the same pipeline as the editor export, with font subsetting, image-readiness waiting, and page-by-page export. It also states the default behavior (page-by-page PNG into outputDir plus thumbnails) and the hard scope limit (only freeform-canvas documents). An agent can distinguish it from siblings such as render_markdown or open_in_editor without opening the schema.

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 when-to-use constraints: it is only for freeform-canvas documents, and image src values must be browser-loadable URLs or data URLs. It routes the agent to get_guide("render-export") for long-image, grid, PDF, JPEG, and scale modes, and to dingcard://schema/freeform for authoring. It does not explicitly exclude sibling tools such as render_markdown, so it falls short of a full 5.

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