# Markdown to Word (DOCX)

Turn Markdown into a Word document with real headings, lists, tables and code, ready to edit.

Converts Markdown to an editable Word file (.docx) that also opens in Google Docs, LibreOffice and Pages. Nothing outside the Markdown is ever loaded.

- Endpoint: `POST https://setget.net/v1/tools/markdown-to-docx` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `markdown-to-docx`
- Page: https://setget.net/tools/markdown-to-docx

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `markdown` (required, string): The Markdown to convert.
- `title` (optional, string, default `""`): Title placed at the top of the document and stored in its properties. Leave empty for none.
- `toc` (optional, boolean, default `false`): Add a table of contents at the start, built from the headings.

## Example 1: A short report

```json
{"input":{"markdown":"# Report\n\nSales rose **12%** this quarter.\n\n- North: 420\n- South: 380"},"wait":30}
```

## Example 2: With a title and a table of contents

```json
{"input":{"markdown":"## Plan\n\n1. Draft\n2. Review\n\n| Task | Owner |\n|------|-------|\n| Draft | Ana |","title":"Project plan","toc":true},"wait":30}
```

**Which Markdown is supported?** GitHub-style Markdown: headings, bold and italic, lists and task lists, tables, links, quotes, code blocks, strikethrough, footnotes and maths written between dollar signs.

**Do headings become real Word headings?** Yes. They use the built-in Heading 1, Heading 2 and so on, so Word's navigation pane, styles and table of contents work with them.

**Why is my picture missing?** Pictures are never downloaded and files cannot be attached to this tool, so every picture is replaced by its description. Add the pictures in Word afterwards.

**The table of contents is empty or asks to be updated. Why?** Word fills it in when the file is opened. Answer Yes when Word asks to update the fields, or right-click the table and choose Update field.

**What happens to HTML in the Markdown?** It is left out. Only Markdown formatting is carried over.

**What does a block between --- lines at the top do?** It is read as document settings, not as text. A "title:" line there becomes the title unless you give one here.
