get_work_item_fields
Retrieve all work item fields and their metadata from Azure DevOps projects to enable accurate field updates and data management.
Instructions
Get all work item fields available in a project with metadata for smart field updates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | The name or ID of the project. |
Implementation Reference
- The core handler function that retrieves all work item fields for a given project using the Azure DevOps Work Item Tracking client, formats them into structured dictionaries with metadata like name, reference name, type, description, read-only status, and sortability.def get_work_item_fields(self, project): """ Get all work item fields available in a project. """ fields = self.work_item_tracking_client.get_fields(project=project) return [ { "name": field.name, "reference_name": field.reference_name, "type": getattr(field, 'type', None), "description": getattr(field, 'description', None), "read_only": getattr(field, 'read_only', False), "can_sort_by": getattr(field, 'can_sort_by', False) } for field in fields ]
- mcp_azure_devops/server.py:269-283 (registration)The tool registration in the MCP server, defining the tool name, description, and input schema requiring a 'project' parameter.types.Tool( name="get_work_item_fields", description="Get all work item fields available in a project with metadata for smart field updates.", inputSchema={ "type": "object", "properties": { "project": { "type": "string", "description": "The name or ID of the project." }, }, "required": ["project"], "additionalProperties": False } ),
- mcp_azure_devops/server.py:947-948 (helper)Dispatch helper in the MCP server's _execute_tool method that calls the client handler with unpacked arguments when the tool name matches.elif name == "get_work_item_fields": return self.client.get_work_item_fields(**arguments)
- mcp_azure_devops/server.py:272-282 (schema)Input schema definition for the tool, specifying an object with a required 'project' string property.inputSchema={ "type": "object", "properties": { "project": { "type": "string", "description": "The name or ID of the project." }, }, "required": ["project"], "additionalProperties": False }