Skip to main content
Glama
correaito
by correaito

Deletar Usuário

delete-user

Permanently remove a user from Clerk authentication service by ID. This action is irreversible.

Instructions

Deleta permanentemente um usuário do Clerk pelo ID. Esta ação é irreversível!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
messageNo
successYes

Implementation Reference

  • The core handler function that executes the delete-user tool logic by calling the Clerk API to permanently delete the user.
    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'
        };
      }
    }
  • Zod schema for input validation of the delete-user tool, requiring a non-empty userId string.
    export const deleteUserSchema = {
      userId: z.string().min(1)
    };
  • src/server.ts:64-83 (registration)
    Registration of the 'delete-user' tool in the MCP server (HTTP transport), linking schema, description, and handler wrapper.
    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
        };
      }
    );
  • Registration of the 'delete-user' tool in the MCP server (STDIO transport), identical to 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
        };
      }
    );

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other 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/correaito/mcp_clerk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server