Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

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

Implementation Reference

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

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