Skip to main content
Glama

get_work_item

Retrieve Azure DevOps work items by ID to access project details, with optional field expansion for comprehensive information retrieval.

Instructions

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

Input Schema

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

Implementation Reference

  • Core handler implementation: fetches the work item using the Azure DevOps Work Item Tracking client and formats the response including ID, URL, fields, and relations.
    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
  • Tool dispatch handler in _execute_tool method that invokes the client.get_work_item with parsed arguments.
    elif name == "get_work_item": return self.client.get_work_item(**arguments)
  • Input schema validation for the tool parameters: work_item_id (integer, required), expand (string, optional).
    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 }
  • Tool registration in the self.tools list, which is returned by the list_tools handler for MCP protocol.
    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 } ),

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