lock-user
Prevent user access by locking Clerk authentication accounts to block login attempts and secure your application.
Instructions
Bloqueia um usuário do Clerk, impedindo que ele faça login
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes |
Implementation Reference
- src/clerk-tools.ts:95-111 (handler)Core handler function that locks a Clerk user by ID using the Clerk backend API, handling errors and returning success/error response.export async function lockUser(params: { userId: string }) { try { const { userId } = params; await clerk.users.lockUser(userId); return { success: true, message: `Usuário ${userId} bloqueado com sucesso` }; } catch (error: any) { return { success: false, error: error.message || 'Erro ao bloquear usuário' }; } }
- src/clerk-tools.ts:27-29 (schema)Zod input schema for the lock-user tool, validating the required userId parameter.export const lockUserSchema = { userId: z.string().min(1) };
- src/server.ts:86-105 (registration)MCP server registration of the 'lock-user' tool, including schema, description, and wrapper handler that calls the core lockUser function.server.registerTool( 'lock-user', { title: 'Bloquear Usuário', description: 'Bloqueia um usuário do Clerk, impedindo que ele faça login', inputSchema: lockUserSchema, outputSchema: { success: z.boolean(), message: z.string().optional(), error: z.string().optional() } }, async (params) => { const result = await lockUser(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], structuredContent: result }; } );