mark_notification_as_read
Mark notifications as read in Backlog to clear alerts and update your notification status.
Instructions
Mark a notification as read
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Notification ID to mark as read |
Implementation Reference
- The handler function that executes the tool logic: marks the notification as read using the Backlog client and returns a success message.handler: async ({ id }) => { await backlog.markAsReadNotification(id); return { success: true, message: `Notification ${id} marked as read`, }; },
- Input schema (notification id: number) and output schema (success: boolean, message: string).const markNotificationAsReadSchema = buildToolSchema((t) => ({ id: z .number() .describe( t('TOOL_MARK_NOTIFICATION_AS_READ_ID', 'Notification ID to mark as read') ), })); export const MarkNotificationAsReadResultSchema = z.object({ success: z.boolean(), message: z.string(), });
- src/tools/markNotificationAsRead.ts:19-42 (registration)Factory function exporting the tool definition with name, description, schemas, and handler.export const markNotificationAsReadTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof markNotificationAsReadSchema>, (typeof MarkNotificationAsReadResultSchema)['shape'] > => { return { name: 'mark_notification_as_read', description: t( 'TOOL_MARK_NOTIFICATION_AS_READ_DESCRIPTION', 'Mark a notification as read' ), schema: z.object(markNotificationAsReadSchema(t)), outputSchema: MarkNotificationAsReadResultSchema, handler: async ({ id }) => { await backlog.markAsReadNotification(id); return { success: true, message: `Notification ${id} marked as read`, }; }, }; };
- src/tools/tools.ts:157-167 (registration)Registration of the tool within the 'notifications' toolset group in the main tools export.{ name: 'notifications', description: 'Tools for managing user notifications.', enabled: false, tools: [ getNotificationsTool(backlog, helper), getNotificationsCountTool(backlog, helper), resetUnreadNotificationCountTool(backlog, helper), markNotificationAsReadTool(backlog, helper), ], },