delete_time_entry
Remove a time entry from the Clockify workspace by specifying the workspace ID and time entry ID to correct tracking errors or delete unwanted records.
Instructions
Delete a time entry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Workspace ID | |
| timeEntryId | Yes | Time entry ID |
Implementation Reference
- src/index.ts:975-990 (handler)The main handler function for the 'delete_time_entry' tool. It sends a DELETE request to the Clockify API to remove the specified time entry and returns a success message.private async deleteTimeEntry(workspaceId: string, timeEntryId: string) { await this.makeRequest( `/workspaces/${workspaceId}/time-entries/${timeEntryId}`, "DELETE" ); return { content: [ { type: "text", text: `Time entry ${timeEntryId} deleted successfully!`, }, ], isError: false, }; }
- src/index.ts:347-354 (schema)Input schema for the 'delete_time_entry' tool, defining the required parameters: workspaceId and timeEntryId.inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, timeEntryId: { type: "string", description: "Time entry ID" }, }, required: ["workspaceId", "timeEntryId"], },
- src/index.ts:344-355 (registration)Registration of the 'delete_time_entry' tool in the ListToolsRequestSchema response, listing its name, description, and input schema.{ name: "delete_time_entry", description: "Delete a time entry", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, timeEntryId: { type: "string", description: "Time entry ID" }, }, required: ["workspaceId", "timeEntryId"], }, },
- src/index.ts:740-742 (registration)Handler dispatch in the CallToolRequestSchema switch statement, validating parameters and invoking the deleteTimeEntry method.case "delete_time_entry": if (!args?.workspaceId || !args?.timeEntryId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and timeEntryId are required'); return await this.deleteTimeEntry(args.workspaceId as string, args.timeEntryId as string);