Skip to main content
Glama
Vortiago
by Vortiago

get_projects

Retrieve all accessible Azure DevOps projects to get overviews, find IDs for operations, check states and visibility, or locate specific projects by name.

Instructions

    Retrieves all projects accessible to the authenticated user 
    in the Azure DevOps organization.
    
    Use this tool when you need to:
    - Get an overview of all available projects
    - Find project IDs for use in other operations
    - Check project states and visibility settings
    - Locate specific projects by name
    
    Args:
        state_filter: Filter on team projects in a specific state 
            (e.g., "WellFormed", "Deleting")
        top: Maximum number of projects to return
            
    Returns:
        Formatted string containing project information including names,
        IDs, descriptions, states, and visibility settings, formatted as
        markdown with each project clearly separated
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
state_filterNo
topNo

Implementation Reference

  • Primary MCP tool handler for 'get_projects'. Defines input parameters, docstring for schema, obtains Azure DevOps CoreClient, calls helper implementation, and handles client errors.
    @mcp.tool()
    def get_projects(
        state_filter: Optional[str] = None,
        top: Optional[int] = None
    ) -> str:
        """
        Retrieves all projects accessible to the authenticated user 
        in the Azure DevOps organization.
        
        Use this tool when you need to:
        - Get an overview of all available projects
        - Find project IDs for use in other operations
        - Check project states and visibility settings
        - Locate specific projects by name
        
        Args:
            state_filter: Filter on team projects in a specific state 
                (e.g., "WellFormed", "Deleting")
            top: Maximum number of projects to return
                
        Returns:
            Formatted string containing project information including names,
            IDs, descriptions, states, and visibility settings, formatted as
            markdown with each project clearly separated
        """
        try:
            core_client = get_core_client()
            return _get_projects_impl(core_client, state_filter, top)
        except AzureDevOpsClientError as e:
            return f"Error: {str(e)}"
  • Core implementation logic: fetches projects via CoreClient.get_projects() with optional filters, handles empty results and exceptions, formats each project using _format_project helper, and joins outputs.
    def _get_projects_impl(
        core_client: CoreClient,
        state_filter: Optional[str] = None,
        top: Optional[int] = None
    ) -> str:
        """
        Implementation of projects retrieval.
        
        Args:
            core_client: Core client
            state_filter: Filter on team projects in a specific state
            top: Maximum number of projects to return
                
        Returns:
            Formatted string containing project information
        """
        try:
            projects = core_client.get_projects(state_filter=state_filter, top=top)
            
            if not projects:
                return "No projects found."
            
            formatted_projects = []
            for project in projects:
                formatted_projects.append(_format_project(project))
            
            return "\n\n".join(formatted_projects)
                
        except Exception as e:
            return f"Error retrieving projects: {str(e)}"
  • Supporting utility to format a single TeamProjectReference into a detailed markdown-style string including name, ID, description, state, visibility, URL, and last update time.
    def _format_project(project: TeamProjectReference) -> str:
        """
        Format project information.
        
        Args:
            project: Project object to format
            
        Returns:
            String with project details
        """
        # Basic information that should always be available
        formatted_info = [f"# Project: {project.name}"]
        formatted_info.append(f"ID: {project.id}")
        
        # Add description if available
        if hasattr(project, "description") and project.description:
            formatted_info.append(f"Description: {project.description}")
        
        # Add state if available
        if hasattr(project, "state") and project.state:
            formatted_info.append(f"State: {project.state}")
        
        # Add visibility if available
        if hasattr(project, "visibility") and project.visibility:
            formatted_info.append(f"Visibility: {project.visibility}")
        
        # Add URL if available
        if hasattr(project, "url") and project.url:
            formatted_info.append(f"URL: {project.url}")
        
        # Add last update time if available
        if hasattr(project, "last_update_time") and project.last_update_time:
            formatted_info.append(f"Last Updated: {project.last_update_time}")
        
        return "\n".join(formatted_info)
  • Registration entrypoint for projects feature: calls tools.register_tools(mcp) which defines and registers the get_projects tool.
    def register(mcp):
        """
        Register all projects components with the MCP server.
        
        Args:
            mcp: The FastMCP server instance
        """
        tools.register_tools(mcp)
  • Direct registration of the get_projects tool via nested @mcp.tool() decorator definition inside register_tools function.
    def register_tools(mcp) -> None:
        """
        Register project tools with the MCP server.
        
        Args:
            mcp: The FastMCP server instance
        """
        
        @mcp.tool()
        def get_projects(
            state_filter: Optional[str] = None,
            top: Optional[int] = None
        ) -> str:
            """
            Retrieves all projects accessible to the authenticated user 
            in the Azure DevOps organization.
            
            Use this tool when you need to:
            - Get an overview of all available projects
            - Find project IDs for use in other operations
            - Check project states and visibility settings
            - Locate specific projects by name
            
            Args:
                state_filter: Filter on team projects in a specific state 
                    (e.g., "WellFormed", "Deleting")
                top: Maximum number of projects to return
                    
            Returns:
                Formatted string containing project information including names,
                IDs, descriptions, states, and visibility settings, formatted as
                markdown with each project clearly separated
            """
            try:
                core_client = get_core_client()
                return _get_projects_impl(core_client, state_filter, top)
            except AzureDevOpsClientError as e:
                return f"Error: {str(e)}"
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that it retrieves 'all projects accessible to the authenticated user', implying authentication needs and scope limitations. It also describes the return format ('formatted as markdown'), adding useful behavioral context beyond basic functionality. However, it doesn't mention rate limits, pagination, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with distinct sections (purpose, usage guidelines, args, returns), front-loading key information. Each sentence earns its place by providing specific details without redundancy, and the bullet points enhance readability while maintaining efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema coverage, and no output schema, the description does an excellent job compensating by explaining parameters, return format, and use cases. It covers the core functionality comprehensively. A slight deduction because it doesn't address potential limitations like authentication errors or large result sets, but overall it's highly complete for this tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear explanations for both parameters: 'state_filter' is described with examples ('WellFormed', 'Deleting'), and 'top' is explained as 'Maximum number of projects to return'. This adds significant meaning beyond the schema's minimal titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Retrieves') and resource ('all projects accessible to the authenticated user in the Azure DevOps organization'), making the purpose specific. It distinguishes from siblings by focusing on project retrieval rather than work items, teams, or processes, which are covered by other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly lists four use cases (e.g., 'Get an overview of all available projects', 'Find project IDs for use in other operations'), providing clear guidance on when to use this tool. It implicitly distinguishes from alternatives by not mentioning other project-related tools, but the specific use cases offer practical direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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