Skip to main content
Glama
correaito
by correaito

Bloquear Usuário

lock-user

Prevent a user from logging into Clerk authentication service by locking their account using their user ID.

Instructions

Bloqueia um usuário do Clerk, impedindo que ele faça login

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
messageNo
successYes

Implementation Reference

  • Core handler function implementing the lock-user tool logic using Clerk API.
    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'
        };
      }
    }
  • Input schema validation for the lock-user tool.
    export const lockUserSchema = {
      userId: z.string().min(1)
    };
  • src/server.ts:86-105 (registration)
    Registration of the lock-user tool in the HTTP MCP server.
    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
        };
      }
    );
  • Registration of the lock-user tool in the STDIO MCP server.
    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
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action (blocks user, prevents login) which implies a destructive/mutative operation, but doesn't disclose important behavioral traits like whether this is reversible, what permissions are required, if it affects existing sessions, or what the response looks like. For a mutation tool with zero annotation coverage, this is insufficient.

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 a single, efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information.

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

Completeness3/5

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

Given this is a mutation tool with no annotations but with an output schema (which handles return values), the description provides the basic purpose but lacks important context about behavioral implications, permissions, and reversibility. It's minimally adequate but has clear gaps for a tool that modifies user access.

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?

With 0% schema description coverage and only 1 parameter, the description doesn't explicitly mention the 'userId' parameter. However, the context ('um usuário do Clerk') implies what needs to be identified. For a single-parameter tool, this provides adequate semantic context despite not naming the parameter directly.

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 specific action ('Bloqueia' - blocks) and resource ('um usuário do Clerk'), and distinguishes it from sibling tools like 'unlock-user' by specifying it prevents login. It goes beyond just restating the name/title by explaining the functional outcome.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (when you need to prevent a user from logging in), but doesn't explicitly state when to use this vs alternatives like 'delete-user' or 'unlock-user'. It provides clear functional intent but lacks explicit comparative guidance.

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