Skip to main content
Glama

update_work_item

Modify work items in Azure DevOps by updating fields and managing relationships between items to track progress and dependencies.

Instructions

Updates a work item by its ID with field changes and relation management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
work_item_idYesThe ID of the work item to update.
updatesYesA dictionary of fields to update.
relationsNoA list of relations to other work items.

Implementation Reference

  • Core handler function that constructs the JSON patch operations for field updates and relations, then invokes the Azure DevOps API to update the work item.
    def update_work_item(self, work_item_id, updates, relations=None):
        patch_document = [
            JsonPatchOperation(
                op="add",
                path=f"/fields/{field}",
                value=value
            ) for field, value in updates.items()
        ]
    
        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.update_work_item(
            document=patch_document,
            id=work_item_id
        )
  • Defines the input schema and description for the update_work_item tool, specifying parameters work_item_id, updates, and optional relations.
    types.Tool(
        name="update_work_item",
        description="Updates a work item by its ID with field changes and relation management.",
        inputSchema={
            "type": "object",
            "properties": {
                "work_item_id": {
                    "type": "integer", 
                    "description": "The ID of the work item to update."
                },
                "updates": {
                    "type": "object", 
                    "description": "A dictionary of fields to update."
                },
                "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": ["work_item_id", "updates"],
            "additionalProperties": False
        }
    ),
  • MCP server dispatch handler that calls the client.update_work_item method with tool arguments and formats the response.
    elif name == "update_work_item":
        work_item = self.client.update_work_item(**arguments)
        return {
            "id": work_item.id,
            "url": work_item.url,
            "title": work_item.fields.get('System.Title', 'N/A'),
            "state": work_item.fields.get('System.State', 'N/A')
        }
  • Registers the list of tools including update_work_item via the MCP list_tools handler.
    @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
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 offers minimal behavioral disclosure. It states this is an update operation (implying mutation) but doesn't cover permissions needed, whether changes are reversible, rate limits, error conditions, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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 front-loads the core purpose. Every word earns its place: 'Updates' (action), 'a work item' (resource), 'by its ID' (key identifier), 'with field changes and relation management' (scope). There's no redundancy or unnecessary elaboration.

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 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't address behavioral aspects like authentication requirements, side effects, error handling, or response format. While the schema covers parameters well, the overall context for safe and effective tool invocation remains poorly documented.

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 already documents all three parameters thoroughly. The description adds marginal value by mentioning 'field changes' (mapping to 'updates') and 'relation management' (mapping to 'relations'), but doesn't provide additional syntax, format details, or examples beyond what the schema already specifies. 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 ('Updates') and resource ('a work item'), specifying it's done by ID with field changes and relation management. It distinguishes from siblings like 'create_work_item' (creation vs update) and 'delete_work_item' (update vs deletion), though doesn't explicitly differentiate from 'update_wiki_page' which updates 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 prerequisites (e.g., needing an existing work item ID), when to choose this over 'create_work_item' or other update tools, or any constraints on usage context. The agent must infer usage from the tool name alone.

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

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