count_notifications
Count unread notifications in Backlog to track project updates and manage workflow visibility.
Instructions
Returns count of notifications
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alreadyRead | Yes | Whether to include already read notifications | |
| resourceAlreadyRead | Yes | Whether to include notifications for already read resources |
Implementation Reference
- src/tools/getNotificationsCount.ts:26-43 (handler)Exports the getNotificationsCountTool function which defines the 'count_notifications' tool, including name, description, input schema, output schema reference, and handler that delegates to backlog.getNotificationsCount(params).export const getNotificationsCountTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getNotificationsCountSchema>, (typeof NotificationCountSchema)['shape'] > => { return { name: 'count_notifications', description: t( 'TOOL_COUNT_NOTIFICATIONS_DESCRIPTION', 'Returns count of notifications' ), schema: z.object(getNotificationsCountSchema(t)), outputSchema: NotificationCountSchema, handler: async (params) => backlog.getNotificationsCount(params), }; };
- src/tools/tools.ts:157-167 (registration)Registers the count_notifications tool (via getNotificationsCountTool) as part of the 'notifications' toolset in the allTools export.{ name: 'notifications', description: 'Tools for managing user notifications.', enabled: false, tools: [ getNotificationsTool(backlog, helper), getNotificationsCountTool(backlog, helper), resetUnreadNotificationCountTool(backlog, helper), markNotificationAsReadTool(backlog, helper), ], },
- Defines the input schema for the count_notifications tool with optional boolean parameters alreadyRead and resourceAlreadyRead.const getNotificationsCountSchema = buildToolSchema((t) => ({ alreadyRead: z .boolean() .describe( t( 'TOOL_GET_NOTIFICATIONS_COUNT_ALREADY_READ', 'Whether to include already read notifications' ) ), resourceAlreadyRead: z .boolean() .describe( t( 'TOOL_GET_NOTIFICATIONS_COUNT_RESOURCE_ALREADY_READ', 'Whether to include notifications for already read resources' ) ), }));
- Defines the Zod output schema for the notification count response, an object containing a 'count' number field.export const NotificationCountSchema = z.object({ count: z.number(), });