Skip to main content
Glama

Change Password

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")
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the token requirement, which is useful context, but fails to describe critical behavioral aspects: whether this action is destructive (it likely changes authentication state), what permissions are needed, whether it affects user sessions, or what the response looks like. For a security-sensitive mutation tool, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single sentence that efficiently conveys the core purpose and a key constraint. Every word earns its place, with no redundant information. The structure is front-loaded with the main action, followed by the essential prerequisite.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a password change operation (a security-critical mutation), the absence of annotations and output schema, and the description's brevity, this is incomplete. It lacks details on behavioral impact, error conditions, success responses, and security implications. For such a tool, more context is needed to ensure safe and correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all three parameters clearly documented in the schema itself. The description adds minimal value beyond the schema by implying the token's origin ('from email'), but doesn't provide additional context about parameter relationships, validation rules, or security considerations. The baseline score of 3 reflects adequate but not enhanced parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Change user password') and the resource ('password'), making the purpose immediately understandable. It distinguishes from siblings like 'affine_sign_in' or 'affine_update_profile' by focusing specifically on password modification. However, it doesn't specify whether this is for the current user or another user, which could be clarified.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context by mentioning 'requires token from email', which implies this is for password reset scenarios rather than routine password changes. However, it doesn't explicitly state when to use this versus alternatives like 'affine_sign_in' for authentication or 'affine_update_profile' for other user updates, nor does it mention prerequisites beyond the token requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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