get_notifications
Retrieve notifications from Backlog with optional filters by ID range, count, sort order, and organization.
Instructions
Returns list of notifications
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| minId | No | Minimum notification ID | |
| maxId | No | Maximum notification ID | |
| count | No | Number of notifications to retrieve | |
| order | No | Sort order | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/getNotifications.ts:28-51 (handler)The handler function that executes the 'get_notifications' tool logic. It calls backlog.getNotifications() with minId, maxId, count, order parameters.
export const getNotificationsTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getNotificationsSchema>, (typeof NotificationSchema)['shape'] > => { return { name: 'get_notifications', description: t( 'TOOL_GET_NOTIFICATIONS_DESCRIPTION', 'Returns list of notifications' ), schema: z.object(getNotificationsSchema(t)), outputSchema: NotificationSchema, handler: async ({ minId, maxId, count, order }) => backlog.getNotifications({ minId, maxId, count, order, }), }; }; - src/tools/getNotifications.ts:7-26 (schema)Input schema for get_notifications tool defining optional parameters: minId (number), maxId (number), count (number), order (enum 'asc'|'desc').
const getNotificationsSchema = buildToolSchema((t) => ({ minId: z .number() .optional() .describe(t('TOOL_GET_NOTIFICATIONS_MIN_ID', 'Minimum notification ID')), maxId: z .number() .optional() .describe(t('TOOL_GET_NOTIFICATIONS_MAX_ID', 'Maximum notification ID')), count: z .number() .optional() .describe( t('TOOL_GET_NOTIFICATIONS_COUNT', 'Number of notifications to retrieve') ), order: z .enum(['asc', 'desc']) .optional() .describe(t('TOOL_GET_NOTIFICATIONS_ORDER', 'Sort order')), })); - Output schema (NotificationSchema) for the get_notifications tool, defining the shape of returned notification objects including id, alreadyRead, reason, resourceAlreadyRead, project, issue, comment, pullRequest, pullRequestComment, sender, and created.
export const NotificationSchema = z.object({ id: z.number(), alreadyRead: z.boolean(), reason: z.number(), resourceAlreadyRead: z.boolean(), project: ProjectSchema.optional(), issue: IssueSchema.optional(), comment: IssueCommentSchema.optional(), pullRequest: PullRequestSchema.optional(), pullRequestComment: PullRequestCommentSchema.optional(), sender: UserSchema, created: z.string(), }); - src/tools/tools.ts:165-175 (registration)Registration of get_notifications tool in the 'notifications' toolset within allTools(). The toolset groups notification-related tools together.
{ 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:23-23 (registration)Import of getNotificationsTool from the getNotifications module, linking the tool definition to the tools registry.
import { getNotificationsTool } from './getNotifications.js';