affine_read_notification
Mark a notification as read in AFFiNE workspaces by specifying its ID using the GraphQL API. Simplifies notification management for streamlined workspace operations.
Instructions
Mark a notification as read.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Notification ID |
Implementation Reference
- src/tools/notifications.ts:69-83 (handler)The handler function that executes the tool logic: marks a notification as read by sending a GraphQL mutation to the server.const readNotificationHandler = async ({ id }: { id: string }) => { try { const mutation = ` mutation ReadNotification($id: String!) { readNotification(id: $id) } `; const data = await gql.request<{ readNotification: boolean }>(mutation, { id }); return text({ success: data.readNotification, notificationId: id }); } catch (error: any) { return text({ error: error.message }); } };
- src/tools/notifications.ts:84-94 (registration)Tool registration call for 'affine_read_notification', including title, description, and input schema.server.registerTool( "affine_read_notification", { title: "Mark Notification Read", description: "Mark a notification as read.", inputSchema: { id: z.string().describe("Notification ID") } }, readNotificationHandler as any );
- src/tools/notifications.ts:89-92 (schema)Input schema definition for the tool, specifying the 'id' parameter as a string.inputSchema: { id: z.string().describe("Notification ID") } },