Skip to main content
Glama

get_work_item_states

Retrieve all valid states for a specific work item type in Azure DevOps projects to ensure accurate status updates and workflow compliance.

Instructions

Get all possible states for a specific work item type to help with accurate status updates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesThe name or ID of the project.
work_item_typeYesThe work item type to get states for (e.g., 'Bug', 'User Story', 'Task').

Implementation Reference

  • Core handler function that fetches the work item type from Azure DevOps API and extracts all possible states, including name, color, and category.
    def get_work_item_states(self, project, work_item_type):
        """
        Get all possible states for a specific work item type.
        """
        work_item_type_obj = self.work_item_tracking_client.get_work_item_type(
            project=project,
            type=work_item_type
        )
        
        # Extract states from the work item type definition
        states = []
        if hasattr(work_item_type_obj, 'states') and work_item_type_obj.states:
            states = [
                {
                    "name": state.name,
                    "color": getattr(state, 'color', None),
                    "category": getattr(state, 'category', None)
                }
                for state in work_item_type_obj.states
            ]
        
        return states
  • Input schema definition for the get_work_item_states tool, specifying required parameters: project and work_item_type.
    inputSchema={
        "type": "object",
        "properties": {
            "project": {
                "type": "string", 
                "description": "The name or ID of the project."
            },
            "work_item_type": {
                "type": "string", 
                "description": "The work item type to get states for (e.g., 'Bug', 'User Story', 'Task')."
            },
        },
        "required": ["project", "work_item_type"],
        "additionalProperties": False
    }
  • Tool registration in the self.tools list, including name, description, and schema. Exposed via list_tools() handler.
    types.Tool(
        name="get_work_item_states",
        description="Get all possible states for a specific work item type to help with accurate status updates.",
        inputSchema={
            "type": "object",
            "properties": {
                "project": {
                    "type": "string", 
                    "description": "The name or ID of the project."
                },
                "work_item_type": {
                    "type": "string", 
                    "description": "The work item type to get states for (e.g., 'Bug', 'User Story', 'Task')."
                },
            },
            "required": ["project", "work_item_type"],
            "additionalProperties": False
        }
    ),
  • Server-side dispatch handler that calls the client.get_work_item_states method with parsed arguments.
    elif name == "get_work_item_states":
        return self.client.get_work_item_states(**arguments)

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

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