Skip to main content
Glama
Vortiago
by Vortiago

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)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the tool as a read operation ('Gets'), which implies it's non-destructive and likely read-only, but doesn't explicitly state permission requirements, rate limits, or error behaviors. The description adds some context about what information is returned, but lacks comprehensive behavioral disclosure for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement, bulleted usage guidelines, and separate Args/Returns sections. Every sentence earns its place, though the bullet points could be slightly more concise. It's appropriately sized and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does a good job covering purpose, usage, and parameter semantics. It explains what information is returned ('Detailed information... including default field values'), though could benefit from more detail about the return structure. For a read-only tool with 2 parameters, it's reasonably complete but not exhaustive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate. It provides detailed semantics for both parameters: 'team_context' is explained as a dictionary with specific optional keys and their relationships, and 'template_id' is clearly defined. This adds significant meaning beyond the bare schema, fully documenting parameter purposes and usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Gets detailed information') and resource ('about a specific work item template'), distinguishing it from siblings like 'get_work_item_templates' (plural) which likely lists templates rather than providing details for one. The verb 'Gets' is precise and the scope is well-defined.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides three bullet points for when to use this tool ('View default field values', 'Understand what a template pre-populates', 'Get complete details'), offering clear context. While it doesn't explicitly state when not to use it or name alternatives, the specificity of these use cases effectively guides selection among siblings like 'get_work_item_templates' or 'get_work_item_type'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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