Skip to main content
Glama

create_note

Publish short-form content to Substack using markdown format. This tool creates notes that are published immediately without a draft state.

Instructions

Create a Substack Note (short-form content). Accepts markdown text. Publishes immediately — there is no draft state for notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesNote content in markdown format

Implementation Reference

  • Tool registration and handler for 'create_note'. Registers the tool with Zod schema validation (body: string), then handles the request by converting markdown to ProseMirror format, calling client.createNote(), and returning the created note details.
    server.tool(
      "create_note",
      "Create a Substack Note (short-form content). Accepts markdown text. Publishes immediately — there is no draft state for notes.",
      {
        body: z.string().describe("Note content in markdown format"),
      },
      async ({ body }) => {
        const bodyJson = {
          type: "doc" as const,
          attrs: { schemaVersion: "v1" as const },
          content: markdownToProseMirrorContent(body),
        };
        const note = await client.createNote(bodyJson);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  id: note.id,
                  body: note.body,
                  date: note.date,
                  message: "Note published successfully.",
                },
                null,
                2,
              ),
            },
          ],
        };
      },
  • API client method that creates a note by constructing the payload with bodyJson, tabId, surface, and replyMinimumRole, then makes a POST request to the Substack API endpoint /api/v1/comment/feed.
    async createNote(
      bodyJson: NoteCreatePayload["bodyJson"],
      attachmentIds?: string[],
    ): Promise<SubstackNote> {
      const payload: NoteCreatePayload = {
        bodyJson,
        tabId: "for-you",
        surface: "feed",
        replyMinimumRole: "everyone",
      };
      if (attachmentIds?.length) {
        payload.attachmentIds = attachmentIds;
      }
      return this.request<SubstackNote>(
        `${this.publicationUrl}/api/v1/comment/feed`,
        {
          method: "POST",
          body: JSON.stringify(payload),
        },
      );
    }
  • Type definitions for the note creation payload (NoteCreatePayload) with bodyJson structure, and the response type (SubstackNote) with id, body, date, and other metadata fields.
    export interface NoteCreatePayload {
      bodyJson: {
        type: "doc";
        attrs: { schemaVersion: "v1" };
        content: unknown[];
      };
      tabId: string;
      surface: string;
      replyMinimumRole: string;
      attachmentIds?: string[];
    }
    
    export interface SubstackNote {
      id: number;
      body: string;
      body_json?: unknown;
      date: string;
      name: string;
      reaction_count: number;
      restacks: number;
      children_count: number;
      attachments: unknown[];
    }
  • Helper function that converts markdown text to ProseMirror content array format, used by the create_note handler to format the note body before sending to the API.
    /**
     * Returns the raw ProseMirror content array (for Notes, which wrap it in their own doc envelope).
     */
    export function markdownToProseMirrorContent(markdown: string): PMNode[] {
      const doc = JSON.parse(markdownToProseMirror(markdown));
      return doc.content;
    }
Behavior4/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 effectively communicates key behavioral traits: that notes publish immediately (no draft state), accept markdown text, and are short-form content. It doesn't mention permissions, rate limits, or error conditions, but provides essential operational context.

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 perfectly concise with two sentences that each earn their place. The first sentence states the purpose and input format, the second explains the critical behavioral characteristic (immediate publishing). No wasted words, front-loaded with essential information.

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?

For a single-parameter creation tool with no annotations and no output schema, the description provides good contextual completeness. It explains what the tool does, the input format, and the key behavioral trait (immediate publishing). It could benefit from mentioning the return value or any limitations, but covers the essentials well.

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?

The schema description coverage is 100%, so the schema already documents the single 'body' parameter as 'Note content in markdown format.' The description adds minimal value beyond the schema by mentioning 'Accepts markdown text' which essentially repeats what the schema says. Baseline 3 is appropriate when schema does the heavy lifting.

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 the specific action ('Create a Substack Note'), the resource ('short-form content'), and distinguishes it from siblings by specifying it's for notes (not drafts or posts). It explicitly mentions 'short-form content' which differentiates from other creation tools like create_draft.

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 provides clear context about when to use this tool ('Create a Substack Note') and implicitly distinguishes it from create_draft by stating 'Publishes immediately — there is no draft state for notes.' However, it doesn't explicitly mention alternatives like create_note_with_link or provide when-not-to-use guidance.

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