Skip to main content
Glama

get_work_item

Retrieve a specific work item by ID from Azure DevOps, with options to expand field details for comprehensive project tracking.

Instructions

Gets a work item by its ID with optional field expansion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
work_item_idYesThe ID of the work item.
expandNoThe expand option for the work item. Use 'All' to get all fields.

Implementation Reference

  • The core handler function that fetches the work item from Azure DevOps API using the Work Item Tracking client, formats the fields and relations into a structured dictionary, and returns it.
    def get_work_item(self, work_item_id, expand=None):
        work_item = self.work_item_tracking_client.get_work_item(id=work_item_id, expand=expand)
        result = {
            "id": work_item.id,
            "url": work_item.url,
            "fields": work_item.fields
        }
        if work_item.relations:
            result["relations"] = [
                {
                    "rel": r.rel,
                    "url": r.url,
                    "attributes": r.attributes
                } for r in work_item.relations
            ]
        return result
  • The input schema definition for the 'get_work_item' tool, specifying work_item_id as required integer and optional expand string parameter.
    types.Tool(
        name="get_work_item",
        description="Gets a work item by its ID with optional field expansion.",
        inputSchema={
            "type": "object",
            "properties": {
                "work_item_id": {
                    "type": "integer", 
                    "description": "The ID of the work item."
                },
                "expand": {
                    "type": "string", 
                    "description": "The expand option for the work item. Use 'All' to get all fields."
                },
            },
            "required": ["work_item_id"],
            "additionalProperties": False
        }
    ),
  • The dispatch logic in the _execute_tool method that registers and routes the 'get_work_item' tool call to the AzureDevOpsClient instance method.
    elif name == "get_work_item":
        return self.client.get_work_item(**arguments)
Behavior2/5

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

With no annotations provided, the description carries full burden but only mentions optional field expansion. It lacks details on permissions, rate limits, error handling, or response format, which are critical for a read operation with potential expansions.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose and includes the key feature (field expansion) without any wasted words, making it highly concise and well-structured.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like what data is returned, how expansions work, or error cases, leaving gaps in understanding for effective agent use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds minimal value by noting 'optional field expansion' but doesn't explain the semantics of 'expand' beyond what the schema states, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the action ('Gets') and resource ('a work item by its ID'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'get_work_item_fields' or 'get_work_item_comments', which are more specific variants, so it lacks explicit sibling distinction.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention when to choose 'get_work_item' over 'search_work_items' or 'get_work_item_fields', leaving usage context unclear.

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

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