get_work_item_fields
Retrieve all work item fields and their metadata from an Azure DevOps project to enable accurate field mapping and updates.
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 fetches work item fields from the Azure DevOps API for a given project and formats them into a list of dictionaries with metadata.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 (schema)The input schema definition for the 'get_work_item_fields' tool, specifying that a 'project' string parameter is required.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 (registration)The dispatch/registration point in the tool execution handler where calls to 'get_work_item_fields' are routed to the client method.elif name == "get_work_item_fields": return self.client.get_work_item_fields(**arguments)