Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesTime entry ID to duplicate
userIdYesUser ID
workspaceIdYesWorkspace ID

Implementation Reference

  • 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, }; }
  • 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);

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/ratheesh-aot/clockify-mcp'

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