Skip to main content
Glama
kapilduraphe

Okta MCP Server

run_onboarding_workflow

Automate user onboarding by processing CSV data, assigning default groups, mapping attributes to specific groups, provisioning applications, and optionally activating users and sending welcome emails.

Instructions

Run a complete onboarding workflow for multiple users from CSV data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activateUsersNoWhether to activate users immediately (default: true)
applicationIdsNoApplication IDs to provision for all users
csvDataYesCSV string with user information
defaultGroupsNoDefault group IDs to assign all users to
groupMappingsNoMapping of user attributes to group IDs (e.g., {"department": {"Engineering": "group1Id"}})
sendWelcomeEmailNoWhether to send welcome emails (default: true)

Implementation Reference

  • The handler function for 'run_onboarding_workflow' that orchestrates bulk user import, group assignments based on attributes, and application provisioning from CSV data.
      run_onboarding_workflow: async (request: { parameters: unknown }) => {
        const {
          csvData,
          activateUsers,
          defaultGroups,
          groupMappings,
          applicationIds,
          sendWelcomeEmail
        } = onboardingSchemas.runOnboardingWorkflow.parse(request.parameters);
        
        try {
          // Step 1: Import users
          const importResults = await onboardingHandlers.bulk_user_import({
            parameters: {
              csvData,
              activateUsers,
              sendEmail: sendWelcomeEmail,
              defaultGroups
            }
          });
          
          if (!importResults.data || !importResults.data.success || importResults.data.success.length === 0) {
            return {
              content: [{ type: 'text', text: 'No users were successfully created during the onboarding workflow.' }],
              data: { userImport: importResults.data }
            };
          }
          
          const createdUserIds = importResults.data.success.map((user: any) => user.id);
          
          // Step 2: Assign to groups based on attributes (if mappings provided)
          let groupResults: any = { data: { success: [], failed: [] } };
          if (Object.keys(groupMappings).length > 0) {
            groupResults = await onboardingHandlers.assign_users_to_groups({
              parameters: {
                userIds: createdUserIds,
                attributeMapping: groupMappings
              }
            });
          }
          
          // Step 3: Provision applications (if any provided)
          let appResults: any = { data: { success: [], failed: [] } };
          if (applicationIds.length > 0) {
            appResults = await onboardingHandlers.provision_applications({
              parameters: {
                userIds: createdUserIds,
                applicationIds
              }
            });
          }
          
          // Compile workflow results
          const workflow = {
            userImport: importResults.data,
            groupAssignment: groupResults.data,
            applicationProvisioning: appResults.data,
            summary: {
              totalProcessed: importResults.data.success.length + importResults.data.failed.length,
              successfullyOnboarded: importResults.data.success.length,
              failedUsers: importResults.data.failed.length,
              groupsAssigned: groupResults.data.success.length,
              applicationsProvisioned: appResults.data.success.length
            }
          };
          
          // Format response with detailed summary
          const summary = `Onboarding Workflow Complete:
    
    - User Import:
      - Processed ${workflow.summary.totalProcessed} users
      - Successfully created: ${workflow.summary.successfullyOnboarded}
      - Failed: ${workflow.summary.failedUsers}
    
    ${Object.keys(groupMappings).length > 0 ? `• Group Assignment:
      - Users assigned to groups: ${workflow.groupAssignment.success.length}
      - Failed group assignments: ${workflow.groupAssignment.failed.length}` : '• Group Assignment: Not configured'}
    
    ${applicationIds.length > 0 ? `• Application Provisioning:
      - Users provisioned with applications: ${workflow.applicationProvisioning.success.length}
      - Failed application provisioning: ${workflow.applicationProvisioning.failed.length}` : '• Application Provisioning: Not configured'}
    
    Overall, successfully onboarded ${workflow.summary.successfullyOnboarded} out of ${workflow.summary.totalProcessed} users with ${Object.keys(groupMappings).length > 0 ? 'attribute-based group assignment' : 'default groups only'} and ${applicationIds.length > 0 ? 'application provisioning' : 'no application provisioning'}.`;
          
          return {
            content: [{ type: 'text', text: summary }],
            data: workflow
          };
        } catch (error) {
          console.error("Error during onboarding workflow:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to complete onboarding workflow: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
  • Zod schema definition for validating the input parameters of runOnboardingWorkflow.
    runOnboardingWorkflow: z.object({
      csvData: z.string().min(1, "CSV data is required"),
      activateUsers: z.boolean().optional().default(true),
      defaultGroups: z.array(z.string()).optional().default([]),
      groupMappings: z.record(z.record(z.string())).optional().default({}),
      applicationIds: z.array(z.string()).optional().default([]),
      sendWelcomeEmail: z.boolean().optional().default(true),
    }),
  • Tool registration entry in the onboardingTools array, including name, description, and JSON input schema.
    {
      name: "run_onboarding_workflow",
      description: "Run a complete onboarding workflow for multiple users from CSV data",
      inputSchema: {
        type: "object",
        properties: {
          csvData: {
            type: "string",
            description: "CSV string with user information"
          },
          activateUsers: {
            type: "boolean",
            description: "Whether to activate users immediately (default: true)",
            default: true
          },
          defaultGroups: {
            type: "array",
            items: { type: "string" },
            description: "Default group IDs to assign all users to",
            default: []
          },
          groupMappings: {
            type: "object", 
            description: "Mapping of user attributes to group IDs (e.g., {\"department\": {\"Engineering\": \"group1Id\"}})",
            default: {}
          },
          applicationIds: {
            type: "array",
            items: { type: "string" },
            description: "Application IDs to provision for all users",
            default: []
          },
          sendWelcomeEmail: {
            type: "boolean",
            description: "Whether to send welcome emails (default: true)",
            default: true
          }
        },
        required: ["csvData"]
      },
    }
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 'run a complete onboarding workflow' implies a complex, multi-step operation, the description doesn't reveal important behavioral aspects like whether this is a synchronous or asynchronous operation, what permissions are required, whether it's idempotent, what happens on partial failures, or what the expected output format is.

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 clearly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information about what the tool does.

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 complex workflow tool with 6 parameters (including nested objects), no annotations, and no output schema, the description is insufficient. It doesn't explain what constitutes a 'complete onboarding workflow', what steps are involved, what happens when the workflow runs, or what the agent should expect as a result. The description leaves too many behavioral questions unanswered.

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 all parameters thoroughly. The description mentions 'CSV data' which aligns with the 'csvData' parameter, but adds no additional semantic context beyond what's already in the parameter descriptions. This meets the baseline expectation when schema coverage is complete.

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 ('run a complete onboarding workflow') and resource ('multiple users from CSV data'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'bulk_user_import' or 'activate_user', which appear to handle similar user management functions.

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. With sibling tools like 'bulk_user_import', 'activate_user', 'assign_users_to_groups', and 'provision_applications' available, there's no indication of when this comprehensive workflow tool is preferable to using those individual tools separately.

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