create_document
Create markdown documents in Unmarkdown to convert them into styled formats for Google Docs, Word, and Slack, with options for templates, themes, and folder organization.
Instructions
Create a new markdown document in Unmarkdown
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Document title | |
| content | No | Markdown content (default: empty) | |
| folder | No | Folder name (case-insensitive) or folder ID to place the document in | |
| template_id | No | Visual template ID (default: "swiss") | |
| theme_mode | No | Color theme (default: "light") |
Implementation Reference
- src/tools.ts:82-126 (handler)The `create_document` tool is defined and registered in `src/tools.ts`. It takes document metadata as input and calls the API to create a new document.
// 2. create_document server.tool( "create_document", "Create a new markdown document in Unmarkdown", { title: z.string().optional().describe("Document title"), content: z .string() .optional() .describe("Markdown content (default: empty)"), folder: z .string() .optional() .describe("Folder name (case-insensitive) or folder ID to place the document in"), template_id: z .string() .optional() .describe('Visual template ID (default: "swiss")'), theme_mode: z .enum(["light", "dark"]) .optional() .describe('Color theme (default: "light")'), }, { title: "Create Document", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, async ({ title, content, folder, template_id, theme_mode }) => { try { const body: Record<string, unknown> = {}; if (title) body.title = title; if (content) body.content = content; if (folder) body.folder = folder; if (template_id) body.template_id = template_id; if (theme_mode) body.theme_mode = theme_mode; const result = await client.request("POST", "/v1/documents", body); return jsonResult(result); } catch (err) { return errorResult(err); } }, );