Skip to main content
Glama
launchnotes

LaunchNotes MCP Server

Official
by launchnotes

launchnotes_archive_announcement

Archive announcements to remove them from public view while preserving content for potential restoration later.

Instructions

Archive an announcement, removing it from the active list while preserving its content.

Args:

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

Returns: Confirmation with archived announcement details

Use Cases:

  • "Archive old announcement abc123"

  • "Remove announcement from public view"

  • "Archive outdated announcements"

Notes:

  • Archived announcements are no longer visible on the public page

  • Content and data are preserved

  • Can be unarchived later if needed

  • Different from deleting (which would be permanent)

Error Handling:

  • Returns error if announcement is already archived

  • 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 archive

Implementation Reference

  • The handler function that implements the core logic of the 'launchnotes_archive_announcement' tool. It executes the GraphQL archive mutation via the helper function, processes the response, handles errors, and returns formatted success or error messages.
    async (params: ArchiveAnnouncementInput) => {
      try {
        const result = await archiveAnnouncement(client, params.announcement_id);
    
        if (
          result.archiveAnnouncement.errors &&
          result.archiveAnnouncement.errors.length > 0
        ) {
          const errorMessages = result.archiveAnnouncement.errors
            .map((err) => err.message)
            .join(", ");
          throw new Error(errorMessages);
        }
    
        const announcement = result.archiveAnnouncement.announcement;
    
        return {
          content: [
            {
              type: "text",
              text: `✓ Successfully archived "${announcement?.headline}"\n\n**ID:** ${announcement?.id}\n**State:** ${announcement?.state}\n\nThe announcement has been removed from public view but its content is preserved.`,
            },
          ],
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error archiving announcement: ${error instanceof Error ? error.message : "Unknown error"}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameters for the tool, requiring a single 'announcement_id' string.
    /**
     * Schema for launchnotes_archive_announcement
     */
    export const ArchiveAnnouncementSchema = z
      .object({
        announcement_id: z
          .string()
          .min(1, "Announcement ID is required")
          .describe("The ID of the announcement to archive"),
      })
      .strict();
    
    export type ArchiveAnnouncementInput = z.infer<typeof ArchiveAnnouncementSchema>;
  • Registers the 'launchnotes_archive_announcement' tool with the MCP server, specifying title, detailed description, input schema, and behavioral annotations.
      server.registerTool(
        "launchnotes_archive_announcement",
        {
          title: "Archive LaunchNotes Announcement",
          description: `Archive an announcement, removing it from the active list while preserving its content.
    
    Args:
      - announcement_id (string): The ID of the announcement to archive
    
    Returns:
      Confirmation with archived announcement details
    
    Use Cases:
      - "Archive old announcement abc123"
      - "Remove announcement from public view"
      - "Archive outdated announcements"
    
    Notes:
      - Archived announcements are no longer visible on the public page
      - Content and data are preserved
      - Can be unarchived later if needed
      - Different from deleting (which would be permanent)
    
    Error Handling:
      - Returns error if announcement is already archived
      - Returns "Announcement not found" if ID doesn't exist
      - Returns "Authentication failed" if API token lacks permission`,
          inputSchema: ArchiveAnnouncementSchema,
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: true,
          },
        },
  • Helper function that executes the GraphQL mutation to archive the announcement, handling the API call and returning typed response.
    export async function archiveAnnouncement(
      client: GraphQLClient,
      announcementId: string
    ): Promise<{
      archiveAnnouncement: {
        announcement?: {
          id: string;
          headline: string;
          state: string;
        };
        errors?: Array<{
          message: string;
          path?: string[];
        }>;
      };
    }> {
      return client.execute(ARCHIVE_ANNOUNCEMENT_MUTATION, {
        input: {
          announcementId: announcementId,
        },
      });
    }
  • GraphQL mutation definition used to archive the announcement via the LaunchNotes API.
    export const ARCHIVE_ANNOUNCEMENT_MUTATION = `
      mutation ArchiveAnnouncement($input: ArchiveAnnouncementInput!) {
        archiveAnnouncement(input: $input) {
          announcement {
            id
            headline
            state
          }
          errors {
            message
            path
          }
        }
      }

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