Skip to content

Remove an organization role from a team

Use remove_team_role to revoke an organization role a team currently holds. Like the other write tools in this plugin, this mutates permissions across every repo the role’s definition covers — read the confirm-echo contract before your first call if you haven’t used one of this plugin’s write tools before.

  • github-org-identity installed.
  • A GitHub token resolvable via GITHUB_TOKEN or gh auth token, with the org’s admin:org scope or App-installation members/ organization_administration permission.
  • The numeric roleId and the team’s slug. Confirm the team actually holds the role first with list_role_teams — removing a role a team doesn’t hold still reaches the GitHub API and its response governs the outcome, this tool does no pre-check of current state.
  1. Ask for the tool, passing the role id twice — once as roleId, once as confirmRoleId — plus the team’s slug:

    Use remove_team_role for org my-org, roleId 8132, confirmRoleId 8132, teamSlug my-team.

    The two role-id fields must be identical, or the call throws confirmation_mismatch before any GitHub API request is made.

  2. On success you get back { "org": "my-org", "roleId": 8132, "teamSlug": "my-team" }.

  3. Confirm the removal took effect with list_role_teams — the team should no longer appear in that role’s team list.

  • confirmation_mismatchroleId and confirmRoleId didn’t match; no API call was made.
  • missing_scope — no resolvable token.
  • github_api_error — the roleId or teamSlug doesn’t exist, or the identity lacks org-roles write access.

Assign a role to a team, or the equivalent user-scoped tools: assign_user_role / remove_user_role.