Skip to main content
Glama
kapilduraphe

Okta MCP Server

activate_user

Enable user activation in Okta by providing a user ID. Optionally configure email notifications for activation.

Instructions

Activate a user in Okta

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sendEmailNoWhether to send an activation email (default: true)
userIdYesThe unique identifier of the Okta user

Implementation Reference

  • The primary handler function for the 'activate_user' tool. Parses input parameters using Zod schema, retrieves Okta client, calls the activateUser API, and returns a success message or error response.
    activate_user: async (request: { parameters: unknown }) => {
      const { userId, sendEmail } = userSchemas.activateUser.parse(
        request.parameters
      );
    
      try {
        const oktaClient = getOktaClient();
    
        await oktaClient.userApi.activateUser({
          userId,
          sendEmail,
        });
    
        return {
          content: [
            {
              type: "text",
              text: `User with ID ${userId} has been activated successfully.${
                sendEmail ? " An activation email has been sent." : ""
              }`,
            },
          ],
        };
      } catch (error) {
        console.error("Error activating user:", error);
        return {
          content: [
            {
              type: "text",
              text: `Failed to activate user: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    },
  • Zod schema for input validation of the activate_user tool, defining required userId and optional sendEmail parameters.
    activateUser: z.object({
      userId: z.string().min(1, "User ID is required"),
      sendEmail: z.boolean().optional().default(true),
    }),
  • Tool registration definition in the userTools array, specifying name, description, and input schema for the MCP tool list.
    {
      name: "activate_user",
      description: "Activate a user in Okta",
      inputSchema: {
        type: "object",
        properties: {
          userId: {
            type: "string",
            description: "The unique identifier of the Okta user",
          },
          sendEmail: {
            type: "boolean",
            description: "Whether to send an activation email (default: true)",
          },
        },
        required: ["userId"],
      },
    },
  • Combines userTools (including activate_user) and userHandlers into global TOOLS and HANDLERS exports used by the MCP server.
    import { userTools, userHandlers } from "./users.js";
    import { groupTools, groupHandlers } from "./groups.js";
    import { onboardingTools, onboardingHandlers } from "./onboarding.js";
    
    // Combine all tools from different modules
    export const TOOLS = [...userTools, ...groupTools, ...onboardingTools];
    
    // Combine all handlers from different modules
    export const HANDLERS = {
      ...userHandlers,
      ...groupHandlers,
      ...onboardingHandlers,
    };
  • src/index.ts:32-66 (registration)
    MCP server request handlers that expose the combined TOOLS list and execute HANDLERS[toolName] for tool calls, enabling the activate_user tool.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      log('Received list tools request');
      return { tools: TOOLS };
    });
    
    // Handle tool calls
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const toolName = request.params.name;
      log(`Received tool call: ${toolName}`);
    
      try {
        if (!(toolName in HANDLERS)) {
          throw new Error(`Unknown tool: ${toolName}`);
        }
    
        // Execute handler
        log(`Executing handler for tool: ${toolName}`);
        const result = await HANDLERS[toolName as keyof typeof HANDLERS]({ parameters: request.params.arguments || {} });
        log(`Handler execution completed for: ${toolName}`);
    
        return result;
      } catch (error) {
        log(`Error handling tool call: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    });
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 'Activate' implies a state change, it doesn't specify whether this requires admin permissions, if it's reversible (via 'deactivate_user'), what happens with the email option, or typical response formats. This leaves significant behavioral 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 with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential information immediately.

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 insufficient. It doesn't explain what 'activation' means in Okta's context, what happens after activation, error conditions, or relationship to sibling tools. More context is needed given the tool's complexity and lack of structured metadata.

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 schema already documents both parameters thoroughly. The description adds no additional parameter context beyond what's in the schema (e.g., what activation entails, email content, or userId format). Baseline 3 is appropriate when 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 ('Activate') and resource ('a user in Okta'), making the tool's purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'unsuspend_user', which might serve a similar purpose in some contexts, preventing a perfect score.

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 'unsuspend_user' or 'run_onboarding_workflow'. There's no mention of prerequisites (e.g., user must exist in a deactivated state) or typical scenarios for activation, leaving usage context ambiguous.

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