Skip to main content
Glama

list_drafts

Retrieve draft posts from Substack with titles, creation dates, and audience details for review and management.

Instructions

List draft posts. Returns title, creation date, and audience for each draft.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetNoNumber of drafts to skip
limitNoMax drafts to return (1-100)

Implementation Reference

  • The handler function for the list_drafts tool. Takes offset and limit parameters, calls client.getDrafts() to fetch drafts from the Substack API, maps the results to a summary format with id, title, subtitle, audience, word_count, created_at, and updated_at fields, and returns the JSON response.
    async ({ offset, limit }) => {
      const drafts = await client.getDrafts(offset, Math.min(limit, 100));
      const summary = drafts.map((d) => ({
        id: d.id,
        title: d.draft_title,
        subtitle: d.draft_subtitle,
        audience: d.audience,
        word_count: d.word_count,
        created_at: d.draft_created_at,
        updated_at: d.draft_updated_at,
      }));
      return {
        content: [{ type: "text", text: JSON.stringify(summary, null, 2) }],
      };
    },
  • The getDrafts method in SubstackClient class that makes the actual HTTP GET request to the Substack API endpoint /api/v1/drafts with offset and limit query parameters. Returns an array of SubstackDraft objects.
    async getDrafts(offset = 0, limit = 25): Promise<SubstackDraft[]> {
      return this.request<SubstackDraft[]>(
        `${this.publicationUrl}/api/v1/drafts?offset=${offset}&limit=${limit}`,
      );
    }
  • TypeScript interface definition for SubstackDraft, defining the structure of draft objects returned by the API including id, draft_title, draft_subtitle, draft_body, draft_bylines, audience, type, word_count, cover_image, section_id, draft_created_at, and draft_updated_at fields.
    export interface SubstackDraft {
      id: number;
      draft_title: string;
      draft_subtitle: string | null;
      draft_body: string | null;
      draft_bylines: Array<{ id: number; is_guest: boolean }>;
      audience: string;
      type: string;
      word_count: number;
      cover_image: string | null;
      section_id: number | null;
      draft_created_at: string;
      draft_updated_at: string;
    }
  • src/server.ts:53-75 (registration)
    Registration of the list_drafts tool with the MCP server. Defines the tool name, description, input schema using Zod (offset and limit parameters with defaults), and the async handler function.
    server.tool(
      "list_drafts",
      "List draft posts. Returns title, creation date, and audience for each draft.",
      {
        offset: z.number().optional().default(0).describe("Number of drafts to skip"),
        limit: z.number().optional().default(25).describe("Max drafts to return (1-100)"),
      },
      async ({ offset, limit }) => {
        const drafts = await client.getDrafts(offset, Math.min(limit, 100));
        const summary = drafts.map((d) => ({
          id: d.id,
          title: d.draft_title,
          subtitle: d.draft_subtitle,
          audience: d.audience,
          word_count: d.word_count,
          created_at: d.draft_created_at,
          updated_at: d.draft_updated_at,
        }));
        return {
          content: [{ type: "text", text: JSON.stringify(summary, null, 2) }],
        };
      },
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the return fields (title, creation date, audience) but doesn't cover critical aspects like pagination behavior (implied by offset/limit but not explained), permissions, rate limits, or error handling. This is a significant gap for a list tool with zero annotation coverage.

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 and front-loaded, consisting of two efficient sentences that directly state the purpose and return values. Every word earns its place with no redundancy or unnecessary details.

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

Completeness3/5

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

Given the tool's low complexity (list operation with 2 parameters) and 100% schema coverage, the description is minimally adequate but incomplete. It lacks output schema, so it should explain return values more thoroughly (e.g., format, pagination details). Without annotations, it misses behavioral context, making it just barely viable.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents the two parameters (offset and limit). The description adds no parameter-specific information beyond what the schema provides, such as default values or usage context. Baseline 3 is appropriate when the schema handles all parameter documentation.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('draft posts'), specifying what the tool does. It distinguishes from siblings like 'get_draft' (single draft) and 'list_published_posts' (published vs. drafts), though it doesn't explicitly name these alternatives. However, it lacks explicit sibling differentiation, keeping it from a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'list_drafts' over 'list_published_posts' or 'get_draft', nor does it specify any prerequisites or exclusions. This leaves the agent with minimal context for tool selection.

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

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