Skip to main content
Glama

Replace a draft body with a structured document

set_draft_body
Idempotent

Replace a draft's body with a node-by-node Substack document for exact control over captions, buttons, and layout when markdown is insufficient. Validates the document before sending.

Instructions

Replace a draft's body with a Substack document you build node by node. Use this when you need exact control that markdown cannot express, such as a specific image caption or a button.

The document is {"type":"doc","content":[ ... ]}.

Nodes: paragraph; heading (attrs.level 1-6, rendered by Substack as its H1-H3); blockquote; bullet_list / ordered_list (attrs.order, attrs.tight) with list_item children; code_block (attrs.language); horizontal_rule; image2 (attrs.src, attrs.alt, attrs.caption); youtube2 (attrs.videoId); twitter2 (attrs.url); spotify2 (attrs.url); vimeo (attrs.url); paywall (everything after it is for paying subscribers); button (attrs.url, attrs.text); subscribeWidget (attrs.text); footnote (attrs.number) with footnoteAnchor.

Marks on text nodes: strong; em; code; strikethrough; link (attrs.href).

The document is validated before it is sent, so an unknown node name is an error here rather than a post that renders wrong on Substack. For ordinary writing, update_draft with markdown is easier and produces the same result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDraft id.
documentYesThe full ProseMirror document as a JSON string, shaped {"type":"doc","content":[...]}.
publicationNoWhich connected publication to act on, matched loosely against its hostname (for example 'example.substack.com' or just 'example'). Defaults to the first connected publication.
Install Server

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description reveals key runtime behavior: the document is validated before sending, unknown node names produce errors, paywall content is behind the paywall, and headings render as Substack H1-H3. The full node and mark grammar also clarifies what will and will not be accepted. No statement contradicts the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long, but the length is justified by the complexity of the document grammar. The purpose and use condition are front-loaded, and every following block, node list, mark list, validation note, and alternative, earns its place without repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with no output schema, the description provides the reference an agent needs to construct a valid structured document and warns about validation behavior. Combined with full parameter schema coverage, there are no significant gaps for correct selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds substantial meaning by enumerating every supported node type, their attributes, and marks. This is the essential knowledge for constructing the document parameter and goes far beyond the schema's generic JSON string description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a concrete action: replace a draft's body with a Substack document built node by node. It names the exact resource and makes the tool's niche clear by contrasting it with ordinary markdown writing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool: when you need exact control that markdown cannot express, with concrete examples such as image captions and buttons. It also names the alternative, update_draft with markdown, and says it is easier for ordinary writing, giving clear routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

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/navidmoazzez/substack-mcp-cli'

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