Skip to main content
Glama
launchnotes

LaunchNotes MCP Server

Official
by launchnotes

Publish LaunchNotes Announcement

launchnotes_publish_announcement

Publish announcements immediately to make them live and visible to subscribers. Use this tool to send notifications according to project settings.

Instructions

Publish an announcement immediately, making it live and visible to subscribers.

Args:

  • announcement_id (string): The ID of the announcement to publish

Returns: Confirmation with published announcement details and publish timestamp

Use Cases:

  • "Publish announcement abc123"

  • "Make this announcement live now"

  • "Publish my draft announcement"

Notes:

  • Announcement must be in draft or scheduled state

  • Subscribers will be notified according to project settings

  • Use schedule_announcement to publish at a future time

Error Handling:

  • Returns error if announcement is already published

  • Returns "Announcement not found" if ID doesn't exist

  • Returns "Authentication failed" if API token lacks permission

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
announcement_idYesThe ID of the announcement to publish

Implementation Reference

  • The core handler function for the launchnotes_publish_announcement tool. It calls the publishAnnouncement helper, processes the GraphQL result, handles errors, and returns a formatted success or error message.
    async (params: PublishAnnouncementInput) => {
      try {
        const result = await publishAnnouncement(client, params.announcement_id);
    
        if (
          result.publishAnnouncement.errors &&
          result.publishAnnouncement.errors.length > 0
        ) {
          const errorMessages = result.publishAnnouncement.errors
            .map((err) => err.message)
            .join(", ");
          throw new Error(errorMessages);
        }
    
        const announcement = result.publishAnnouncement.announcement;
    
        return {
          content: [
            {
              type: "text",
              text: `✓ Successfully published "${announcement?.headline}"\n\n**ID:** ${announcement?.id}\n**State:** ${announcement?.state}\n**Published at:** ${announcement?.publishedAt ? new Date(announcement.publishedAt).toLocaleString() : "Now"}\n\nThe announcement is now live and subscribers have been notified.`,
            },
          ],
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error publishing announcement: ${error instanceof Error ? error.message : "Unknown error"}`,
            },
          ],
        };
      }
  • Zod schema defining the input for the tool: requires announcement_id string.
     * Schema for launchnotes_publish_announcement
     */
    export const PublishAnnouncementSchema = z
      .object({
        announcement_id: z
          .string()
          .min(1, "Announcement ID is required")
          .describe("The ID of the announcement to publish"),
      })
      .strict();
    
    export type PublishAnnouncementInput = z.infer<typeof PublishAnnouncementSchema>;
  • Registers the launchnotes_publish_announcement tool with MCP server, including title, description, input schema, annotations, and the handler function.
      server.registerTool(
        "launchnotes_publish_announcement",
        {
          title: "Publish LaunchNotes Announcement",
          description: `Publish an announcement immediately, making it live and visible to subscribers.
    
    Args:
      - announcement_id (string): The ID of the announcement to publish
    
    Returns:
      Confirmation with published announcement details and publish timestamp
    
    Use Cases:
      - "Publish announcement abc123"
      - "Make this announcement live now"
      - "Publish my draft announcement"
    
    Notes:
      - Announcement must be in draft or scheduled state
      - Subscribers will be notified according to project settings
      - Use schedule_announcement to publish at a future time
    
    Error Handling:
      - Returns error if announcement is already published
      - Returns "Announcement not found" if ID doesn't exist
      - Returns "Authentication failed" if API token lacks permission`,
          inputSchema: PublishAnnouncementSchema,
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: true,
          },
        },
        async (params: PublishAnnouncementInput) => {
          try {
            const result = await publishAnnouncement(client, params.announcement_id);
    
            if (
              result.publishAnnouncement.errors &&
              result.publishAnnouncement.errors.length > 0
            ) {
              const errorMessages = result.publishAnnouncement.errors
                .map((err) => err.message)
                .join(", ");
              throw new Error(errorMessages);
            }
    
            const announcement = result.publishAnnouncement.announcement;
    
            return {
              content: [
                {
                  type: "text",
                  text: `✓ Successfully published "${announcement?.headline}"\n\n**ID:** ${announcement?.id}\n**State:** ${announcement?.state}\n**Published at:** ${announcement?.publishedAt ? new Date(announcement.publishedAt).toLocaleString() : "Now"}\n\nThe announcement is now live and subscribers have been notified.`,
                },
              ],
            };
          } catch (error) {
            return {
              isError: true,
              content: [
                {
                  type: "text",
                  text: `Error publishing announcement: ${error instanceof Error ? error.message : "Unknown error"}`,
                },
              ],
            };
          }
        }
  • Helper function that executes the GraphQL publishAnnouncement mutation and returns the result.
    export async function publishAnnouncement(
      client: GraphQLClient,
      announcementId: string
    ): Promise<{
      publishAnnouncement: {
        announcement?: {
          id: string;
          headline: string;
          state: string;
          publishedAt?: string;
        };
        errors?: Array<{
          message: string;
          path?: string[];
        }>;
      };
    }> {
      return client.execute(PUBLISH_ANNOUNCEMENT_MUTATION, {
        input: {
          announcementId: announcementId,
        },
      });
    }

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/launchnotes/mcp'

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