Skip to main content
Glama

create_note_with_link

Publish a Substack Note immediately with a linked URL displayed as a rich card below the text.

Instructions

Create a Substack Note with a link attachment. The link is displayed as a rich card below the note text. Publishes immediately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesNote content in markdown format
urlYesURL to attach as a link card

Implementation Reference

  • Tool registration and handler for 'create_note_with_link'. Calls createNoteAttachment to upload the URL, converts markdown body to ProseMirror, then calls createNote with the attachment ID.
    server.tool(
      "create_note_with_link",
      "Create a Substack Note with a link attachment. The link is displayed as a rich card below the note text. Publishes immediately.",
      {
        body: z.string().describe("Note content in markdown format"),
        url: z.string().url().describe("URL to attach as a link card"),
      },
      async ({ body, url }) => {
        const attachment = await client.createNoteAttachment(url);
        const bodyJson = {
          type: "doc" as const,
          attrs: { schemaVersion: "v1" as const },
          content: markdownToProseMirrorContent(body),
        };
        const note = await client.createNote(bodyJson, [attachment.id]);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  id: note.id,
                  body: note.body,
                  date: note.date,
                  attachment_id: attachment.id,
                  message: "Note with link published successfully.",
                },
                null,
                2,
              ),
            },
          ],
        };
      },
    );
  • Input schema for the tool: 'body' (string, markdown) and 'url' (string, URL format) validated via Zod.
    {
      body: z.string().describe("Note content in markdown format"),
      url: z.string().url().describe("URL to attach as a link card"),
    },
  • src/server.ts:300-334 (registration)
    Registration as an MCP tool via server.tool() in the createServer function.
    server.tool(
      "create_note_with_link",
      "Create a Substack Note with a link attachment. The link is displayed as a rich card below the note text. Publishes immediately.",
      {
        body: z.string().describe("Note content in markdown format"),
        url: z.string().url().describe("URL to attach as a link card"),
      },
      async ({ body, url }) => {
        const attachment = await client.createNoteAttachment(url);
        const bodyJson = {
          type: "doc" as const,
          attrs: { schemaVersion: "v1" as const },
          content: markdownToProseMirrorContent(body),
        };
        const note = await client.createNote(bodyJson, [attachment.id]);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  id: note.id,
                  body: note.body,
                  date: note.date,
                  attachment_id: attachment.id,
                  message: "Note with link published successfully.",
                },
                null,
                2,
              ),
            },
          ],
        };
      },
    );
  • Helper method createNoteAttachment() that POSTs the URL to /api/v1/comment/attachment to create a link attachment and returns a NoteAttachment with id.
    async createNoteAttachment(url: string): Promise<NoteAttachment> {
      return this.request<NoteAttachment>(
        `${this.publicationUrl}/api/v1/comment/attachment`,
        {
          method: "POST",
          body: JSON.stringify({ url, type: "link" }),
        },
      );
    }
  • Helper method createNote() that POSTs the note body JSON (with optional attachmentIds) to /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),
        },
      );
    }
Behavior4/5

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

With no annotations, the description carries the burden. It discloses that the tool publishes immediately and displays the link as a rich card. However, it does not mention side effects, permissions, or error conditions.

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?

Two sentences, no fluff. Every word provides necessary information. Front-loaded with the core purpose.

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 simple creation tool with 2 parameters and no output schema, the description covers the purpose, behavior, and immediate effect. It is slightly lacking in usage context but adequate.

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?

Schema coverage is 100% with descriptions. The description adds value by explaining the link card behavior, which enhances understanding of the 'url' parameter beyond the schema description.

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 tool creates a Substack Note with a link attachment, specifying the action, resource, and distinguishing feature (link as rich card). It also mentions immediate publishing, leaving no ambiguity.

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

Usage Guidelines3/5

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

The description implies use when creating a note with a link, but does not explicitly state when to use versus alternatives (e.g., create_note). No guidance on prerequisites or when not to use.

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