launchnotes_get_announcement
Retrieve complete details for a specific LaunchNotes announcement including content, categories, and metadata by providing the announcement ID.
Instructions
Retrieve complete details for a specific announcement including content, categories, and metadata.
Args:
announcement_id (string): The ID of the announcement
response_format ('json' | 'markdown'): Output format (default: 'markdown')
Returns: Complete announcement details with all fields
Use Cases:
"Show me announcement details for ID abc123"
"Get the full content of announcement xyz"
"What are the categories for this announcement?"
Error Handling:
Returns "Announcement not found" if ID doesn't exist
Returns "Authentication failed" if API token is invalid
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| announcement_id | Yes | The ID of the announcement to retrieve | |
| response_format | No | Output format: 'json' for structured data, 'markdown' for human-readable | markdown |
Implementation Reference
- src/announcements/tools.ts:163-198 (handler)The main execution handler for the 'launchnotes_get_announcement' tool. Fetches announcement data via GraphQL, supports JSON or Markdown output formatting, and handles errors.
async (params: GetAnnouncementInput) => { try { const result = await getAnnouncement(client, params.announcement_id); const announcement = result.announcement; if (params.response_format === RESPONSE_FORMAT.JSON) { return { content: [ { type: "text", text: JSON.stringify(announcement, null, 2), }, ], }; } // Markdown format return { content: [ { type: "text", text: formatAnnouncementMarkdown(announcement), }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error retrieving announcement: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } - src/announcements/schemas.ts:68-77 (schema)Input schema using Zod for validating parameters: announcement_id (required string) and response_format (optional json/markdown).
export const GetAnnouncementSchema = z .object({ announcement_id: z .string() .min(1, "Announcement ID is required") .describe("The ID of the announcement to retrieve"), response_format: responseFormatSchema, }) .strict(); - src/announcements/tools.ts:134-200 (registration)Registration of the tool with the MCP server, including metadata (title, description), input schema reference, annotations for tool behavior, and handler attachment.
server.registerTool( "launchnotes_get_announcement", { title: "Get LaunchNotes Announcement", description: `Retrieve complete details for a specific announcement including content, categories, and metadata. Args: - announcement_id (string): The ID of the announcement - response_format ('json' | 'markdown'): Output format (default: 'markdown') Returns: Complete announcement details with all fields Use Cases: - "Show me announcement details for ID abc123" - "Get the full content of announcement xyz" - "What are the categories for this announcement?" Error Handling: - Returns "Announcement not found" if ID doesn't exist - Returns "Authentication failed" if API token is invalid`, inputSchema: GetAnnouncementSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params: GetAnnouncementInput) => { try { const result = await getAnnouncement(client, params.announcement_id); const announcement = result.announcement; if (params.response_format === RESPONSE_FORMAT.JSON) { return { content: [ { type: "text", text: JSON.stringify(announcement, null, 2), }, ], }; } // Markdown format return { content: [ { type: "text", text: formatAnnouncementMarkdown(announcement), }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error retrieving announcement: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } } ); - src/announcements/queries.ts:199-206 (helper)Core GraphQL helper that executes the GET_ANNOUNCEMENT_QUERY to retrieve full announcement details by ID.
export async function getAnnouncement( client: GraphQLClient, announcementId: string ): Promise<{ announcement: LaunchNotesAnnouncement; }> { return client.execute(GET_ANNOUNCEMENT_QUERY, { id: announcementId }); } - src/announcements/queries.ts:31-70 (helper)GraphQL query string definition that fetches comprehensive announcement data including content, metadata, categories, analytics, and permalinks.
export const GET_ANNOUNCEMENT_QUERY = ` query GetAnnouncement($id: ID!) { announcement(id: $id) { id headline title titleWithFallback name description content contentHtml excerpt state slug publishedAt scheduledAt createdAt updatedAt author publicPermalink privatePermalink categories { id name color } emailAnalytics { sentCount openRate clickRate clickToOpenRate } viewerAnalytics { totalUniqueSubscribersCount totalUniqueAnonymousCount totalUniqueEmbeddedCount } } } `;