Skip to main content
Glama
PDF.co MCP Server

PDF.co MCP Server

Official
by pdfdotco

Markdown to PDF

markdown_to_pdf

Convert Markdown text or a public Markdown file URL into a Letter-size PDF with tables, code blocks, images, footnotes, and CJK text.

Instructions

Convert Markdown into a PDF (Letter portrait, fixed stylesheet) with tables, code blocks, footnotes, images and CJK text. The job always runs in the background: this returns a job ID, and the result comes from 'wait_job_completion'. A successful result can carry warnings (for example an image that could not be loaded was omitted); check them before using the PDF. Ref: https://developer.pdf.co/api/pdf-from-markdown.md

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "markdown_to_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPublic HTTP(S) URL to a UTF-8 Markdown file (up to 4 MiB). Provide either this or 'markdown', not both. Relative images and links resolve against this URL.
nameNoFile name for the output PDF. Defaults to markdown.pdf. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
markdownNoMarkdown text to convert (UTF-8, up to 4 MiB). Provide either this or 'url', not both. Use absolute URLs for images; relative paths cannot be resolved from inline text.
expirationNoLifetime of the output link in minutes, from 1 to 10080; the file is deleted afterwards. API default is 60. (Optional)

Output Schema

NameRequiredDescriptionDefault
tipsNo
statusYes
contentYes
credits_usedNo
credits_remainingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.13

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description adds substantial context beyond that — the mandatory async job model, the fact that success can still carry `warnings` (e.g. an image silently omitted), and the instruction to check warnings before consuming the PDF. It does not discuss output retention/expiration or failure modes beyond warnings, keeping it short of 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?

Four tightly-scoped sentences plus a reference link, with the highest-value facts (async job, warnings) near the front. Slightly dense packing of format details in sentence one, but nothing is filler.

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 an output schema exists, the description need not restate return fields, yet it goes further by explaining the job-ID/wait_job_completion handoff and warning semantics. Only file-lifetime/cleanup guidance (covered by the schema's expiration param) is absent from the prose.

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 url vs markdown exclusivity, size limits, name defaults, and expiration range. The description adds no parameter-level meaning beyond that, so the 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 ('Convert Markdown into a PDF') and immediately bounds the output ('Letter portrait, fixed stylesheet') plus supported Markdown features (tables, code blocks, footnotes, images, CJK). This clearly separates it from siblings such as html_to_pdf or document_to_pdf without needing their schemas.

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?

Explicitly tells the agent the workflow: the job always runs in the background, this call returns a job ID, and the result must be fetched via 'wait_job_completion'. It lacks an explicit 'do not use this when...' exclusion versus other *_to_pdf converters, but the retrieval contract is spelled out.

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