mark_watching_as_read
Mark a specified watch as read in Backlog to clear unread notifications for a tracked item.
Instructions
Mark a watch as read
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| watchId | Yes | Watch ID to mark as read | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/markWatchingAsRead.ts:19-42 (handler)The handler function for the 'mark_watching_as_read' tool. It takes a watchId, calls backlog.resetWatchingListItemAsRead(watchId), and returns success/ message.
export const markWatchingAsReadTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof markWatchingAsReadSchema>, (typeof MarkWatchingAsReadResultSchema)['shape'] > => { return { name: 'mark_watching_as_read', description: t( 'TOOL_MARK_WATCHING_AS_READ_DESCRIPTION', 'Mark a watch as read' ), schema: z.object(markWatchingAsReadSchema(t)), outputSchema: MarkWatchingAsReadResultSchema, handler: async ({ watchId }) => { await backlog.resetWatchingListItemAsRead(watchId); return { success: true, message: `Watch ${watchId} marked as read`, }; }, }; }; - src/tools/markWatchingAsRead.ts:6-12 (schema)Input schema using buildToolSchema, defining 'watchId' as a required number.
const markWatchingAsReadSchema = buildToolSchema((t) => ({ watchId: z .number() .describe( t('TOOL_MARK_WATCHING_AS_READ_WATCH_ID', 'Watch ID to mark as read') ), })); - Output schema (MarkWatchingAsReadResultSchema): success boolean and message string.
export const MarkWatchingAsReadResultSchema = z.object({ success: z.boolean(), message: z.string(), }); - src/tools/tools.ts:43-43 (registration)Import of the markWatchingAsReadTool from its definition file.
import { markWatchingAsReadTool } from './markWatchingAsRead.js'; - src/tools/tools.ts:118-118 (registration)Registration of markWatchingAsReadTool in the 'issue' toolset.
markWatchingAsReadTool(backlog, helper),