get_group
Retrieve detailed information about a specific group in Okta by providing the group ID using this tool for user management and group-level insights.
Instructions
Get detailed information about a specific group
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | ID of the group to retrieve |
Implementation Reference
- src/tools/groups.ts:385-436 (handler)The main handler function for the 'get_group' tool. It validates the input using the Zod getGroup schema, fetches the specific group from the Okta API using oktaClient.groupApi.getGroup, formats the group details including ID, name, description, type, object class, and timestamps, and returns a formatted text response or an error message.get_group: async (request: { parameters: unknown }) => { const { groupId } = groupSchemas.getGroup.parse(request.parameters); try { const oktaClient = getOktaClient(); const group = await oktaClient.groupApi.getGroup({ groupId, }); if (!group || !group.profile) { return { content: [ { type: "text", text: `No group found with ID: ${groupId}`, }, ], }; } const formattedGroup = `Group Details: - ID: ${group.id} - Name: ${group.profile.name} - Description: ${getProfileValue(group.profile.description)} - Type: ${group.type || "Unknown"} - Object Class: ${formatArray(group.objectClass)} - Created: ${formatDate(group.created)} - Last Updated: ${formatDate(group.lastUpdated)} - Last Membership Updated: ${formatDate(group.lastMembershipUpdated)}`; return { content: [ { type: "text", text: formattedGroup, }, ], }; } catch (error) { console.error("Error getting group:", error); return { content: [ { type: "text", text: `Failed to get group: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } },
- src/tools/groups.ts:21-23 (schema)Zod schema definition for the get_group tool input validation, requiring a non-empty groupId string.getGroup: z.object({ groupId: z.string().min(1, "Group ID is required"), }),
- src/tools/groups.ts:148-161 (registration)Tool registration entry for 'get_group' in the exported groupTools array, defining the tool name, description, and JSON Schema for input validation (groupId required).{ name: "get_group", description: "Get detailed information about a specific group", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "ID of the group to retrieve", }, }, required: ["groupId"], }, },