Skip to main content
Glama

get_team_members

Retrieve detailed team membership information, including member roles, emails, and IDs, for a specific team in Azure DevOps. Use this tool to view team composition, identify administrators, and manage user assignments effectively.

Instructions

Retrieves the membership roster for a specific team. Use this tool when you need to: - See who belongs to a particular team - Find team administrators - Check user assignments across teams - Determine team size and composition Args: project_id: The name or ID (GUID) of the team project the team belongs to team_id: The name or ID (GUID) of the team top: Maximum number of members to return skip: Number of members to skip Returns: Formatted string containing team members information including display names, emails, IDs, and administrator status, formatted as markdown with each member clearly separated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
skipNo
team_idYes
topNo

Implementation Reference

  • The primary handler function for the 'get_team_members' tool. It is registered with @mcp.tool() decorator and delegates to the _get_team_members_impl helper after getting the CoreClient.
    def get_team_members( project_id: str, team_id: str, top: Optional[int] = None, skip: Optional[int] = None ) -> str: """ Retrieves the membership roster for a specific team. Use this tool when you need to: - See who belongs to a particular team - Find team administrators - Check user assignments across teams - Determine team size and composition Args: project_id: The name or ID (GUID) of the team project the team belongs to team_id: The name or ID (GUID) of the team top: Maximum number of members to return skip: Number of members to skip Returns: Formatted string containing team members information including display names, emails, IDs, and administrator status, formatted as markdown with each member clearly separated """ try: core_client = get_core_client() return _get_team_members_impl( core_client, project_id, team_id, top, skip ) except AzureDevOpsClientError as e: return f"Error: {str(e)}"
  • Core helper function that performs the actual API call to retrieve team members using the Azure DevOps CoreClient and formats the results using _format_team_member.
    def _get_team_members_impl( core_client: CoreClient, project_id: str, team_id: str, top: Optional[int] = None, skip: Optional[int] = None ) -> str: """ Implementation of team members retrieval. Args: core_client: Core client project_id: The name or ID (GUID) of the team project the team belongs to team_id: The name or ID (GUID) of the team top: Maximum number of members to return skip: Number of members to skip Returns: Formatted string containing team members information """ try: team_members = core_client.get_team_members_with_extended_properties( project_id=project_id, team_id=team_id, top=top, skip=skip ) if not team_members: return (f"No members found for team {team_id} in " f"project {project_id}.") formatted_members = [] for member in team_members: formatted_members.append(_format_team_member(member)) return "\n\n".join(formatted_members) except Exception as e: return f"Error retrieving team members: {str(e)}"
  • Helper function to format individual team member information into a readable markdown string.
    def _format_team_member(team_member) -> str: """ Format team member information. Args: team_member: Team member object to format Returns: String with team member details """ formatted_info = [] # Get identity information if hasattr(team_member, "identity") and team_member.identity: identity = team_member.identity # Use display name if available, otherwise use ID if hasattr(identity, "display_name") and identity.display_name: formatted_info.append(f"# Member: {identity.display_name}") else: formatted_info.append(f"# Member ID: {identity.id}") # Add ID if hasattr(identity, "id") and identity.id: formatted_info.append(f"ID: {identity.id}") # Add descriptor if hasattr(identity, "descriptor") and identity.descriptor: formatted_info.append(f"Descriptor: {identity.descriptor}") # Add unique name (email/username) if hasattr(identity, "unique_name") and identity.unique_name: formatted_info.append(f"Email/Username: {identity.unique_name}") else: formatted_info.append("# Unknown Member") # Add team admin status if hasattr(team_member, "is_team_admin"): is_admin = "Yes" if team_member.is_team_admin else "No" formatted_info.append(f"Team Administrator: {is_admin}") return "\n".join(formatted_info)
  • The register_tools function that defines and registers all team-related MCP tools, including get_team_members.
    def register_tools(mcp) -> None: """ Register team tools with the MCP server. Args: mcp: The FastMCP server instance """ @mcp.tool() def get_all_teams( user_is_member_of: Optional[bool] = None, top: Optional[int] = None, skip: Optional[int] = None ) -> str: """ Retrieves all teams in the Azure DevOps organization. Use this tool when you need to: - Get an overview of all teams across projects - Find team IDs for use in other operations - Determine which teams exist in the organization - Locate specific teams by name Args: user_is_member_of: If true, return only teams where the current user is a member. Otherwise return all teams the user has read access to. top: Maximum number of teams to return skip: Number of teams to skip Returns: Formatted string containing team information including names, IDs, descriptions, and associated projects, formatted as markdown with each team clearly separated """ try: core_client = get_core_client() return _get_all_teams_impl( core_client, user_is_member_of, top, skip ) except AzureDevOpsClientError as e: return f"Error: {str(e)}" @mcp.tool() def get_team_members( project_id: str, team_id: str, top: Optional[int] = None, skip: Optional[int] = None ) -> str: """ Retrieves the membership roster for a specific team. Use this tool when you need to: - See who belongs to a particular team - Find team administrators - Check user assignments across teams - Determine team size and composition Args: project_id: The name or ID (GUID) of the team project the team belongs to team_id: The name or ID (GUID) of the team top: Maximum number of members to return skip: Number of members to skip Returns: Formatted string containing team members information including display names, emails, IDs, and administrator status, formatted as markdown with each member clearly separated """ try: core_client = get_core_client() return _get_team_members_impl( core_client, project_id, team_id, top, skip ) except AzureDevOpsClientError as e: return f"Error: {str(e)}" @mcp.tool() def get_team_area_paths( project_name_or_id: str, team_name_or_id: str ) -> str: """ Retrieves the area paths assigned to a specific team. Use this tool when you need to: - Understand a team's areas of responsibility - Check default area path assignments - Determine how work is classified and routed to teams - Set up board and backlog configurations IMPORTANT: Area paths in Azure DevOps determine which work items appear on a team's backlogs and boards. The default area path is used when creating new work items through a team's interface. Args: project_name_or_id: The name or ID of the team project team_name_or_id: The name or ID of the team Returns: Formatted string containing team area path information including the default area path and all assigned paths, with indicators for paths that include sub-areas """ try: work_client = get_work_client() return _get_team_area_paths_impl( work_client, project_name_or_id, team_name_or_id ) except AzureDevOpsClientError as e: return f"Error: {str(e)}" @mcp.tool() def get_team_iterations( project_name_or_id: str, team_name_or_id: str, current: Optional[bool] = None ) -> str: """ Retrieves the iterations (sprints) assigned to a specific team. Use this tool when you need to: - View a team's sprint schedule - Find date ranges for iterations - Determine which iteration is currently active - Plan work based on team's iteration calendar IMPORTANT: Iterations in Azure DevOps define time periods for planning and tracking work. They determine sprint dates and are used for capacity planning, burndown charts, and velocity calculations. Args: project_name_or_id: The name or ID of the team project team_name_or_id: The name or ID of the team current: If True, return only the current iteration Returns: Formatted string containing team iteration information including names, date ranges, and time frames (past/current/future), formatted as markdown """ try: work_client = get_work_client() return _get_team_iterations_impl( work_client, project_name_or_id, team_name_or_id, current ) except AzureDevOpsClientError as e: return f"Error: {str(e)}"

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/aadityasinghal7/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server