File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ defmodule Core.MCP.Server do
1111 SetupTrial ,
1212 ListPlans ,
1313 ModifyProPlan ,
14- AddDomainMapping
14+ AddDomainMapping ,
15+ DeleteUser
1516 }
1617
1718 @ tools [
@@ -25,7 +26,8 @@ defmodule Core.MCP.Server do
2526 SetupTrial ,
2627 ListPlans ,
2728 ModifyProPlan ,
28- AddDomainMapping
29+ AddDomainMapping ,
30+ DeleteUser
2931 ]
3032 @ by_name Map . new ( @ tools , & { & 1 . name ( ) , & 1 } )
3133
Original file line number Diff line number Diff line change 1+ defmodule Core.MCP.Tools.DeleteUser do
2+ @ behaviour Core.MCP.Tool
3+ import Core.MCP.Tools.Utils
4+ alias Core.Services.Accounts
5+
6+ def name ( ) , do: "delete_user"
7+
8+ def description ( ) , do: "Deletes a user from Plural and leaves other account details intact"
9+
10+ def schema ( ) , do: % {
11+ type: "object" ,
12+ required: [ "email" ] ,
13+ properties: % {
14+ account_id: % {
15+ type: "string" ,
16+ description: "The email of the user you want to delete"
17+ }
18+ }
19+ }
20+
21+ def invoke ( % { "email" => email } ) do
22+ case Accounts . delete_user ( email ) do
23+ { :ok , _ } -> { :ok , "user deleted" }
24+ { :error , _ } -> { :error , "failed to delete user" }
25+ end
26+ end
27+ def invoke ( _ ) , do: { :error , "email is required" }
28+ end
You can’t perform that action at this time.
0 commit comments