Skip to main content
Glama

generate_html

Read-onlyIdempotent

Convert Markdown to a complete, self-contained HTML document with inlined styles and KaTeX math. Returns the HTML string directly for browser rendering without writing files.

Instructions

Generate a complete, self-contained HTML document from Markdown with all styles inlined. Renders GFM (tables, task lists, strikethrough) and KaTeX math into a full HTML page with an embedded block and a KaTeX CSS CDN link. Returns the HTML string directly — no file is written to disk. Side effects: none. This tool is read-only and performs no file I/O. Returns: a complete HTML document string () with inline styles, ready for rendering in a browser. The optional title parameter sets the tag in the HTML section. Use this when you need styled HTML output returned as a string (e.g., for embedding in responses or previewing). Prefer convert_to_html when you need to write the HTML to a file on disk. Prefer convert_to_pdf or convert_to_image for non-HTML visual output formats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesThe raw Markdown source text to convert. Supports GitHub-Flavored Markdown (tables, task lists, strikethrough) and KaTeX math expressions. Pass the full document content as a string, not a file path.
titleNoOptional. Sets the <title> tag in the HTML document's <head> section. Displayed in browser tabs and bookmarks. Defaults to 'Document' if omitted.

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/XJTLUmedia/MCP_Markdown_Formatter'

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