Skip to main content
Glama
kapilduraphe

Okta MCP Server

assign_user_to_group

Assign a specific user to a designated group within Okta’s user management system to streamline access and permissions.

Instructions

Assign a user to a group in Okta

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesID of the group
userIdYesID of the user to assign to the group

Implementation Reference

  • The handler function for the 'assign_user_to_group' tool. It validates input parameters using Zod schema, retrieves Okta client, calls the Okta API to assign the user to the group, and returns a success or error response.
    assign_user_to_group: async (request: { parameters: unknown }) => {
      const { groupId, userId } = groupSchemas.assignUserToGroup.parse(
        request.parameters
      );
    
      try {
        const oktaClient = getOktaClient();
    
        await oktaClient.groupApi.assignUserToGroup({
          groupId,
          userId,
        });
    
        return {
          content: [
            {
              type: "text",
              text: `User with ID ${userId} has been successfully assigned to group with ID ${groupId}.`,
            },
          ],
        };
      } catch (error) {
        console.error("Error assigning user to group:", error);
        return {
          content: [
            {
              type: "text",
              text: `Failed to assign user to group: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    },
  • The tool registration object defining the name, description, and input schema, included in the exported groupTools array which is spread into the main TOOLS export in index.ts.
    {
      name: "assign_user_to_group",
      description: "Assign a user to a group in Okta",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "ID of the group",
          },
          userId: {
            type: "string",
            description: "ID of the user to assign to the group",
          },
        },
        required: ["groupId", "userId"],
      },
    },
  • Zod schema for validating the input parameters (groupId and userId) used in the handler function.
    assignUserToGroup: z.object({
      groupId: z.string().min(1, "Group ID is required"),
      userId: z.string().min(1, "User ID is required"),
    }),
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 action but does not cover critical aspects such as permissions required, whether the assignment is idempotent, error handling (e.g., if user/group doesn't exist), or the response format. This leaves significant gaps for a mutation tool.

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 is front-loaded and wastes no space, 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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It fails to address behavioral traits (e.g., side effects, error conditions) or provide usage context, which is essential given the tool's role in modifying system state and the presence of similar sibling tools.

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, clearly documenting both parameters ('groupId' and 'userId') with their types and purposes. The description adds no additional parameter semantics beyond what the schema provides, so the baseline score of 3 is appropriate as 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 ('Assign') and the resources involved ('a user to a group in Okta'), making the purpose immediately understandable. However, it does not differentiate this tool from its sibling 'assign_users_to_groups', which might handle multiple users, leaving some ambiguity in scope.

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 like 'assign_users_to_groups' or 'remove_user_from_group'. It lacks context about prerequisites (e.g., user/group existence) or typical scenarios, leaving the agent to infer usage from tool names alone.

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