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
        };
      }
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses critical behavioral traits: the action is permanent and irreversible, which is essential for a destructive operation. However, it doesn't mention authentication requirements, rate limits, or what happens to associated data, leaving some 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 two sentences, front-loaded with the core action and followed by a critical warning. Every word earns its place, with no redundancy or unnecessary details, making it highly efficient and well-structured.

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

Completeness4/5

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

Given the tool's complexity (destructive operation), no annotations, and an output schema present, the description is mostly complete. It covers the irreversible nature but lacks details on permissions, error handling, or output format. The output schema reduces the need to explain return values, but more behavioral context would help.

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

Parameters4/5

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

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It adds meaning by specifying that the parameter is the user ID for deletion, though it doesn't detail format or constraints. Since there's only one parameter, the baseline is high, and the description provides adequate context.

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

Purpose5/5

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

The description clearly states the action ('deleta permanentemente') and the resource ('um usuário do Clerk'), specifying it's done by ID. It distinguishes from siblings like list-users, lock-user, and unlock-user by focusing on permanent deletion rather than listing or state changes.

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 implies usage when permanent deletion is needed, but doesn't explicitly state when to use this tool versus alternatives like lock-user for temporary deactivation or list-users for checking users first. No explicit exclusions or prerequisites are mentioned.

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

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