Skip to main content
Glama
mcp-web-print-pdf

mcp-web-print-pdf

by weixiaoyi

printHtmlByUrl

Fetch a web page by URL and render it to PDF for printing; preview-only mode and cookie, header, or local-storage support handle authenticated pages.

Instructions

抓取一个网页并渲染成 PDF 打印。默认出纸;dry_run: true 只预览;登录态可用 extra_options.cookies / httpHeaders / localStorages 处理

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": {
      "url": "<url>"
    },
    "name": "printHtmlByUrl"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes网页 http(s) 地址
copiesNo便捷参数:份数
dry_runNofalse(默认)= 真正出纸;true = 只渲染预览。显式 extra_options.action 优先于本项
pdf_optionsNoPDF 排版选项(字段与客户端 pdfOptions 白名单一致,未知字段会报错)
paper_formatNo便捷参数:纸张名。标准纸名会同时写入 pdf_options.paperFormat 与 print_options.paperFormat;其它纸名只写后者
printer_nameNo便捷参数:打印机名,留空用系统默认打印机
extra_optionsNo额外选项:action/requestTimeout/cookies/httpHeaders/localStorages/sessionStorages,以及任意自定义键(会原样返回)
print_optionsNo打印机选项(字段与客户端 printOptions 白名单一致,未知字段会报错)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.4

TDQS

A4.2/5.0
Behavior4/5

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

Since there are no annotations, the description is crucial here. It explains a vital operational behavior: how the tool handles logged-in states by detailing the usage of `extra_options.cookies`, `httpHeaders`, and `localStorages` for session management.

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?

The definition is brief and direct, front-loading the primary function and key behavioral constraints (default printing, preview mode) in the first 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?

Given the high number of complex parameters and sibling tools, the description provides essential high-level context regarding authenticated sessions and the primary operational modes (print vs. preview), making it very actionable.

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?

The schema coverage is 100%, so the schema provides exhaustive parameter semantics. The description reiterates the `dry_run` boolean meaning and the function of the `extra_options` object, which adds contextual behavior rather than defining parameter syntax.

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 explicitly states the core function: '抓取一个网页并渲染成 PDF 打印' (Scrape a web page and render it as a PDF for printing). It clearly defines the action and the resource, making it highly distinct from siblings like `printHtml`.

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 provides clear guidance on workflow by differentiating between printing (default) and preview ('dry_run: true'). Furthermore, it instructs users on how to handle complex scenarios like authenticated sessions using specific `extra_options`.

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