Skip to main content
Glama
aliyun

AlibabaCloud DevOps MCP Server

Official
by aliyun

update_work_item

Modify work item details like status, assignee, priority, and custom fields in Alibaba Cloud DevOps projects to track progress and manage tasks.

Instructions

[Project Management] Update a work item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdYesOrganization ID
workItemIdYesWork item ID
updateWorkItemFieldsYes

Implementation Reference

  • Handler for the update_work_item tool. Parses input arguments using UpdateWorkItemSchema and delegates to workitem.updateWorkItemFunc.
    case "update_work_item": {
      const args = types.UpdateWorkItemSchema.parse(request.params.arguments);
      await workitem.updateWorkItemFunc(
        args.organizationId,
        args.workItemId,
        args.updateWorkItemFields
      );
      return {
        content: [{ type: "text", text: "" }],
      };
    }
  • Zod schemas defining the input structure for update_work_item: UpdateWorkItemFieldSchema (fields to update) and UpdateWorkItemSchema (including organizationId and workItemId).
    export const UpdateWorkItemFieldSchema = z.object({
      subject: z.string().optional().describe("工作项标题"),
      description: z.string().optional().describe("工作项描述"),
      status: z.string().optional().describe("状态Id"),
      assignedTo: z.string().optional().describe("指派人userId"),
      priority: z.string().optional().describe("优先级Id"),
      labels: z.array(z.string()).optional().describe("关联的标签id列表"),
      sprint: z.string().optional().describe("关联的迭代Id"),
      trackers: z.array(z.string()).optional().describe("抄送人userId列表"),
      verifier: z.string().optional().describe("验证人userId"),
      participants: z.array(z.string()).optional().describe("参与人userId列表"),
      versions: z.array(z.string()).optional().describe("关联的版本Id列表"),
      customFieldValues: z.record(z.string(), z.any()).optional().describe("自定义字段值,格式为 {\"fieldId\": \"value\"} 或 {\"fieldId\": [\"value1\", \"value2\"]}"),
    });
    
    export const UpdateWorkItemSchema = z.object({
      organizationId: z.string().describe("Organization ID"),
      workItemId: z.string().describe("Work item ID"),
      updateWorkItemFields: UpdateWorkItemFieldSchema
    });
  • Registration of the update_work_item tool in the project-management tool registry, including name, description, and input schema reference.
      name: "update_work_item",
      description: "[Project Management] Update a work item",
      inputSchema: zodToJsonSchema(types.UpdateWorkItemSchema),
    },
  • Core helper function that implements the update logic: builds the request body from provided fields (including custom fields) and performs PUT request to the Yunxiao API endpoint.
    export async function updateWorkItemFunc(
        organizationId: string,
        workItemId: string,
        updateWorkItemFields: UpdateWorkItemField
    ): Promise<void> {
      const url = `/oapi/v1/projex/organizations/${organizationId}/workitems/${workItemId}`;
    
      // 构建请求体,将自定义字段合并到主对象中
      const requestBody: Record<string, any> = {};
    
      // 复制所有标准字段
      if (updateWorkItemFields.subject !== undefined) {
        requestBody.subject = updateWorkItemFields.subject;
      }
      if (updateWorkItemFields.description !== undefined) {
        requestBody.description = updateWorkItemFields.description;
      }
      if (updateWorkItemFields.status !== undefined) {
        requestBody.status = updateWorkItemFields.status;
      }
      if (updateWorkItemFields.assignedTo !== undefined) {
        requestBody.assignedTo = updateWorkItemFields.assignedTo;
      }
      if (updateWorkItemFields.priority !== undefined) {
        requestBody.priority = updateWorkItemFields.priority;
      }
      if (updateWorkItemFields.labels !== undefined) {
        requestBody.labels = updateWorkItemFields.labels;
      }
      if (updateWorkItemFields.sprint !== undefined) {
        requestBody.sprint = updateWorkItemFields.sprint;
      }
      if (updateWorkItemFields.trackers !== undefined) {
        requestBody.trackers = updateWorkItemFields.trackers;
      }
      if (updateWorkItemFields.verifier !== undefined) {
        requestBody.verifier = updateWorkItemFields.verifier;
      }
      if (updateWorkItemFields.participants !== undefined) {
        requestBody.participants = updateWorkItemFields.participants;
      }
      if (updateWorkItemFields.versions !== undefined) {
        requestBody.versions = updateWorkItemFields.versions;
      }
    
      // 处理自定义字段
      if (updateWorkItemFields.customFieldValues !== undefined) {
        // 将自定义字段合并到请求体中
        Object.entries(updateWorkItemFields.customFieldValues).forEach(([fieldId, value]) => {
          requestBody[fieldId] = value;
        });
      }
    
      const response = await yunxiaoRequest(url, {
        method: "PUT",
        body: requestBody,
      });
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Update a work item,' implying a mutation operation, but doesn't disclose any behavioral traits such as required permissions, whether updates are reversible, rate limits, or what happens to unspecified fields. This leaves critical gaps for a tool that modifies data.

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 extremely concise at just one sentence with a bracketed domain hint, making it front-loaded and waste-free. Every word serves a purpose, though it may be overly terse for clarity. It efficiently communicates the core action without 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?

Given the tool's complexity (3 parameters with nested objects, no output schema, and no annotations), the description is incomplete. It doesn't explain what 'update' entails behaviorally, lacks usage context, and omits details about return values or error handling. For a mutation tool with rich input schema, this minimal description fails to provide adequate guidance for an AI agent.

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 description adds no parameter information beyond what the input schema provides. With a schema description coverage of 67%, the schema documents most parameters well (e.g., 'organizationId,' 'workItemId,' and fields in 'updateWorkItemFields'), but the description doesn't compensate for the 33% gap or add context like field dependencies. The baseline score of 3 reflects adequate schema coverage without description enhancement.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '[Project Management] Update a work item' states the verb ('Update') and resource ('work item') with a domain context hint ('Project Management'), providing a basic purpose. However, it's vague about what 'update' entails and doesn't distinguish from sibling tools like 'update_effort_record' or 'update_sprint' beyond the resource name. It lacks specificity about the scope of updates possible.

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), exclusions, or related tools like 'create_work_item' or 'get_work_item' for context. The agent must infer usage from the tool name alone, which is insufficient for informed selection.

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/aliyun/alibabacloud-devops-mcp-server'

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