Skip to main content
Glama
kapilduraphe

Okta MCP Server

create_group

Create a new group in Okta's user management system by specifying a group name and optional description to organize and manage users efficiently.

Instructions

Create a new group in Okta

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the group (optional)
nameYesName of the group

Implementation Reference

  • The primary handler function for the 'create_group' tool. It validates input using Zod schema, constructs the group profile, calls the Okta API to create the group, formats the response, and handles errors.
      create_group: async (request: { parameters: unknown }) => {
        const { name, description } = groupSchemas.createGroup.parse(
          request.parameters
        );
    
        try {
          const oktaClient = getOktaClient();
    
          const newGroup = {
            profile: {
              name,
              description: description || "",
            },
          };
    
          const group = await oktaClient.groupApi.createGroup({
            group: newGroup,
          });
    
          return {
            content: [
              {
                type: "text",
                text: `Group created successfully:
    ID: ${group.id}
    Name: ${group.profile?.name}
    Type: ${group.type || "OKTA_GROUP"}
    Created: ${formatDate(group.created)}`,
              },
            ],
          };
        } catch (error) {
          console.error("Error creating group:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to create group: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      },
  • Zod schema definition for validating the input parameters (name and optional description) of the create_group tool.
    createGroup: z.object({
      name: z.string().min(1, "Group name is required"),
      description: z.string().optional(),
    }),
  • Tool registration entry in the groupTools array, which defines the tool's name, description, and JSON input schema for MCP protocol compliance. This array is exported and combined in src/tools/index.ts.
    {
      name: "create_group",
      description: "Create a new group in Okta",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the group",
          },
          description: {
            type: "string",
            description: "Description of the group (optional)",
          },
        },
        required: ["name"],
      },
    },
  • src/tools/index.ts:6-6 (registration)
    Central registration where groupTools (including create_group) is spread into the main TOOLS export for the MCP server.
    export const TOOLS = [...userTools, ...groupTools, ...onboardingTools];
  • Utility function to initialize and return the OktaClient instance, used by the create_group handler to interact with the Okta API.
    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 the full burden of behavioral disclosure. It states the tool creates a group but lacks details on permissions required, whether the operation is idempotent, what happens on conflicts (e.g., duplicate names), or the response format. This is a significant gap for a mutation tool without annotation coverage.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the complexity of a group creation tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like permissions, idempotency, or error handling, nor does it explain what the tool returns. This leaves gaps for an AI agent to understand the tool fully.

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%, so the input schema fully documents both parameters (name and description). The description adds no additional meaning beyond what's in the schema, such as format constraints or examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Create') and resource ('new group in Okta'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'assign_users_to_groups' or 'list_groups' beyond the basic verb, missing specific distinctions about scope or constraints.

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 (e.g., permissions needed), when not to use it (e.g., for updating existing groups), or refer to sibling tools like 'delete_group' or 'list_groups' for context, leaving usage entirely implicit.

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