delete-user
Permanently remove a user from Clerk authentication service by user ID. This action cannot be reversed.
Instructions
Deleta permanentemente um usuário do Clerk pelo ID. Esta ação é irreversível!
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes |
Implementation Reference
- src/clerk-tools.ts:76-92 (handler)Core handler function that executes the delete-user tool logic by calling the Clerk API to permanently delete the user by ID.export async function deleteUser(params: { userId: string }) { try { const { userId } = params; await clerk.users.deleteUser(userId); return { success: true, message: `Usuário ${userId} deletado com sucesso` }; } catch (error: any) { return { success: false, error: error.message || 'Erro ao deletar usuário' }; } }
- src/clerk-tools.ts:22-24 (schema)Input schema validation for the delete-user tool, defining the required userId parameter.export const deleteUserSchema = { userId: z.string().min(1) };
- src/server.ts:64-83 (registration)Registration of the delete-user tool in the HTTP MCP server, including input/output schemas and thin wrapper handler.server.registerTool( 'delete-user', { title: 'Deletar Usuário', description: 'Deleta permanentemente um usuário do Clerk pelo ID. Esta ação é irreversível!', inputSchema: deleteUserSchema, outputSchema: { success: z.boolean(), message: z.string().optional(), error: z.string().optional() } }, async (params) => { const result = await deleteUser(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], structuredContent: result }; } );
- src/server-stdio.ts:63-82 (registration)Registration of the delete-user tool in the STDIO MCP server, identical to the HTTP version.server.registerTool( 'delete-user', { title: 'Deletar Usuário', description: 'Deleta permanentemente um usuário do Clerk pelo ID. Esta ação é irreversível!', inputSchema: deleteUserSchema, outputSchema: { success: z.boolean(), message: z.string().optional(), error: z.string().optional() } }, async (params) => { const result = await deleteUser(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], structuredContent: result }; } );