publish_draft
Immediately publish a draft post on your Substack publication with control over email notifications and social sharing.
Instructions
Publish a draft immediately.
Args: post_id: Draft ID. send_email: If True (default), send the post as an email to subscribers. If False, publish to web only without emailing. share_automatically: If True, auto-share to Substack social channels.
Returns: {post_id, title, public_url, post_date, send_email}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes | ||
| send_email | No | ||
| share_automatically | No |
Implementation Reference
- src/substack_mcp/client.py:234-253 (handler)Client-side handler that calls the Substack API to publish a draft. Calls self._api.publish_draft() with post_id, send (email), and share_automatically params, then returns a summary dict with post_id, title, public_url, post_date, and send_email.
def publish_draft( self, post_id: str, send_email: bool = True, share_automatically: bool = False, ) -> dict: result = self._api.publish_draft( post_id, send=send_email, share_automatically=share_automatically, ) slug = result.get("slug") or result.get("draft_slug") or "" public_url = f"{self.publication_url}/p/{slug}" if slug else None return { "post_id": str(result.get("id", post_id)), "title": result.get("title") or result.get("draft_title"), "public_url": public_url, "post_date": result.get("post_date"), "send_email": send_email, } - src/substack_mcp/server.py:125-146 (registration)MCP tool registration using @mcp.tool() decorator on publish_draft. Accepts post_id (str), send_email (bool, default True), share_automatically (bool, default False). Delegates to _get_client().publish_draft().
@mcp.tool() def publish_draft( post_id: str, send_email: bool = True, share_automatically: bool = False, ) -> dict: """Publish a draft immediately. Args: post_id: Draft ID. send_email: If True (default), send the post as an email to subscribers. If False, publish to web only without emailing. share_automatically: If True, auto-share to Substack social channels. Returns: {post_id, title, public_url, post_date, send_email} """ return _get_client().publish_draft( post_id=post_id, send_email=send_email, share_automatically=share_automatically, ) - src/substack_mcp/server.py:130-138 (schema)Input/output schema documentation in the docstring: post_id required, send_email and share_automatically optional booleans. Returns dict with post_id, title, public_url, post_date, send_email.
) -> dict: """Publish a draft immediately. Args: post_id: Draft ID. send_email: If True (default), send the post as an email to subscribers. If False, publish to web only without emailing. share_automatically: If True, auto-share to Substack social channels.