Skip to main content
Glama

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
NameRequiredDescriptionDefault
callbackUrlNoCallback URL for password reset

Implementation Reference

  • 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 });
      }
    };
  • 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
    );
  • Zod input schema for the tool's 'callbackUrl' parameter.
      callbackUrl: z.string().optional().describe("Callback URL for password reset")
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DAWNCR0W/affine-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server