Clerk

Clerk

Official
clerk

Provides direct access to Clerk's user management system for retrieving, updating, and managing user data and authentication states.

1,673255 views439Local (stdio)

What it does

  • Get current authenticated user ID
  • Retrieve detailed user information by ID
  • Count total users in your application
  • Update user profile attributes
  • Manage user public metadata
  • Modify user unsafe metadata

Best for

Building user dashboards and admin panelsAutomating user management workflowsIntegrating with existing authentication systems
Direct API access to Clerk platformComprehensive user metadata management

Tools (6)

getUserId

Tool name: getUserId Description: Get the userId of the current authenticated user if signed in, otherwise return null. Use this tool when you need to identify the current user but don't need their profile details. This tool takes no parameters and is the quickest way to check if a user is authenticated. Example use case: When you need to verify if a user is logged in before performing user-specific operations. . Arguments: Takes no arguments

getUser

Tool name: getUser Description: Retrieves detailed information about a user by their userId, including email addresses, username, profile image, created/updated timestamps, and public metadata. Use this tool when you need comprehensive user information beyond just their ID. If the userId parameter is not provided, it will use the current authenticated user's ID. Example use case: When you need to display user profile information or check user attributes. . Arguments: - userId: (string): The userId of the User to retrieve.

getUserCount

Tool name: getUserCount Description: Retrieves the total count of users in your Clerk instance. Use this tool when you need to know the total number of users in the system. This tool takes no parameters and is an efficient way to get just the count without retrieving user details. . Arguments: Takes no arguments

updateUser

Tool name: updateUser Description: Updates an existing user's attributes in your Clerk instance. Use this tool when you need to modify core user information (NOT metadata). Important notes: 1. If the userId parameter is not provided, it will use the current authenticated user's ID 2. Only the provided fields will be updated, other fields remain unchanged 3. For updating metadata, use the specialized metadata update tools instead 4. Email and phone verification status cannot be changed with this tool Example use cases: 1. Updating a user's name, username, or other profile information 2. Enabling or disabling a user account 3. Setting a user's primary contact information . Arguments: - userId: (string): The userId of the User to update. - firstName: (string): New first name for the user - lastName: (string): New last name for the user - username: (string): New username for the user - profileImageUrl: (string): URL for the user profile image

updateUserPublicMetadata

Tool name: updateUserPublicMetadata Description: Updates the public metadata associated with a user by merging existing values with the provided parameters. Use this tool when you need to store or update user preferences, settings, or other non-sensitive information. Important characteristics: 1. A "deep" merge is performed - any nested JSON objects will be merged recursively. 2. You can remove metadata keys at any level by setting their value to null. 3. Public metadata is visible to the frontend and should NOT contain sensitive information. Example use case: Storing user preferences, feature flags, or application-specific data that persists across sessions. . Arguments: - userId: (string): The userId of the User to update. - metadata: (Record<string,any>): The public metadata to set or update. Use null values to remove specific keys.

Alternatives