Skip to main content
Glama

list_drafts

Retrieve a list of recent unpublished drafts from your Substack publication, including post IDs, titles, and edit URLs, with an adjustable limit between 1 and 50.

Instructions

List recent drafts (unpublished posts).

Args: limit: Max number of drafts to return (1-50). Default 10.

Returns: List of draft summaries with post_id, title, edit_url, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'list_drafts'. Decorated with @mcp.tool(), accepts optional limit (default 10), delegates to SubstackClient.list_drafts().
    @mcp.tool()
    def list_drafts(limit: int = 10) -> list[dict]:
        """List recent drafts (unpublished posts).
    
        Args:
            limit: Max number of drafts to return (1-50). Default 10.
    
        Returns:
            List of draft summaries with post_id, title, edit_url, etc.
        """
        return _get_client().list_drafts(limit=limit)
  • Inline schema for the tool: parameter 'limit' (int, default 10, validated 1-50 at client layer).
    def list_drafts(limit: int = 10) -> list[dict]:
        """List recent drafts (unpublished posts).
    
        Args:
            limit: Max number of drafts to return (1-50). Default 10.
    
        Returns:
            List of draft summaries with post_id, title, edit_url, etc.
        """
        return _get_client().list_drafts(limit=limit)
  • Registration via @mcp.tool() decorator on the list_drafts function in server.py.
    @mcp.tool()
  • Client-side implementation of list_drafts. Validates limit (1-50), calls self._api.get_drafts(filter='draft', limit, offset=0), and summarizes each draft via _summarize_draft.
    def list_drafts(self, limit: int = 10) -> list[dict]:
        if limit < 1 or limit > 50:
            raise ValueError("limit must be between 1 and 50")
        raw = self._api.get_drafts(filter="draft", limit=limit, offset=0) or []
        return [self._summarize_draft(d) for d in raw]
  • Helper _summarize_draft used by list_drafts to transform raw API draft dicts into summarized output (post_id, title, subtitle, audience, post_date, is_published, cover_image, edit_url).
    def _summarize_draft(self, draft: dict, include_body: bool = False) -> dict:
        if not isinstance(draft, dict):
            return {"raw": draft}
        post_id = draft.get("id")
        out = {
            "post_id": str(post_id) if post_id is not None else None,
            "title": draft.get("draft_title") or draft.get("title"),
            "subtitle": draft.get("draft_subtitle") or draft.get("subtitle"),
            "audience": draft.get("audience"),
            "post_date": draft.get("post_date"),
            "is_published": draft.get("post_date") is not None,
            "cover_image": draft.get("cover_image"),
            "edit_url": (
                f"{self.publication_url}/publish/post/{post_id}"
                if post_id
                else None
            ),
        }
        if include_body:
            out["draft_body"] = draft.get("draft_body") or draft.get("body")
        return out
Behavior4/5

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

With no annotations, the description carries full burden. It indicates read-only behavior by saying 'List' and mentions return fields. It doesn't hide any destructive aspects, and the behavior is straightforward. A perfect score would need to explicitly state non-destructiveness, but it's clear.

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 extremely concise: two sentences in the main body, plus a structured Args/Returns section. Every sentence adds value, no fluff. The purpose is front-loaded.

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?

Given low complexity (1 parameter, no required), the presence of an output schema (described in Returns), and no annotations missing critical info, the description is complete. It covers purpose, parameter, and return format sufficiently for an agent to invoke this tool correctly.

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?

The schema provides only 'limit' with type and default. The description adds semantics: 'Max number of drafts to return (1-50). Default 10.' This explains constraints (1-50) and default behavior, compensating fully for the 0% schema description coverage.

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 'List recent drafts (unpublished posts)', specifying the verb 'list' and resource 'drafts', with a clarifying parenthetical. It distinguishes from siblings like get_draft (single) and create_draft (creation).

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 it lists recent drafts with an optional limit. It doesn't explicitly say when to use it over other tools, but given the sibling list, it's the only list tool, so context is clear. A small gap is not mentioning that it only returns recent ones, but that's inferred.

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