duplicate_time_entry
Copy an existing time entry in Clockify to replicate tracking for similar tasks or projects, saving manual entry time.
Instructions
Duplicate a time entry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| userId | Yes | User ID | |
| id | Yes | Time entry ID to duplicate |
Implementation Reference
- src/index.ts:1013-1030 (handler)The main handler function for the 'duplicate_time_entry' tool. It extracts workspaceId, userId, and id from input arguments, performs a POST request to the Clockify API endpoint to duplicate the specified time entry, and returns a success response with details of the duplicated entry.private async duplicateTimeEntry(args: any) { const { workspaceId, userId, id } = args; const result = await this.makeRequest( `/workspaces/${workspaceId}/user/${userId}/time-entries/${id}/duplicate`, "POST" ); return { content: [ { type: "text", text: `Time entry duplicated successfully!\nID: ${result.id}\nDescription: ${result.description || "No description"}\nStart: ${result.timeInterval.start}\nEnd: ${result.timeInterval.end || "Ongoing"}\nDuration: ${result.timeInterval.duration || "N/A"}\nBillable: ${result.billable}\nProject: ${result.projectId || "No project"}`, }, ], isError: false, }; }
- src/index.ts:746-748 (registration)The switch case in the CallToolRequestHandler that handles incoming calls to 'duplicate_time_entry' by validating parameters and invoking the duplicateTimeEntry handler method.case "duplicate_time_entry": if (!args?.workspaceId || !args?.userId || !args?.id) throw new McpError(ErrorCode.InvalidParams, 'workspaceId, userId and id are required'); return await this.duplicateTimeEntry(args as any);
- src/index.ts:370-381 (schema)The tool registration entry in the listTools response, defining the name, description, and input schema (parameters and required fields) for the 'duplicate_time_entry' tool.name: "duplicate_time_entry", description: "Duplicate a time entry", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, userId: { type: "string", description: "User ID" }, id: { type: "string", description: "Time entry ID to duplicate" }, }, required: ["workspaceId", "userId", "id"], }, },