Skip to main content
Glama

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
NameRequiredDescriptionDefault
titleNoDocument title
contentNoMarkdown content (default: empty)
folderNoFolder name (case-insensitive) or folder ID to place the document in
template_idNoVisual template ID (default: "swiss")
theme_modeNoColor theme (default: "light")

Implementation Reference

  • 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);
        }
      },
    );

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/UnMarkdown/mcp-server'

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