Skip to main content
Glama

get_work_item_transitions

Retrieve valid state transitions for Azure DevOps work items to ensure proper workflow progression from a specific state.

Instructions

Get valid state transitions for a work item type from a specific state to ensure proper workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_stateYesThe current state to get valid transitions from.
projectYesThe name or ID of the project.
work_item_typeYesThe work item type (e.g., 'Bug', 'User Story', 'Task').

Implementation Reference

  • The primary handler function implementing the tool logic: fetches the work item type from Azure DevOps and extracts valid state transitions from the given 'from_state', falling back to all other states if explicit transitions are unavailable.
    def get_work_item_transitions(self, project, work_item_type, from_state): """ Get valid state transitions for a work item type from a specific state. """ try: # This requires calling the process configuration API # which might not be directly available in the Python SDK # We'll use the work item type to get transition info work_item_type_obj = self.work_item_tracking_client.get_work_item_type( project=project, type=work_item_type ) # Extract transition rules if available transitions = [] if hasattr(work_item_type_obj, 'transitions') and work_item_type_obj.transitions: transitions = [ { "to": getattr(transition, 'to', None), "actions": getattr(transition, 'actions', []) } for transition in work_item_type_obj.transitions if hasattr(transition, 'from') and getattr(transition, 'from', None) == from_state ] else: # Fallback: return all available states as potential transitions if hasattr(work_item_type_obj, 'states') and work_item_type_obj.states: transitions = [ { "to": state.name, "actions": [] } for state in work_item_type_obj.states if state.name != from_state ] return transitions except Exception as e: # Fallback: return empty transitions with error info return {"error": str(e), "transitions": []}
  • Registers the 'get_work_item_transitions' tool with the MCP server, including its description and input schema definition.
    types.Tool( name="get_work_item_transitions", description="Get valid state transitions for a work item type from a specific state to ensure proper workflow.", 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 (e.g., 'Bug', 'User Story', 'Task')." }, "from_state": { "type": "string", "description": "The current state to get valid transitions from." }, }, "required": ["project", "work_item_type", "from_state"], "additionalProperties": False } ),
  • Server-side dispatch handler that routes the tool call to the AzureDevOpsClient's implementation method.
    elif name == "get_work_item_transitions": return self.client.get_work_item_transitions(**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