Skip to main content
Glama

affine_change_password

Update user password securely using a reset token received via email. Provide the token, user ID, and new password to complete the process.

Instructions

Change user password (requires token from email).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newPasswordYesNew password
tokenYesPassword reset token from email
userIdNoUser ID

Implementation Reference

  • The asynchronous handler function that performs the GraphQL mutation to change the user's password using a reset token and new password.
    const changePasswordHandler = async ({ token, newPassword, userId }: { token: string; newPassword: string; userId?: string }) => { try { const mutation = ` mutation ChangePassword($token: String!, $newPassword: String!, $userId: String) { changePassword(token: $token, newPassword: $newPassword, userId: $userId) } `; const data = await gql.request<{ changePassword: boolean }>(mutation, { token, newPassword, userId }); return text({ success: data.changePassword, message: "Password changed successfully" }); } catch (error: any) { return text({ error: error.message }); } };
  • Registration of the 'affine_change_password' tool using server.registerTool, including title, description, Zod input schema, and handler reference.
    server.registerTool( "affine_change_password", { title: "Change Password", description: "Change user password (requires token from email).", inputSchema: { token: z.string().describe("Password reset token from email"), newPassword: z.string().describe("New password"), userId: z.string().optional().describe("User ID") } }, changePasswordHandler as any );
  • Input schema definition using Zod for the tool's parameters: token, newPassword, and optional userId.
    { title: "Change Password", description: "Change user password (requires token from email).", inputSchema: { token: z.string().describe("Password reset token from email"), newPassword: z.string().describe("New password"), userId: z.string().optional().describe("User ID") }

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