Skip to content

docs.write_markdown

Schema

Input = {
path: string, // .md appended automatically if missing
content: string,
title?: string, // prepended as "# title" if content doesn't already start with a heading
}
Output = {
path: string,
size: number,
mime: 'text/markdown',
blocks?: number, // number of parsed markdown blocks, for tracing
}

The simplest of the doc-writing skills — mostly a thin, deliberate wrapper over files.write that guarantees a .md extension and a sensible top heading. blocks comes from the same block-level markdown parser (packages/skills/src/docs/markdown.ts) that powers docs.write_docx and docs.write_pdf, so a trace line can say “wrote 14 blocks” without re-parsing the file elsewhere.

Example

Terminal window
curl -s -X POST http://localhost:4000/api/studio/skills/invoke \
-H 'content-type: application/json' -b cookies.txt \
-d '{"name":"docs.write_markdown","input":{"path":"notes","title":"Meeting notes","content":"- Ship by Friday\n- Ping design"}}'
{ "ok": true, "output": { "path": "notes.md", "size": 54, "mime": "text/markdown", "blocks": 2 } }