create_effort_record
Log actual work hours for project tasks in Alibaba Cloud DevOps to track time spent on specific work items with start/end dates and descriptions.
Instructions
[Project Management] 登记实际工时
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | 工作项唯一标识 | |
| organizationId | Yes | organizationId | |
| actualTime | Yes | 实际工时 | |
| description | No | 工作描述 | |
| gmtEnd | Yes | 工作开始结束日期 | |
| gmtStart | Yes | 工作开始日期 | |
| operatorId | No | 操作者的useId,个人token时该参数无效 | |
| workType | No | 工作类型 |
Implementation Reference
- tool-handlers/effort.ts:29-44 (handler)MCP tool handler switch case for 'create_effort_record': validates input using CreateEffortRecordSchema and calls effort.createEffortRecord from operations/projex/effort.tscase "create_effort_record": { const args = types.CreateEffortRecordSchema.parse(request.params.arguments); const result = await effort.createEffortRecord({ id: args.id, organizationId: args.organizationId, actualTime: args.actualTime, description: args.description, gmtEnd: args.gmtEnd, gmtStart: args.gmtStart, operatorId: args.operatorId, workType: args.workType }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- tool-registry/effort.ts:23-27 (registration)Registration of the 'create_effort_record' tool in getEffortTools array, specifying name, description, and input schema{ name: "create_effort_record", description: "[Project Management] 登记实际工时", inputSchema: zodToJsonSchema(CreateEffortRecordSchema), },
- operations/projex/effort.ts:51-74 (helper)Core helper function implementing createEffortRecord: API POST to create effort record via yunxiaoRequest, using CreateEffortRecordRequestSchemaexport async function createEffortRecord( params: z.infer<typeof CreateEffortRecordRequestSchema> & { id: string; organizationId: string; } ) { const validatedParams = CreateEffortRecordRequestSchema.parse({ actualTime: params.actualTime, description: params.description, gmtEnd: params.gmtEnd, gmtStart: params.gmtStart, operatorId: params.operatorId, workType: params.workType }); const url = `/oapi/v1/projex/organizations/${params.organizationId}/workitems/${params.id}/effortRecords`; const response = await yunxiaoRequest(url, { method: "POST", body: validatedParams }); return IdentifierDTOSchema.parse(response); }
- operations/projex/types.ts:522-531 (schema)Input schema CreateEffortRecordSchema: Zod object used for tool argument validation in handler and registrationexport const CreateEffortRecordSchema = z.object({ id: z.string().describe("工作项唯一标识"), organizationId: z.string().describe("organizationId"), actualTime: z.number().positive().describe("实际工时"), description: z.string().max(500).optional().describe("工作描述"), gmtEnd: z.string().describe("工作开始结束日期"), gmtStart: z.string().describe("工作开始日期"), operatorId: z.string().optional().describe("操作者的useId,个人token时该参数无效"), workType: z.string().optional().describe("工作类型"), });
- operations/projex/types.ts:493-500 (schema)Internal API request schema CreateEffortRecordRequestSchema: Zod object used for validating body in createEffortRecord helperexport const CreateEffortRecordRequestSchema = z.object({ actualTime: z.number().positive().describe("实际工时"), description: z.string().max(500).optional().describe("工作描述"), gmtEnd: z.string().describe("工作开始结束日期"), gmtStart: z.string().describe("工作开始日期"), operatorId: z.string().optional().describe("操作者的useId,个人token时该参数无效"), workType: z.string().optional().describe("工作类型"), });