get_work_item_type
Retrieve detailed information about a specific work item type in Azure DevOps, including states, transitions, color, and icon, to understand its configuration and workflow.
Instructions
Gets detailed information about a specific work item type.
Use this tool when you need to:
- Get complete details about a work item type
- Understand the states and transitions for a work item type
- Learn about the color and icon for a work item type
Args:
project: Project ID or project name
type_name: The name of the work item type
Returns:
Detailed information about the work item type including states,
color, icon, and reference name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| type_name | Yes |
Implementation Reference
- MCP tool handler for 'get_work_item_type'. Obtains the WorkItemTrackingClient and delegates to the implementation function, handling errors.@mcp.tool() def get_work_item_type(project: str, type_name: str) -> str: """ Gets detailed information about a specific work item type. Use this tool when you need to: - Get complete details about a work item type - Understand the states and transitions for a work item type - Learn about the color and icon for a work item type Args: project: Project ID or project name type_name: The name of the work item type Returns: Detailed information about the work item type including states, color, icon, and reference name """ try: wit_client = get_work_item_client() return _get_work_item_type_impl(project, type_name, wit_client) except AzureDevOpsClientError as e: return f"Error: {str(e)}"
- Core helper function that calls the Azure DevOps WorkItemTrackingClient.get_work_item_type API and formats the result or handles not found case.def _get_work_item_type_impl(project: str, type_name: str, wit_client: WorkItemTrackingClient) -> str: """Implementation of work item type detail retrieval.""" work_item_type = wit_client.get_work_item_type(project, type_name) if not work_item_type: return f"Work item type '{type_name}' not found in project {project}." return _format_work_item_type(work_item_type)
- Helper function to format the work item type details into markdown, including description, attributes, and states.def _format_work_item_type(wit): """Format work item type data for display.""" result = [f"# Work Item Type: {wit.name}"] description = getattr(wit, "description", None) if description: result.append(f"\nDescription: {description}") for attr in ["color", "icon", "reference_name"]: value = getattr(wit, attr, None) if value: result.append(f"{attr.capitalize()}: {value}") is_disabled = getattr(wit, "is_disabled", None) if is_disabled is not None: result.append(f"Is Disabled: {is_disabled}") states = getattr(wit, "states", None) if states: result.append("\n## States") for state in states: state_info = f"- {state.name} (Category: {state.category}, " \ f"Color: {state.color})" order = getattr(state, "order", None) if order is not None: state_info += f", Order: {order}" result.append(state_info) return "\n".join(result)
- Registration point where types.register_tools(mcp) is called, which registers the get_work_item_type tool among others.def register_tools(mcp) -> None: """ Register all work item tools with the MCP server. Args: mcp: The FastMCP server instance """ query.register_tools(mcp) read.register_tools(mcp) comments.register_tools(mcp) create.register_tools(mcp) types.register_tools(mcp)
- src/mcp_azure_devops/features/work_items/__init__.py:5-12 (registration)Higher-level registration that calls tools.register_tools(mcp), leading to the work item types tools.def register(mcp): """ Register all work items components with the MCP server. Args: mcp: The FastMCP server instance """ tools.register_tools(mcp)