get_work_item_states
Retrieve all valid states for a specific work item type in Azure DevOps to ensure accurate status tracking and updates.
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 implementing the get_work_item_states tool logic by fetching the work item type and extracting its states.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:945-946 (handler)MCP server handler dispatching the tool call to the AzureDevOpsClient method.elif name == "get_work_item_states": return self.client.get_work_item_states(**arguments)
- mcp_azure_devops/server.py:250-268 (registration)Tool registration including name, description, and input schema.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:250-268 (schema)Input schema definition for the get_work_item_states tool.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 } ),