List the users holding an organization role
Use list_role_users to see which individual users currently hold a given
organization role, whether granted directly or inherited through team
membership.
Prerequisites
Section titled “Prerequisites”github-org-identityinstalled.- A GitHub token resolvable via
GITHUB_TOKENorgh auth token, with the org’sadmin:orgscope or App-installationmembers/organization_administrationpermission. - The numeric
roleIdyou want to inspect — get it from list_organization_roles first if you don’t already have it.
-
Ask for the tool with the org and the role’s numeric id:
Use
list_role_usersfor orgmy-org, roleId8132. -
Read the result — an array of
{ "login": "...", "assignment": "..." }.assignmentreflects how the user holds the role. Treat anullvalue as unknown, not as “direct” — the tool reportsnullrather than guessing whenever the underlying GitHub API response omits the field (this happens on older API responses).
If the call fails
Section titled “If the call fails”missing_scope— no resolvable token.github_api_error— theroleIddoesn’t exist in this org, or the identity lacks org-roles read access.