Skip to main content
Glama

get_team_members

Retrieve team membership rosters to identify members, administrators, and team composition within Azure DevOps projects.

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
team_idYes
topNo
skipNo

Implementation Reference

  • The primary handler function for the 'get_team_members' tool. Decorated with @mcp.tool(), it defines the input parameters (project_id, team_id, top, skip), docstring serving as schema description, retrieves the core client, invokes the helper implementation, and handles client errors.
    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 implementation logic that calls the Azure DevOps CoreClient.get_team_members_with_extended_properties API, formats each member using _format_team_member helper, handles no results and general exceptions.
    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, extracting identity details and admin status.
    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)
  • Registration call that invokes the register_tools function from tools.py, which defines and registers the get_team_members tool among others.
    tools.register_tools(mcp)

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/Vortiago/mcp-azure-devops'

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