mark_notification_as_read
Mark a specific notification as read using its ID to clear unread alerts in your Backlog account.
Instructions
Mark a notification as read
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Notification ID to mark as read | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- The main tool definition including the handler function that executes the tool logic. The handler calls backlog.markAsReadNotification(id) to mark a notification as read.
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`, }; }, }; }; - Input schema (markNotificationAsReadSchema) defining 'id' as a required number, and output schema (MarkNotificationAsReadResultSchema) defining 'success' boolean and '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/tools.ts:165-177 (registration)The tool is registered as part of the 'notifications' toolset in the tools.ts registration file. It's instantiated at line 173 (markNotificationAsReadTool(backlog, helper)).
{ name: 'notifications', description: 'Tools for managing user notifications.', enabled: false, tools: [ getNotificationsTool(backlog, helper), getNotificationsCountTool(backlog, helper), resetUnreadNotificationCountTool(backlog, helper), markNotificationAsReadTool(backlog, helper), ], }, ], }; - src/tools/tools.ts:47-47 (registration)Import statement for markNotificationAsReadTool in the tools.ts registration file.
import { markNotificationAsReadTool } from './markNotificationAsRead.js'; - src/types/tool.ts:24-27 (helper)The buildToolSchema helper function used to define the tool's input schema with translation support.
export const buildToolSchema = <T extends z.ZodRawShape>( fn: (t: TranslationHelper['t']) => T ) => fn;