schedule_draft
Schedule a draft to publish at a specified future date and time using its ID and ISO 8601 datetime.
Instructions
Schedule a draft to publish at a future datetime.
Args: post_id: Draft ID. iso_datetime: ISO 8601 datetime, e.g., '2026-05-15T09:00:00+09:00' for JST or '2026-05-15T00:00:00Z' for UTC.
Returns: {post_id, scheduled_for}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes | ||
| iso_datetime | Yes |
Implementation Reference
- src/substack_mcp/client.py:255-267 (handler)The actual handler/logic: parses the ISO datetime, calls the underlying Substack API's schedule_draft method, and returns a dict with post_id, scheduled_for, and raw response.
def schedule_draft(self, post_id: str, iso_datetime: str) -> dict: try: dt = datetime.fromisoformat(iso_datetime) except ValueError as e: raise ValueError( f"iso_datetime must be ISO 8601 format (e.g., 2026-05-15T09:00:00+09:00). Got: {iso_datetime!r}" ) from e result = self._api.schedule_draft(post_id, dt) return { "post_id": post_id, "scheduled_for": dt.isoformat(), "raw": result, } - src/substack_mcp/server.py:149-161 (registration)The MCP tool registration: decorated with @mcp.tool() which registers 'schedule_draft' as an MCP tool. Defines args (post_id, iso_datetime) and delegates to SubstackClient.schedule_draft.
@mcp.tool() def schedule_draft(post_id: str, iso_datetime: str) -> dict: """Schedule a draft to publish at a future datetime. Args: post_id: Draft ID. iso_datetime: ISO 8601 datetime, e.g., '2026-05-15T09:00:00+09:00' for JST or '2026-05-15T00:00:00Z' for UTC. Returns: {post_id, scheduled_for} """ return _get_client().schedule_draft(post_id=post_id, iso_datetime=iso_datetime)