affine_send_password_reset
Initiate password reset requests by sending a reset email with a callback URL to users of AFFiNE workspaces, ensuring secure account recovery.
Instructions
Send password reset email.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| callbackUrl | No | Callback URL for password reset |
Implementation Reference
- src/tools/userCRUD.ts:187-204 (handler)The handler function that implements the logic for sending a password reset email using a GraphQL mutation.// SEND PASSWORD RESET EMAIL const sendPasswordResetHandler = async ({ callbackUrl }: { callbackUrl?: string }) => { try { const mutation = ` mutation SendChangePasswordEmail($callbackUrl: String!) { sendChangePasswordEmail(callbackUrl: $callbackUrl) } `; const data = await gql.request<{ sendChangePasswordEmail: boolean }>(mutation, { callbackUrl: callbackUrl || `${process.env.AFFINE_BASE_URL}/reset-password` }); return text({ success: data.sendChangePasswordEmail, message: "Password reset email sent" }); } catch (error: any) { return text({ error: error.message }); } };
- src/tools/userCRUD.ts:205-215 (registration)Registration of the 'affine_send_password_reset' tool with the MCP server, including input schema definition.server.registerTool( "affine_send_password_reset", { title: "Send Password Reset", description: "Send password reset email.", inputSchema: { callbackUrl: z.string().optional().describe("Callback URL for password reset") } }, sendPasswordResetHandler as any );
- src/tools/userCRUD.ts:211-212 (schema)Zod input schema for the tool's 'callbackUrl' parameter.callbackUrl: z.string().optional().describe("Callback URL for password reset") }