Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

wit_update_work_item

Modifies specific fields of a work item in Azure DevOps using its ID. Supports add, replace, and remove operations for field updates via PAT authentication.

Instructions

Update a work item by ID with specified fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the work item to update.
updatesYesAn array of field updates to apply to the work item.

Implementation Reference

  • The handler function that updates the specified work item ID with the provided patch operations using the Azure DevOps WorkItemTrackingApi.updateWorkItem method.
    async ({ id, updates }) => {
      const connection = await connectionProvider();
      const workItemApi = await connection.getWorkItemTrackingApi();
    
      // Convert operation names to lowercase for API
      const apiUpdates = updates.map((update) => ({
        ...update,
        op: update.op,
      }));
    
      const updatedWorkItem = await workItemApi.updateWorkItem(null, apiUpdates, id);
    
      return {
        content: [{ type: "text", text: JSON.stringify(updatedWorkItem, null, 2) }],
      };
    }
  • Zod input schema defining parameters: id (number) and updates (array of patch operations with op, path, value).
    {
      id: z.number().describe("The ID of the work item to update."),
      updates: z
        .array(
          z.object({
            op: z
              .string()
              .transform((val) => val.toLowerCase())
              .pipe(z.enum(["add", "replace", "remove"]))
              .default("add")
              .describe("The operation to perform on the field."),
            path: z.string().describe("The path of the field to update, e.g., '/fields/System.Title'."),
            value: z.string().describe("The new value for the field. This is required for 'Add' and 'Replace' operations, and should be omitted for 'Remove' operations."),
          })
        )
        .describe("An array of field updates to apply to the work item."),
    },
  • The server.tool call that registers the 'wit_update_work_item' tool, referencing WORKITEM_TOOLS.update_work_item, with description, schema, and handler.
    server.tool(
      WORKITEM_TOOLS.update_work_item,
      "Update a work item by ID with specified fields.",
      {
        id: z.number().describe("The ID of the work item to update."),
        updates: z
          .array(
            z.object({
              op: z
                .string()
                .transform((val) => val.toLowerCase())
                .pipe(z.enum(["add", "replace", "remove"]))
                .default("add")
                .describe("The operation to perform on the field."),
              path: z.string().describe("The path of the field to update, e.g., '/fields/System.Title'."),
              value: z.string().describe("The new value for the field. This is required for 'Add' and 'Replace' operations, and should be omitted for 'Remove' operations."),
            })
          )
          .describe("An array of field updates to apply to the work item."),
      },
      async ({ id, updates }) => {
        const connection = await connectionProvider();
        const workItemApi = await connection.getWorkItemTrackingApi();
    
        // Convert operation names to lowercase for API
        const apiUpdates = updates.map((update) => ({
          ...update,
          op: update.op,
        }));
    
        const updatedWorkItem = await workItemApi.updateWorkItem(null, apiUpdates, id);
    
        return {
          content: [{ type: "text", text: JSON.stringify(updatedWorkItem, null, 2) }],
        };
      }
    );
  • Constant mapping the handler name 'update_work_item' to the tool name 'wit_update_work_item' in WORKITEM_TOOLS object.
    update_work_item: "wit_update_work_item",
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it's an update operation. It doesn't disclose behavioral traits like whether it requires specific permissions, if updates are reversible, what happens on errors, rate limits, or response format. This is a significant gap for a mutation tool.

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 with zero waste. It's front-loaded with the core action and includes essential details (by ID, with fields) without redundancy.

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 no annotations and no output schema, the description is incomplete. It lacks information about behavioral aspects, error handling, permissions, and what the tool returns. Given the complexity of updating work items, more context is needed.

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?

Schema description coverage is 100%, so the schema fully documents the 'id' and 'updates' parameters. The description adds no additional meaning beyond implying field updates, which is already covered in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('work item'), specifying it's done by ID with fields. It distinguishes from siblings like wit_create_work_item (creation) and wit_get_work_item (retrieval), but doesn't explicitly differentiate from wit_update_work_items_batch (batch updates).

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?

No guidance on when to use this tool versus alternatives like wit_update_work_items_batch for multiple items or wit_create_work_item for new items. It mentions 'by ID' and 'specified fields' but lacks context about prerequisites, permissions, or typical use cases.

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

Related 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/ennuiii/DevOpsMcpPAT'

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