Skip to main content
Glama

delete_user

Destructive

Permanently delete a user from the org by ID, removing all memberships, revoking API keys, and ending active sessions.

Instructions

Delete a user from the org by id. This is permanent, removes org and workspace memberships, revokes API keys, and ends active sessions; use delete_user_invite for pending invites instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe user ID to delete

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Implementation Reference

  • Registration of the 'delete_user' tool on the MCP server with schema reference and handler callback.
    // Phase 1: Delete user tool
    server.tool(
    	"delete_user",
    	"Delete a user from the org by id. This is permanent, removes org and workspace memberships, revokes API keys, and ends active sessions; use delete_user_invite for pending invites instead.",
    	USERS_TOOL_SCHEMAS.deleteUser,
    	async (params) => {
    		await service.users.deleteUser(params.user_id);
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							message: `Successfully deleted user ${params.user_id}`,
    							success: true,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	},
    );
  • Handler function for delete_user that calls service.users.deleteUser() and returns a success message.
    async (params) => {
    	await service.users.deleteUser(params.user_id);
    	return {
    		content: [
    			{
    				type: "text",
    				text: JSON.stringify(
    					{
    						message: `Successfully deleted user ${params.user_id}`,
    						success: true,
    					},
    					null,
    					2,
    				),
    			},
    		],
    	};
    },
  • Input schema for delete_user: expects a user_id string.
    deleteUser: {
    	user_id: z.string().describe("The user ID to delete"),
    },
  • Service layer deleteUser method that sends a DELETE request to /admin/users/{userId} and returns success.
    async deleteUser(userId: string): Promise<{ success: boolean }> {
    	await this.delete(`/admin/users/${this.encodePathSegment(userId)}`);
    	return { success: true };
    }
Behavior5/5

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

Beyond the annotations (destructiveHint=true), the description details the permanent nature of deletion and its consequences: removes memberships, revokes keys, ends sessions. This provides comprehensive behavioral context.

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: the first delivers the core purpose and effects, the second provides an alternative. It is concise and front-loaded with essential information, with no wasted words.

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

Completeness5/5

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

For a simple delete tool with one parameter, the description covers purpose, behavioral effects, and an alternative. The output schema exists but does not require additional description. The tool is fully specified.

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

Parameters3/5

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

The schema covers the single parameter 'user_id' with a description. The tool description does not add additional semantics beyond the schema. Since schema coverage is 100%, the baseline of 3 is appropriate.

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 verb 'delete', the resource 'user', and the method 'by id'. It differentiates from the sibling tool 'delete_user_invite' by specifying that tool is for pending invites. The scope of deletion is thoroughly explained.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool (to delete a user by ID) and provides a direct alternative for a specific case ('use delete_user_invite for pending invites instead'). This is clear 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/s-b-e-n-s-o-n/portkey-admin-mcp'

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