Skip to main content
Glama
kapilduraphe

Okta MCP Server

delete_group

Remove a group in Okta by specifying its unique group ID. This tool is part of the Okta MCP Server, enabling efficient group management within the system.

Instructions

Delete a group from Okta

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesID of the group to delete

Implementation Reference

  • The asynchronous handler function for the 'delete_group' tool. It validates input using Zod, calls the Okta API to delete the specified group, and returns a formatted success or error response.
    delete_group: async (request: { parameters: unknown }) => {
      const { groupId } = groupSchemas.deleteGroup.parse(request.parameters);
    
      try {
        const oktaClient = getOktaClient();
    
        await oktaClient.groupApi.deleteGroup({
          groupId,
        });
    
        return {
          content: [
            {
              type: "text",
              text: `Group with ID ${groupId} has been successfully deleted.`,
            },
          ],
        };
      } catch (error) {
        console.error("Error deleting group:", error);
        return {
          content: [
            {
              type: "text",
              text: `Failed to delete group: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    },
  • The registration of the 'delete_group' tool in the exported groupTools array, including name, description, and JSON input schema.
    {
      name: "delete_group",
      description: "Delete a group from Okta",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "ID of the group to delete",
          },
        },
        required: ["groupId"],
      },
    },
  • Zod schema for input validation of the delete_group tool parameters, ensuring groupId is a non-empty string.
    deleteGroup: z.object({
      groupId: z.string().min(1, "Group ID is required"),
    }),
  • Utility function to initialize and return the OktaClient instance, used by the delete_group handler and other group tools.
    function getOktaClient() {
      const oktaDomain = process.env.OKTA_ORG_URL;
      const apiToken = process.env.OKTA_API_TOKEN;
    
      if (!oktaDomain) {
        throw new Error(
          "OKTA_ORG_URL environment variable is not set. Please set it to your Okta domain."
        );
      }
    
      if (!apiToken) {
        throw new Error(
          "OKTA_API_TOKEN environment variable is not set. Please generate an API token in the Okta Admin Console."
        );
      }
    
      return new OktaClient({
        orgUrl: oktaDomain,
        token: apiToken,
      });
    }
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. While 'Delete' implies a destructive operation, it doesn't specify whether this is permanent or reversible, what permissions are required, whether it cascades to group memberships, or what happens on success/failure. This leaves significant behavioral gaps for a destructive operation.

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 extremely concise - a single sentence with no wasted words. It's front-loaded with the core action and resource, making it immediately understandable despite its brevity.

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

Completeness2/5

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

For a destructive operation with no annotations and no output schema, the description is insufficient. It doesn't explain what 'delete' means in this context (permanent removal?), what the response looks like, error conditions, or dependencies on other tools. Given the complexity and risk of group deletion, more context is needed.

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 input schema has 100% description coverage, with the single parameter 'groupId' clearly documented. The description doesn't add any parameter semantics beyond what the schema provides, but with complete schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target resource ('a group from Okta'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'delete_user' or specify what type of group deletion this performs (permanent vs soft).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like needing group ID from 'list_groups' or 'get_group'), consequences of deletion, or when to choose other tools like 'remove_user_from_group' for different operations.

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