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
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | The name or ID of the project. | |
| work_item_type | Yes | The 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
- mcp_azure_devops/server.py:253-267 (schema)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 }
- mcp_azure_devops/server.py:250-268 (registration)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 } ),
- mcp_azure_devops/server.py:945-946 (handler)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)