Skip to main content
Glama

delete-user

Remove a user from your instance by specifying the client ID and user ID or email. Ideal for managing user access and maintaining system integrity in the MCP-N8N server.

Instructions

Delete a user from your instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idOrEmailYes

Implementation Reference

  • src/index.ts:603-614 (registration)
    Registration of the 'delete-user' tool in the listTools response, including its name, description, and input schema.
    {
      name: "delete-user",
      description: "Delete a user from your instance.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          idOrEmail: { type: "string" }
        },
        required: ["clientId", "idOrEmail"]
      }
    },
  • Main handler logic for executing the 'delete-user' tool, which validates the client, calls the N8nClient.deleteUser method, and returns success or error response.
    case "delete-user": {
      const { clientId, idOrEmail } = args as { clientId: string; idOrEmail: string };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        await client.deleteUser(idOrEmail);
        return {
          content: [{
            type: "text",
            text: `Successfully deleted user: ${idOrEmail}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
    }
  • Helper method in N8nClient class that performs the actual DELETE API request to delete a user by ID or email.
    async deleteUser(idOrEmail: string): Promise<void> {
      return this.makeRequest<void>(`/users/${idOrEmail}`, {
        method: 'DELETE',
      });
    }

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/fellipesaraiva88/n8n-mcp-server'

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