Skip to main content
Glama

create_work_item

Create new work items like Epics, User Stories, Tasks, or Bugs in Azure DevOps projects, with support for linking related items to organize development work.

Instructions

Creates a new work item in Azure DevOps. Supports Epic, User Story, Task, Bug, and work item linking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesThe name or ID of the project.
work_item_typeYesThe type of work item (e.g., 'Bug', 'User Story', 'Task', 'Epic').
titleYesThe title of the work item.
descriptionYesThe description of the work item.
relationsNoA list of relations to other work items.

Implementation Reference

  • MCP tool dispatch handler for 'create_work_item' that calls the client method and returns formatted result.
    elif name == "create_work_item": work_item = self.client.create_work_item(**arguments) return { "id": work_item.id, "url": work_item.url, "title": work_item.fields.get('System.Title', 'N/A') }
  • Input schema definition for the create_work_item tool, defining parameters and validation rules.
    types.Tool( name="create_work_item", description="Creates a new work item in Azure DevOps. Supports Epic, User Story, Task, Bug, and work item linking.", inputSchema={ "type": "object", "properties": { "project": { "type": "string", "description": "The name or ID of the project." }, "work_item_type": { "type": "string", "description": "The type of work item (e.g., 'Bug', 'User Story', 'Task', 'Epic')." }, "title": { "type": "string", "description": "The title of the work item." }, "description": { "type": "string", "description": "The description of the work item." }, "relations": { "type": "array", "description": "A list of relations to other work items.", "items": { "type": "object", "properties": { "rel": { "type": "string", "description": "The relation type (e.g., 'System.LinkTypes.Dependency-Forward')." }, "url": { "type": "string", "description": "The URL of the related work item." } }, "required": ["rel", "url"] } } }, "required": ["project", "work_item_type", "title", "description"], "additionalProperties": False } ),
  • MCP list_tools handler that registers and returns the list of tools including create_work_item.
    @self.server.list_tools() async def list_tools() -> List[types.Tool]: """Return the list of available tools.""" logger.info(f"Tools requested - returning {len(self.tools)} tools") self.tools_registered = True return self.tools
  • Core helper method in AzureDevOpsClient that implements the work item creation using Azure DevOps SDK JsonPatchOperations.
    def create_work_item(self, project, work_item_type, title, description, relations=None): patch_document = [ JsonPatchOperation( op="add", path="/fields/System.Title", value=title ), JsonPatchOperation( op="add", path="/fields/System.Description", value=description ) ] if relations: for relation in relations: patch_document.append( JsonPatchOperation( op="add", path="/relations/-", value={ "rel": relation["rel"], "url": relation["url"] } ) ) return self.work_item_tracking_client.create_work_item( document=patch_document, project=project, type=work_item_type )

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