Skip to main content
Glama

用 Unsliced 生成 PDF

create_pdf

Generate searchable, copyable PDFs from full Markdown or HTML, with automatic pagination that keeps tables and diagrams intact.

Instructions

当用户需要可搜索、可复制、自动分页的 PDF 时使用。必须把完整原稿传入 markdown 或 html 的其中一个字段,不要缩写、删减或改写,再给出 filename。默认 A4。普通报告用 Markdown。涉及流程图、卡片、复杂版面或内联 SVG 时,请提交包含样式和图形的完整 HTML。图片请用内嵌 data URL。HTML 可用 data-unsliced-root 指定排版容器。返回本机文件路径和中文排版体检。请直接调用本工具,避免自行写 jsPDF 或 html2canvas。

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": {
      "filename": "<filename>"
    },
    "name": "create_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlNo
filenameYes文件名,例如 report.pdf。只写名字,扩展名可省略。
markdownNo
paper_sizeNoA4

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / filename / description
      Previous value: -"文件名,例如 天才工厂.pdf。只写名字,扩展名可省略。"New value: +"文件名,例如 report.pdf。只写名字,扩展名可省略。"
  2. First observedv0.1.0

TDQS

A4.5/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 that the complete manuscript must be passed verbatim ('不要缩写、删减或改写'), that images must be inline data URLs, that HTML may name a layout container via data-unsliced-root, that A4 is the default, and that the call returns a local file path plus a Chinese typography check. Gaps remain around permissions, overwrite behavior when the filename already exists, and size limits (4MB schema max is unmentioned).

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-loaded with the use condition, then the mandatory-content rule, then variant selection, then specifics (data URL, layout root), closing with the return value and a don't-do-this-yourself warning. Every sentence carries information; the middle section blends hard requirements with formatting advice, which slightly muddies scanning but nothing is wasted.

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 four-parameter generation tool with no output schema and no annotations, the definition covers input validity, format routing, asset handling, defaults, and return shape. Only the overwrite/permission semantics and the size ceiling are unaddressed, which are edge concerns rather than blockers.

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 description coverage is only 25% (only filename is documented in-schema), so the description must compensate and largely does: it defines what markdown vs. html each accept, states the default paper size, and constrains filename usage. It never explains the enum values for paper_size or the character ceilings, leaving those to 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 names a concrete verb and artifact ('生成 PDF'/'可搜索、可复制、自动分页的 PDF'), plus the delivery format (local file path) and a typography check. An agent immediately knows this turns Markdown/HTML into a PDF file, not a text result.

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

Usage Guidelines5/5

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

It states the trigger condition (user needs a searchable, copyable, auto-paginated PDF), routes between the two input modes ('普通报告用 Markdown' vs. '涉及流程图、卡片、复杂版面或内联 SVG 时…用 HTML'), and explicitly tells the agent to call this tool instead of writing jsPDF/html2canvas itself. When-to-use, which-variant, and which-alternative-to-avoid are all covered.

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

Deploy Server

Other Tools