affine_delete_account
Permanently delete a user account from the AFFiNE MCP Server. Requires explicit confirmation to ensure irreversible action. Use to remove user data and access securely.
Instructions
Permanently delete user account. WARNING: This cannot be undone!
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | Yes | Must be true to confirm account deletion |
Implementation Reference
- src/tools/userCRUD.ts:229-247 (handler)The deleteAccountHandler function implements the core logic for deleting the user account. It requires confirmation, sends a GraphQL mutation to deleteAccount, and returns success or error.const deleteAccountHandler = async ({ confirm }: { confirm: true }) => { if (!confirm) { return text({ error: "Confirmation required. Set confirm: true to delete account." }); } try { const mutation = ` mutation DeleteAccount { deleteAccount } `; const data = await gql.request<{ deleteAccount: boolean }>(mutation); return text({ success: data.deleteAccount, message: "Account deleted successfully" }); } catch (error: any) { return text({ error: error.message }); } };
- src/tools/userCRUD.ts:248-258 (registration)Registers the 'affine_delete_account' tool with the MCP server, including title, description, input schema, and the handler function.server.registerTool( "affine_delete_account", { title: "Delete Account", description: "Permanently delete user account. WARNING: This cannot be undone!", inputSchema: { confirm: z.literal(true).describe("Must be true to confirm account deletion") } }, deleteAccountHandler as any );
- src/tools/userCRUD.ts:253-255 (schema)Zod input schema for the tool, requiring a literal true value for confirmation.inputSchema: { confirm: z.literal(true).describe("Must be true to confirm account deletion") }