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,
    };
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. While 'Update' implies a mutation operation, it doesn't specify whether this requires special permissions, what happens on partial failures, whether operations are atomic, or what the typical response format looks like. The mention of 'JSON patch operations' adds some technical context but doesn't explain behavioral implications like whether all operations in the array are applied transactionally.

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 communicates the essential information without any wasted words. It's front-loaded with the core action and immediately specifies the technical approach (JSON patch). Every element of the description serves a clear purpose in conveying the tool's function.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and technical approach but lacks important context about permissions, error handling, response format, and when to use this versus alternatives. The 100% schema coverage helps, but behavioral aspects remain underspecified for a tool that modifies data.

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 has 100% description coverage, providing detailed documentation for both parameters. The description adds the context that updates use 'JSON patch operations' which helps interpret the 'document' parameter's structure, but doesn't provide additional semantic meaning beyond what's already in the schema descriptions. This meets the baseline for high schema 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 verb ('Update') and resource ('an existing work item'), making the purpose immediately understandable. It distinguishes from sibling tools like 'create_work_item' by specifying it updates existing items rather than creating new ones. However, it doesn't explicitly differentiate from 'update_wiki_page' which follows a similar pattern but for different resources.

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. It doesn't mention when to choose this over 'create_work_item' for modifications, or whether it should be used instead of other update operations. There's no context about prerequisites, dependencies, or typical use cases for JSON patch operations versus simpler updates.

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

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