affine_read_all_notifications
Clear all notification alerts in AFFiNE workspaces using the MCP server’s GraphQL API, ensuring an organized and focused user experience for managing documents and tasks.
Instructions
Mark all notifications as read.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/notifications.ts:108-122 (handler)The async handler function `readAllNotificationsHandler` that sends a GraphQL mutation to mark all notifications as read and returns success or error via the `text` helper.const readAllNotificationsHandler = async () => { try { const mutation = ` mutation ReadAllNotifications { readAllNotifications } `; const data = await gql.request<{ readAllNotifications: boolean }>(mutation); return text({ success: data.readAllNotifications, message: "All notifications marked as read" }); } catch (error: any) { return text({ error: error.message }); } };
- src/tools/notifications.ts:123-131 (registration)Registration of the tool 'affine_read_all_notifications' using `server.registerTool`, including title, description, empty input schema, and reference to the handler.server.registerTool( "affine_read_all_notifications", { title: "Mark All Notifications Read", description: "Mark all notifications as read.", inputSchema: {} }, readAllNotificationsHandler as any );
- src/tools/notifications.ts:125-129 (schema)Tool metadata and input schema definition (empty, no parameters required). Note: output uses the shared `text` helper from util/mcp.js.{ title: "Mark All Notifications Read", description: "Mark all notifications as read.", inputSchema: {} },