Skip to main content
Glama
Tiberriver256

Azure DevOps MCP Server

update_work_item

Modify existing Azure DevOps work items by updating fields like title, description, assigned user, priority, state, area path, and iteration path to track project progress.

Instructions

Update an existing work item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workItemIdYesThe ID of the work item to update
titleNoThe updated title of the work item
descriptionNoWork item description in HTML format. Multi-line text fields (i.e., System.History, AcceptanceCriteria, etc.) must use HTML format. Do not use CDATA tags.
assignedToNoThe email or name of the user to assign the work item to
areaPathNoThe updated area path for the work item
iterationPathNoThe updated iteration path for the work item
priorityNoThe updated priority of the work item
stateNoThe updated state of the work item
additionalFieldsNoAdditional fields to update on the work item. Multi-line text fields (i.e., System.History, AcceptanceCriteria, etc.) must use HTML format. Do not use CDATA tags.

Implementation Reference

  • Core handler function that executes the update_work_item tool logic by constructing a JSON patch document and calling the Azure DevOps WorkItemTrackingApi.updateWorkItem method.
    export async function updateWorkItem(
      connection: WebApi,
      workItemId: number,
      options: UpdateWorkItemOptions,
    ): Promise<WorkItem> {
      try {
        const witApi = await connection.getWorkItemTrackingApi();
    
        // Create the JSON patch document
        const document = [];
    
        // Add optional fields if provided
        if (options.title) {
          document.push({
            op: 'add',
            path: '/fields/System.Title',
            value: options.title,
          });
        }
    
        if (options.description) {
          document.push({
            op: 'add',
            path: '/fields/System.Description',
            value: options.description,
          });
        }
    
        if (options.assignedTo) {
          document.push({
            op: 'add',
            path: '/fields/System.AssignedTo',
            value: options.assignedTo,
          });
        }
    
        if (options.areaPath) {
          document.push({
            op: 'add',
            path: '/fields/System.AreaPath',
            value: options.areaPath,
          });
        }
    
        if (options.iterationPath) {
          document.push({
            op: 'add',
            path: '/fields/System.IterationPath',
            value: options.iterationPath,
          });
        }
    
        if (options.priority) {
          document.push({
            op: 'add',
            path: '/fields/Microsoft.VSTS.Common.Priority',
            value: options.priority,
          });
        }
    
        if (options.state) {
          document.push({
            op: 'add',
            path: '/fields/System.State',
            value: options.state,
          });
        }
    
        // Add any additional fields
        if (options.additionalFields) {
          for (const [key, value] of Object.entries(options.additionalFields)) {
            document.push({
              op: 'add',
              path: `/fields/${key}`,
              value: value,
            });
          }
        }
    
        // If no fields to update, throw an error
        if (document.length === 0) {
          throw new Error('At least one field must be provided for update');
        }
    
        // Update the work item
        const updatedWorkItem = await witApi.updateWorkItem(
          {}, // customHeaders
          document,
          workItemId,
          undefined, // project
          false, // validateOnly
          false, // bypassRules
          false, // suppressNotifications
          WorkItemExpand.All, // expand
        );
    
        if (!updatedWorkItem) {
          throw new AzureDevOpsResourceNotFoundError(
            `Work item '${workItemId}' not found`,
          );
        }
    
        return updatedWorkItem;
      } catch (error) {
        if (error instanceof AzureDevOpsError) {
          throw error;
        }
        throw new Error(
          `Failed to update work item: ${error instanceof Error ? error.message : String(error)}`,
        );
      }
    }
  • Zod schema defining the input parameters and validation for the update_work_item tool.
    export const UpdateWorkItemSchema = z.object({
      workItemId: z.number().describe('The ID of the work item to update'),
      title: z.string().optional().describe('The updated title of the work item'),
      description: z
        .string()
        .optional()
        .describe(
          'Work item description in HTML format. Multi-line text fields (i.e., System.History, AcceptanceCriteria, etc.) must use HTML format. Do not use CDATA tags.',
        ),
      assignedTo: z
        .string()
        .optional()
        .describe('The email or name of the user to assign the work item to'),
      areaPath: z
        .string()
        .optional()
        .describe('The updated area path for the work item'),
      iterationPath: z
        .string()
        .optional()
        .describe('The updated iteration path for the work item'),
      priority: z
        .number()
        .optional()
        .describe('The updated priority of the work item'),
      state: z.string().optional().describe('The updated state of the work item'),
      additionalFields: z
        .record(z.string(), z.any())
        .optional()
        .describe(
          'Additional fields to update on the work item. Multi-line text fields (i.e., System.History, AcceptanceCriteria, etc.) must use HTML format. Do not use CDATA tags.',
        ),
    });
  • ToolDefinition object registering the update_work_item tool with name, description, and input schema.
    {
      name: 'update_work_item',
      description: 'Update an existing work item',
      inputSchema: zodToJsonSchema(UpdateWorkItemSchema),
    },
  • Dispatch handler in the work items request router that parses arguments with the schema and calls the core updateWorkItem function.
    case 'update_work_item': {
      const args = UpdateWorkItemSchema.parse(request.params.arguments);
      const result = await updateWorkItem(connection, args.workItemId, {
        title: args.title,
        description: args.description,
        assignedTo: args.assignedTo,
        areaPath: args.areaPath,
        iterationPath: args.iterationPath,
        priority: args.priority,
        state: args.state,
        additionalFields: args.additionalFields,
      });
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states it's an update operation. It doesn't mention whether this requires specific permissions, what happens to fields not included in the update, whether changes are reversible, or any rate limits. For a mutation tool with zero annotation coverage, this is insufficient.

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, clear sentence with zero wasted words. It's front-loaded with the essential information and doesn't include any unnecessary details, making it highly efficient and easy to parse.

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 mutation tool with 9 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, or behavioral nuances. The schema handles parameter documentation, but the description fails to provide necessary context for safe and effective 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?

The schema description coverage is 100%, so all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's in the schema, which is acceptable but not additive. The baseline score of 3 reflects adequate coverage through the schema alone.

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 ('Update') and resource ('an existing work item'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'update_pull_request' or 'update_wiki_page' beyond the resource type, which keeps it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_work_item' or 'get_work_item', nor does it mention prerequisites such as needing an existing work item ID. It simply states what the tool does without contextual usage information.

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

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