get_service_accounts
Retrieve accounts for a specific service using its serviceId. Filter by keyword, roles, status, and more to find user accounts.
Instructions
Return a list of accounts for a specific service. The serviceId can be obtained from the get_services tool. Can be searched by email/name of the account by keyword
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serviceId | Yes | ||
| limit | No | ||
| cursor | No | ||
| keyword | No | ||
| sortBy | No | ||
| sortOrder | No | ||
| workspaceIds | No | ||
| twoFa | No | ||
| roles | No | ||
| serviceRoles | No | ||
| types | No | ||
| employeeTypes | No | ||
| employeeStatuses | No | ||
| statuses | No | ||
| includeDeleted | No | ||
| expandIdentities | No | ||
| onlyInactive | No | ||
| licenses | No | ||
| alertType | No | ||
| alertStatus | No |
Implementation Reference
- src/tools/getServiceAccounts.ts:61-67 (handler)The asynchronous handler function that executes the 'get_service_accounts' tool logic. It extracts the serviceId, converts remaining filters to query parameters, and makes an API call to /services/{serviceId}/accounts.
export async function getServiceAccounts(filters: ServiceAccountFilters) { const client = getClient(); const { serviceId, ...rest } = filters; const queryParams = filtersToParams(rest); return client.makeApiCall(`/services/${serviceId}/accounts`, queryParams); } - src/tools/getServiceAccounts.ts:5-57 (schema)Zod schema for input validation of get_service_accounts. Defines all filter parameters including serviceId (required), limit, cursor, keyword, sortBy, sortOrder, workspaceIds, twoFa, roles, serviceRoles, types, employeeTypes, employeeStatuses, statuses, includeDeleted, expandIdentities, onlyInactive, licenses, alertType, and alertStatus.
export const ServiceAccountFiltersSchema = z.object({ serviceId: z.number(), limit: z.number().optional(), cursor: z.string().optional(), keyword: z.string().optional(), sortBy: z.string().optional(), sortOrder: z.string().optional(), workspaceIds: z.array(z.number()).optional(), twoFa: z.boolean().optional(), roles: z .array(z.enum(["admin", "guest", "other"])) .length(1, "roles must be an array with exactly one element") .optional(), serviceRoles: z.array(z.string()).optional(), types: z.array(z.enum(["employee", "guest", "system", "unknown"])).optional(), employeeTypes: z .array( z.enum([ "board_member", "full_time_employee", "fixed_time_employee", "temporary_employee", "part_time_employee", "secondment_employee", "contract_employee", "collaborator", "group_address", "shared_address", "test_address", "other", "unknown", "unregistered", ]), ) .length(1, "employeeTypes must be an array with exactly one element") .optional(), employeeStatuses: z .array(z.enum(["active", "on_leave", "draft", "preactive", "retired", "untracked"])) .length(1, "employeeStatuses must be an array with exactly one element") .optional(), statuses: z .array(z.enum(["active", "on_leave", "draft", "preactive", "retired", "untracked"])) .length(1, "employeeStatuses must be an array with exactly one element") .optional(), includeDeleted: z.boolean().optional(), expandIdentities: z.boolean().optional(), onlyInactive: z.boolean().optional(), licenses: z.array(z.string()).optional(), alertType: z .enum(["retired_account", "inactive_account", "on_leave_account", "unknown_account", "public_files"]) .optional(), alertStatus: z.enum(["muted", "unmuted"]).optional(), }); - src/index.ts:194-199 (registration)Registration of the tool with name 'get_service_accounts', including its description and inputSchema referencing ServiceAccountFiltersSchema.
{ name: "get_service_accounts", description: "Return a list of accounts for a specific service. The serviceId can be obtained from the get_services tool. Can be searched by email/name of the account by keyword", inputSchema: zodToJsonSchema(ServiceAccountFiltersSchema), }, - src/index.ts:313-313 (registration)Tool handler registration mapping the 'get_service_accounts' name to the getServiceAccounts function with schema validation via ServiceAccountFiltersSchema.parse.
get_service_accounts: async (input) => getServiceAccounts(ServiceAccountFiltersSchema.parse(input)),