get_work_item
Retrieve work item details from Alibaba Cloud DevOps to access project information and track development tasks.
Instructions
[Project Management] Get information about a work item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | Organization ID, can be found in the basic information page of the organization admin console | |
| workItemId | Yes | Work item unique identifier, required parameter |
Implementation Reference
- MCP tool handler implementation for 'get_work_item': parses input arguments using GetWorkItemSchema, calls the helper function getWorkItemFunc, and formats the response as JSON text.case "get_work_item": { const args = types.GetWorkItemSchema.parse(request.params.arguments); const workItemInfo = await workitem.getWorkItemFunc( args.organizationId, args.workItemId ); return { content: [{ type: "text", text: JSON.stringify(workItemInfo, null, 2) }], }; }
- operations/projex/workitem.ts:17-28 (helper)Core helper function that performs the actual API call to retrieve work item details from the Yunxiao Projex API and parses the response using WorkItemSchema.export async function getWorkItemFunc( organizationId: string, workItemId: string ): Promise<z.infer<typeof WorkItemSchema>> { const url = `/oapi/v1/projex/organizations/${organizationId}/workitems/${workItemId}`; const response = await yunxiaoRequest(url, { method: "GET", }); return WorkItemSchema.parse(response); }
- operations/projex/types.ts:266-269 (schema)Zod input schema definition (GetWorkItemSchema) used for validating tool arguments: organizationId and workItemId.export const GetWorkItemSchema = z.object({ organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"), workItemId: z.string().describe("Work item unique identifier, required parameter"), });
- tool-registry/project-management.ts:42-45 (registration)Tool registration entry defining the tool name 'get_work_item', description, and input schema for MCP tool registry.name: "get_work_item", description: "[Project Management] Get information about a work item", inputSchema: zodToJsonSchema(types.GetWorkItemSchema), },