launchnotes_create_announcement
Create draft announcements in LaunchNotes projects to communicate updates, features, or releases with structured content formats.
Instructions
Create a new draft announcement in a LaunchNotes project. The announcement will be created in draft state.
Args:
project_id (string): The ID of the project
headline (string): The main headline/title (required)
content_markdown (string, optional): Content in Markdown format
content_html (string, optional): Content in HTML format
content_jira (string, optional): Content in Jira Wiki Syntax
Note: Provide only ONE content format. If multiple are provided, the API will use contentMarkdown > contentHtml > contentJira in order of precedence.
Returns: Created announcement with ID, headline, state, and creation timestamp
Use Cases:
"Create a new announcement about the API update"
"Draft an announcement for the new feature launch"
"Create announcement with headline 'v2.0 Released'"
Error Handling:
Returns validation errors if required fields are missing
Returns "Project not found" if project ID doesn't exist
Returns "Authentication failed" if API token lacks permission
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The ID of the LaunchNotes project | |
| headline | Yes | The main headline/title of the announcement | |
| content_markdown | No | The full content/body of the announcement in Markdown format | |
| content_html | No | The full content/body of the announcement in HTML format | |
| content_jira | No | The full content/body of the announcement in Jira Wiki Syntax |
Implementation Reference
- src/announcements/tools.ts:238-287 (handler)Handler function that executes the tool: processes params, builds attributes from headline and content fields, calls createAnnouncement helper, handles GraphQL errors, returns success message with announcement details or error response.
async (params: CreateAnnouncementInput) => { try { const attributes: Record<string, unknown> = { headline: params.headline, }; if (params.content_markdown !== undefined) attributes.contentMarkdown = params.content_markdown; if (params.content_html !== undefined) attributes.contentHtml = params.content_html; if (params.content_jira !== undefined) attributes.contentJira = params.content_jira; const result = await createAnnouncement(client, params.project_id, attributes ); if ( result.createAnnouncement.errors && result.createAnnouncement.errors.length > 0 ) { const errorMessages = result.createAnnouncement.errors .map((err) => err.message) .join(", "); throw new Error(errorMessages); } const announcement = result.createAnnouncement.announcement; return { content: [ { type: "text", text: `✓ Successfully created announcement "${announcement?.headline}"\n\n**ID:** ${announcement?.id}\n**State:** ${announcement?.state}\n**Created:** ${announcement?.createdAt}\n\nThe announcement has been created as a draft. Use the publish or schedule tool to make it live.`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error creating announcement: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } } - src/announcements/schemas.ts:83-106 (schema)Zod schema defining input validation for the tool parameters: project_id (required), headline (required), optional content in markdown/html/jira formats.
export const CreateAnnouncementSchema = z .object({ project_id: z .string() .min(1, "Project ID is required") .describe("The ID of the LaunchNotes project"), headline: z .string() .min(1, "Headline is required") .describe("The main headline/title of the announcement"), content_markdown: z .string() .optional() .describe("The full content/body of the announcement in Markdown format"), content_html: z .string() .optional() .describe("The full content/body of the announcement in HTML format"), content_jira: z .string() .optional() .describe("The full content/body of the announcement in Jira Wiki Syntax"), }) .strict(); - src/announcements/tools.ts:203-288 (registration)MCP server tool registration: defines name, title, description, input schema, annotations, and references the handler function.
server.registerTool( "launchnotes_create_announcement", { title: "Create LaunchNotes Announcement", description: `Create a new draft announcement in a LaunchNotes project. The announcement will be created in draft state. Args: - project_id (string): The ID of the project - headline (string): The main headline/title (required) - content_markdown (string, optional): Content in Markdown format - content_html (string, optional): Content in HTML format - content_jira (string, optional): Content in Jira Wiki Syntax Note: Provide only ONE content format. If multiple are provided, the API will use contentMarkdown > contentHtml > contentJira in order of precedence. Returns: Created announcement with ID, headline, state, and creation timestamp Use Cases: - "Create a new announcement about the API update" - "Draft an announcement for the new feature launch" - "Create announcement with headline 'v2.0 Released'" Error Handling: - Returns validation errors if required fields are missing - Returns "Project not found" if project ID doesn't exist - Returns "Authentication failed" if API token lacks permission`, inputSchema: CreateAnnouncementSchema, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, }, async (params: CreateAnnouncementInput) => { try { const attributes: Record<string, unknown> = { headline: params.headline, }; if (params.content_markdown !== undefined) attributes.contentMarkdown = params.content_markdown; if (params.content_html !== undefined) attributes.contentHtml = params.content_html; if (params.content_jira !== undefined) attributes.contentJira = params.content_jira; const result = await createAnnouncement(client, params.project_id, attributes ); if ( result.createAnnouncement.errors && result.createAnnouncement.errors.length > 0 ) { const errorMessages = result.createAnnouncement.errors .map((err) => err.message) .join(", "); throw new Error(errorMessages); } const announcement = result.createAnnouncement.announcement; return { content: [ { type: "text", text: `✓ Successfully created announcement "${announcement?.headline}"\n\n**ID:** ${announcement?.id}\n**State:** ${announcement?.state}\n**Created:** ${announcement?.createdAt}\n\nThe announcement has been created as a draft. Use the publish or schedule tool to make it live.`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error creating announcement: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } } ); - src/announcements/queries.ts:208-234 (helper)Helper function that executes the GraphQL createAnnouncement mutation, building the input with projectId and attributes, returns the response with announcement or errors.
export async function createAnnouncement( client: GraphQLClient, projectId: string, attributes: Record<string, unknown> ): Promise<{ createAnnouncement: { announcement?: { id: string; headline: string; state: string; createdAt: string; }; errors?: Array<{ message: string; path?: string[]; }>; }; }> { return client.execute(CREATE_ANNOUNCEMENT_MUTATION, { input: { announcement: { projectId, ...attributes, }, }, }); }