duplicate_time_entry
Generate a copy of a specific time entry in Clockify by providing the workspace ID, user ID, and time entry ID to streamline repetitive tracking tasks.
Instructions
Duplicate a time entry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Time entry ID to duplicate | |
| userId | Yes | User ID | |
| workspaceId | Yes | Workspace ID |
Implementation Reference
- src/index.ts:1013-1030 (handler)The handler function that implements the duplicate_time_entry tool. It extracts workspaceId, userId, and id from arguments, makes a POST request to the Clockify API's duplicate endpoint, and returns a success message with details of the new duplicated time 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:372-380 (schema)The input schema defining the parameters for the duplicate_time_entry tool: workspaceId, userId, and id (time entry ID), all required.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"], },
- src/index.ts:370-381 (registration)The tool registration in the listTools response, including name, description, and inputSchema.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"], }, },
- src/index.ts:746-748 (registration)The switch case in the CallToolRequestSchema handler that routes calls to the duplicateTimeEntry 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);