Skip to main content
Glama

update_time_entry

Modify an existing time entry in Clockify by updating details such as start/end times, description, project, task, tags, and billable status using workspace and time entry IDs.

Instructions

Update an existing time entry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
billableNoWhether the entry is billable
descriptionNoTime entry description
endNoEnd time (ISO 8601 format)
projectIdNoProject ID
startNoStart time (ISO 8601 format)
tagIdsNoArray of tag IDs
taskIdNoTask ID
timeEntryIdYesTime entry ID
workspaceIdYesWorkspace ID

Implementation Reference

  • src/index.ts:326-342 (registration)
    Registration of the 'update_time_entry' tool including its name, description, and input schema definition.
    name: "update_time_entry", description: "Update an existing time entry", inputSchema: { type: "object", properties: { workspaceId: { type: "string", description: "Workspace ID" }, timeEntryId: { type: "string", description: "Time entry ID" }, description: { type: "string", description: "Time entry description" }, start: { type: "string", description: "Start time (ISO 8601 format)" }, end: { type: "string", description: "End time (ISO 8601 format)" }, projectId: { type: "string", description: "Project ID" }, taskId: { type: "string", description: "Task ID" }, tagIds: { type: "array", items: { type: "string" }, description: "Array of tag IDs" }, billable: { type: "boolean", description: "Whether the entry is billable" }, }, required: ["workspaceId", "timeEntryId"], },
  • The core handler function that updates a time entry by making a PUT request to the Clockify API endpoint `/workspaces/{workspaceId}/time-entries/{timeEntryId}` with the provided update data, handles date formatting, and returns a success message.
    private async updateTimeEntry(args: any) { const { workspaceId, timeEntryId, ...updateData } = args; // Ensure dates are in ISO format if (updateData.start && !updateData.start.includes("T")) { updateData.start = new Date(updateData.start).toISOString(); } if (updateData.end && !updateData.end.includes("T")) { updateData.end = new Date(updateData.end).toISOString(); } const timeEntry = await this.makeRequest( `/workspaces/${workspaceId}/time-entries/${timeEntryId}`, "PUT", updateData ); return { content: [ { type: "text", text: `Time entry updated successfully!\nID: ${timeEntry.id}\nDescription: ${timeEntry.description || "No description"}\nStart: ${timeEntry.timeInterval.start}\nEnd: ${timeEntry.timeInterval.end || "Ongoing"}`, }, ], isError: false, };
  • Dispatch logic in the CallToolRequestSchema handler that validates parameters and calls the updateTimeEntry method.
    case "update_time_entry": if (!args?.workspaceId || !args?.timeEntryId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and timeEntryId are required'); return await this.updateTimeEntry(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