Skip to main content
Glama
Vortiago
by Vortiago

get_work_item_type_fields

Retrieve all fields for a specific work item type in Azure DevOps to identify available fields, required fields for creation, and reference names for queries or updates.

Instructions

Gets a list of all fields for a specific work item type. Use this tool when you need to: - See what fields are available for a work item type - Find required fields for creating work items of a specific type - Get reference names for fields to use in queries or updates Args: project: Project ID or project name type_name: The name of the work item type Returns: A formatted table of all fields with names, reference names, types, and required/read-only status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYes
type_nameYes

Implementation Reference

  • Core handler implementing the logic to retrieve work item type fields from Azure DevOps process API, format as markdown table, and handle errors.
    def _get_work_item_type_fields_impl(project: str, type_name: str, wit_client: WorkItemTrackingClient) -> str: """Implementation of work item type fields retrieval using process API.""" try: # Get the work item type to get its reference name wit = wit_client.get_work_item_type(project, type_name) if not wit: return (f"Work item type '{type_name}' not found in " f"project {project}.") wit_ref_name = wit.reference_name # Get project process info core_client = get_core_client() project_details = core_client.get_project( project, include_capabilities=True) process_id = project_details.capabilities.get( "processTemplate", {}).get("templateTypeId") if not process_id: return f"Could not determine process ID for project {project}" # Get process client and fields for this work item type process_client = get_work_item_tracking_process_client() fields = process_client.get_all_work_item_type_fields( process_id, wit_ref_name) if not fields: return (f"No fields found for work item type '{type_name}' " f"in project {project}.") headers = ["Name", "Reference Name", "Type", "Required", "Read Only"] # Simple table formatting rows = [ f"| {field.name} | {field.reference_name} | " + f"{getattr(field, 'type', 'N/A')} | " + f"{'Yes' if getattr(field, 'required', False) else 'No'} | " + f"{'Yes' if getattr(field, 'read_only', False) else 'No'} | " for field in fields ] return (f"# Fields for Work Item Type: {type_name}\n\n" + _format_table(headers, rows)) except Exception as e: return (f"Error retrieving fields for work item type '{type_name}' " f"in project '{project}': {str(e)}")
  • MCP tool registration with @mcp.tool() decorator, including input schema (type hints and docstring Args/Returns) and thin wrapper handler calling the core impl.
    @mcp.tool() def get_work_item_type_fields(project: str, type_name: str) -> str: """ Gets a list of all fields for a specific work item type. Use this tool when you need to: - See what fields are available for a work item type - Find required fields for creating work items of a specific type - Get reference names for fields to use in queries or updates Args: project: Project ID or project name type_name: The name of the work item type Returns: A formatted table of all fields with names, reference names, types, and required/read-only status """ try: wit_client = get_work_item_client() return _get_work_item_type_fields_impl( project, type_name, wit_client) except AzureDevOpsClientError as e: return f"Error: {str(e)}"
  • Helper utility to format lists into markdown tables, used in the output formatting of the tool.
    def _format_table(headers, rows): """Format data as a markdown table.""" result = [] result.append("| " + " | ".join(headers) + " |") result.append("| " + " | ".join(["----"] * len(headers)) + " |") result.extend(rows) return "\n".join(result)

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/Vortiago/mcp-azure-devops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server