Skip to main content
Glama
AssemblyJustin

Assembly MCP

convert_mdtopdf

Generate a PDF from Markdown by passing a file path or raw text. Outputs a print-ready PDF to a specified path.

Instructions

Convert Markdown to a PDF file.

Renders Markdown → HTML → PDF with WeasyPrint (the Assembly MD→PDF stack)
using a clean print stylesheet. Provide EITHER `md_path` OR `markdown_text`.
A PDF is binary, so `output_path` is required.

Args:
    output_path: Path to write the resulting `.pdf` (required).
    md_path: Path to a source `.md` file.
    markdown_text: Raw Markdown string (alternative to `md_path`).
    title: Optional document title (falls back to front-matter `title`).
    css: Optional CSS to replace the built-in print stylesheet.

Returns:
    A confirmation string with the output path, byte size, and page count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cssNo
titleNo
md_pathNo
output_pathYes
markdown_textNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description fully carries the burden of behavioral disclosure. It reveals the rendering stack (WeasyPrint), input alternatives, the binary nature of output requiring a path, the title fallback to front-matter, and the exact return format (confirmation string with output path, byte size, page count). It does not mention overwrite behavior or error conditions when both inputs are provided, but the disclosed details substantially exceed what a minimal description would provide.

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 description is longer than average but well-structured: a one-line purpose, a pipeline/usage explanation, an Args list, and a Returns note. Every sentence carries information—there is no filler or repetition of schema fields. The front-loaded purpose sentence ensures the core meaning is immediately visible.

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 tool has 5 parameters, 0% schema description coverage, no annotations, and an output schema, the description covers the essentials well: pipeline, input constraints, parameter semantics, and return value format. Minor gaps exist—such as overwrite policy or behavior when both md_path and markdown_text are supplied—but the description is largely complete for an AI agent to select and use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate entirely. It does so comprehensively with an Args block that explains all five parameters: output_path (required), md_path, markdown_text (the alternative), title (with fallback behavior), and css (replacement for built-in stylesheet). This adds meaning far beyond the bare schema types and defaults.

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 specific verb+resource: 'Convert Markdown to a PDF file.' It then details the rendering pipeline (Markdown → HTML → PDF with WeasyPrint), which clearly distinguishes this tool from its sibling convert_pdftomd (the reverse conversion). This is a precise, unambiguous purpose statement.

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 provides clear usage context: 'Provide EITHER `md_path` OR `markdown_text`' and explains why `output_path` is required (PDF is binary). It also notes the title fallback behavior and CSS replacement option. However, it does not explicitly name convert_pdftomd as the alternative for the reverse conversion, so it stops short of an explicit when-not-to-use statement.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AssemblyJustin/assembly-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server