Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
post_idYes
send_emailNo
share_automaticallyNo

Implementation Reference

  • 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,
        }
  • 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,
        )
  • 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.
Behavior3/5

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

No annotations provided, so description carries burden. It explains the effect of boolean parameters (send_email, share_automatically) and returns a dict. But it doesn't disclose potential irreversibility, permission requirements, or side effects beyond those stated.

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?

Description is concise and well-structured: a brief purpose statement followed by a clean bulleted list of parameters and return. Every sentence adds value with no repetition or fluff.

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

Completeness4/5

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

Given no output schema, the description includes return fields (post_id, title, public_url, etc.). It covers the tool's behavior adequately for a simple publish operation. Lacks error handling info but within acceptable bounds.

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

Parameters4/5

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

Description adds meaningful context: 'send_email' and 'share_automatically' each have conditional behavior explained. 'post_id' is simply 'Draft ID', lacking detail. With 0% schema coverage, the description compensates well for most parameters.

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 clearly states 'Publish a draft immediately.' with a specific verb and resource. It distinguishes from siblings like 'schedule_draft' (scheduling) and 'delete_draft' (deletion) by focusing on immediate publication.

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

Usage Guidelines4/5

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

The description implies immediate publishing, and sibling tool 'schedule_draft' suggests alternative for future scheduling. However, no explicit when-not-to-use or exclusion criteria are given.

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

Install Server

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

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