get_team_area_paths
Retrieve area paths assigned to a specific team in Azure DevOps. Helps identify team responsibilities, default path assignments, and configure boards and backlogs for accurate work item routing and classification.
Instructions
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
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_name_or_id | Yes | ||
| team_name_or_id | Yes |
Implementation Reference
- The MCP tool handler for get_team_area_paths, decorated with @mcp.tool(). It validates inputs implicitly via types, retrieves the Azure DevOps work client, calls the core implementation, and handles client errors.@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)}"
- Core handler logic that creates TeamContext, calls Azure DevOps SDK to get team field values for area paths, and formats the result or handles errors.def _get_team_area_paths_impl( work_client, project_name_or_id: str, team_name_or_id: str ) -> str: """ Implementation of team area paths retrieval. Args: work_client: Work client 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 """ try: # Create a TeamContext object team_context = TeamContext( project=project_name_or_id, team=team_name_or_id ) # Get the team field values team_field_values = work_client.get_team_field_values(team_context) if not team_field_values: return (f"No area paths found for team {team_name_or_id} " f"in project {project_name_or_id}.") return _format_team_area_path(team_field_values) except Exception as e: return f"Error retrieving team area paths: {str(e)}"
- Supporting utility that formats the team field values (area paths) into a human-readable markdown string, including default and all paths with include_children indicators.def _format_team_area_path(team_field_values) -> str: """ Format team area path information. Args: team_field_values: Team field values object to format Returns: String with team area path details """ formatted_info = ["# Team Area Paths"] # Add default area path if (hasattr(team_field_values, "default_value") and team_field_values.default_value): formatted_info.append( f"Default Area Path: {team_field_values.default_value}") # Add all area paths if hasattr(team_field_values, "values") and team_field_values.values: formatted_info.append("\n## All Area Paths:") for area_path in team_field_values.values: value_str = f"- {area_path.value}" if (hasattr(area_path, "include_children") and area_path.include_children): value_str += " (Including sub-areas)" formatted_info.append(value_str) return "\n".join(formatted_info)
- src/mcp_azure_devops/features/teams/__init__.py:5-13 (registration)Registration entry point for the teams feature, which calls tools.register_tools(mcp) to register the get_team_area_paths tool among others.def register(mcp): """ Register all teams components with the MCP server. Args: mcp: The FastMCP server instance """ tools.register_tools(mcp)