Skip to main content
Glama
kapilduraphe

Okta MCP Server

delete_user

Remove a user from Okta by specifying the user ID. The user must be deactivated before deletion. Part of the Okta MCP Server for user management.

Instructions

Delete a user from Okta (must be deactivated first)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesThe unique identifier of the Okta user

Implementation Reference

  • The main handler function for the 'delete_user' tool. It parses the input using the Zod schema, calls the Okta API to delete the user by ID, and returns a success or error message.
    delete_user: async (request: { parameters: unknown }) => {
      const { userId } = userSchemas.deleteUser.parse(request.parameters);
    
      try {
        const oktaClient = getOktaClient();
    
        await oktaClient.userApi.deleteUser({
          userId,
        });
    
        return {
          content: [
            {
              type: "text",
              text: `User with ID ${userId} has been permanently deleted.`,
            },
          ],
        };
      } catch (error) {
        console.error("Error deleting user:", error);
        return {
          content: [
            {
              type: "text",
              text: `Failed to delete user: ${error instanceof Error ? error.message : String(error)}. Note: Users must be deactivated before they can be deleted.`,
            },
          ],
          isError: true,
        };
      }
    },
  • Tool registration entry in the userTools array, defining the name, description, and input schema for the 'delete_user' tool.
    {
      name: "delete_user",
      description: "Delete a user from Okta (must be deactivated first)",
      inputSchema: {
        type: "object",
        properties: {
          userId: {
            type: "string",
            description: "The unique identifier of the Okta user",
          },
        },
        required: ["userId"],
      },
    },
  • Zod schema definition for validating 'delete_user' input parameters, used in the handler for parsing.
    deleteUser: z.object({
      userId: z.string().min(1, "User ID is required"),
    }),
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses the prerequisite (deactivation first) but doesn't mention critical behavioral traits such as whether this operation is irreversible, what permissions are required, if it affects associated data (e.g., groups, applications), or what the response looks like. For a destructive mutation tool with zero annotation coverage, this is a significant gap.

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 with zero waste—it states the action, resource, and key prerequisite concisely. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 the tool's complexity (a destructive mutation with no annotations and no output schema), the description is minimally adequate. It covers the purpose and a critical prerequisite but lacks details on behavioral outcomes, error handling, or return values. For a high-stakes operation like user deletion, more context would be beneficial to ensure safe usage.

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?

Schema description coverage is 100% (the 'userId' parameter is fully documented in the schema), so the baseline is 3. The description doesn't add any parameter-specific information beyond what's in the schema, such as format examples or constraints, but it doesn't need to since the schema already covers it adequately.

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 ('Delete') and resource ('a user from Okta'), distinguishing it from sibling tools like 'deactivate_user' or 'remove_user_from_group'. It explicitly mentions the target system (Okta) and the resource type (user), providing unambiguous purpose.

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 provides clear context with the prerequisite 'must be deactivated first', which is essential guidance for correct usage. However, it doesn't explicitly mention when to use alternatives like 'deactivate_user' (for temporary removal) or 'suspend_user' (for temporary suspension), though the prerequisite implies a workflow relationship with 'deactivate_user'.

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

Related 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/kapilduraphe/okta-mcp-server'

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