Skip to main content
Glama
stefanskiasan

Azure DevOps MCP Server for Cline

update_work_item

Modify Azure DevOps work items by applying JSON patch operations to update fields, status, or other attributes.

Instructions

Update an existing work item using JSON patch operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the work item to update
documentYesArray of JSON patch operations to apply

Implementation Reference

  • The main handler function that executes the update_work_item tool, validating inputs, initializing Azure DevOps connection, calling the API to update the work item, and returning the result.
    export async function updateWorkItem(args: { id: number; document: JsonPatchOperation[] }, config: AzureDevOpsConfig) { if (!args.id || !args.document || !args.document.length) { throw new McpError(ErrorCode.InvalidParams, 'Work item ID and patch document are required'); } AzureDevOpsConnection.initialize(config); const connection = AzureDevOpsConnection.getInstance(); const workItemTrackingApi = await connection.getWorkItemTrackingApi(); const workItem = await workItemTrackingApi.updateWorkItem( undefined, args.document, args.id, config.project ); return { content: [ { type: 'text', text: JSON.stringify(workItem, null, 2), }, ], }; }
  • Input schema definition for the update_work_item tool, including name, description, and validation rules for id and document parameters.
    { name: 'update_work_item', description: 'Update an existing work item using JSON patch operations', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'ID of the work item to update', }, document: { type: 'array', items: { type: 'object', properties: { op: { type: 'string', enum: ['add', 'remove', 'replace', 'move', 'copy', 'test'], description: 'The patch operation to perform', }, path: { type: 'string', description: 'The path for the operation (e.g., /fields/System.Title)', }, value: { description: 'The value for the operation', }, }, required: ['op', 'path'], }, description: 'Array of JSON patch operations to apply', }, }, required: ['id', 'document'], }, },
  • Registration of the workItemTools, including the updateWorkItem handler wrapper and shared definitions array containing the tool schema.
    export const workItemTools = { initialize: (config: AzureDevOpsConfig) => ({ getWorkItem: (args: WorkItemBatchGetRequest) => getWorkItem(args, config), listWorkItems: (args: Wiql) => listWorkItems(args, config), createWorkItem: (args: { type: string; document: JsonPatchOperation[] }) => createWorkItem(args, config), updateWorkItem: (args: { id: number; document: JsonPatchOperation[] }) => updateWorkItem(args, config), definitions, }), definitions, };

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

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