Skip to main content
Glama

get_work_item_template

Retrieve detailed work item templates from Azure DevOps to view default field values and understand pre-populated content for consistent project tracking.

Instructions

Gets detailed information about a specific work item template. Use this tool when you need to: - View default field values in a template - Understand what a template pre-populates in a work item - Get complete details about a template Args: team_context: Dictionary containing team information with keys: project: Project name (Optional if project_id is provided) project_id: Project ID (Optional if project is provided) team: Team name (Optional if team_id is provided) team_id: Team ID (Optional if team is provided) template_id: The ID of the template Returns: Detailed information about the template including default field values

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_contextYes
template_idYes

Implementation Reference

  • Primary MCP tool handler for get_work_item_template. Registers the tool via @mcp.tool() decorator and implements the core logic by calling the helper implementation.
    @mcp.tool() def get_work_item_template(team_context: dict, template_id: str) -> str: """ Gets detailed information about a specific work item template. Use this tool when you need to: - View default field values in a template - Understand what a template pre-populates in a work item - Get complete details about a template Args: team_context: Dictionary containing team information with keys: project: Project name (Optional if project_id is provided) project_id: Project ID (Optional if project is provided) team: Team name (Optional if team_id is provided) team_id: Team ID (Optional if team is provided) template_id: The ID of the template Returns: Detailed information about the template including default field values """ try: wit_client = get_work_item_client() return _get_work_item_template_impl( team_context, template_id, wit_client) except AzureDevOpsClientError as e: return f"Error: {str(e)}"
  • Core implementation logic that fetches the template using Azure DevOps WorkItemTrackingClient and formats it using _format_work_item_template.
    def _get_work_item_template_impl(team_context: dict, template_id: str, wit_client: WorkItemTrackingClient) -> str: """Implementation of work item template detail retrieval.""" try: team_ctx = _create_team_context(team_context) template = wit_client.get_template(team_ctx, template_id) if not template: return f"Template with ID '{template_id}' not found." return _format_work_item_template(template) except Exception as e: return f"Error retrieving template '{template_id}': {str(e)}"
  • Helper function to format the retrieved template data into a readable markdown string.
    def _format_work_item_template(template): """Format work item template data for display.""" result = [f"# Template: {template.name}"] for attr in ["description", "work_item_type_name", "id"]: value = getattr(template, attr, None) if value: result.append(f"{attr.replace('_', ' ').capitalize()}: {value}") fields = getattr(template, "fields", None) if fields: result.append("\n## Default Field Values") for field, value in fields.items(): result.append(f"- {field}: {value}") return "\n".join(result)
  • Registration call for the templates module, which defines and registers the get_work_item_template tool.
    templates.register_tools(mcp)
  • Top-level registration call for all work_items tools, invoking the tools/__init__.py register_tools which includes templates.
    tools.register_tools(mcp)

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