Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

update_time_entry

Modify existing time entries in Clockify to correct errors, update details, or adjust tracking parameters for accurate time management.

Instructions

Update an existing time entry

Input Schema

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

Implementation Reference

  • The 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. It 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,
      };
    }
  • The input schema definition for the update_time_entry tool, specifying parameters like workspaceId (required), timeEntryId (required), description, start, end, projectId, taskId, tagIds, and billable.
    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"],
    },
  • src/index.ts:737-739 (registration)
    The registration and dispatch logic in the CallToolRequestSchema handler's switch statement, which validates required arguments and calls the updateTimeEntry handler.
    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);
  • src/index.ts:325-343 (registration)
    The tool registration in the ListToolsRequestSchema response, listing the update_time_entry tool with its name, description, and input schema.
    {
      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 makeRequest helper method used by the updateTimeEntry handler to perform the API call to Clockify.
    private async makeRequest(
      endpoint: string,
      method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" = "GET",
      data?: any,
      baseUrl?: string
    ): Promise<any> {
      if (!this.config.apiKey) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Clockify API key not configured. Set CLOCKIFY_API_KEY environment variable."
        );
      }
    
      const url = `${baseUrl || this.config.baseUrl}${endpoint}`;
      const headers: Record<string, string> = {
        "X-Api-Key": this.config.apiKey,
        "Content-Type": "application/json",
      };
    
      try {
        const response = await fetch(url, {
          method,
          headers,
          body: data ? JSON.stringify(data) : undefined,
        });
    
        if (!response.ok) {
          const errorText = await response.text();
          throw new McpError(
            ErrorCode.InternalError,
            `Clockify API error (${response.status}): ${errorText}`
          );
        }
    
        return response.json();
      } catch (error) {
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Request failed: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'update' implying mutation but doesn't cover permissions, side effects, error handling, or response format. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded and directly states the tool's purpose without unnecessary elaboration, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 9 parameters, no annotations, and no output schema, the description is insufficient. It lacks behavioral context, usage guidance, and any explanation of return values or error conditions, leaving significant gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 9 parameters. The description adds no additional meaning beyond the schema, such as explaining relationships between parameters or usage examples. Baseline 3 is appropriate when schema does all the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('update') and resource ('existing time entry'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'duplicate_time_entry' or specify what aspects of a time entry can be updated, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'create_time_entry', 'duplicate_time_entry', or 'delete_time_entry'. The description lacks context about prerequisites, timing, or any constraints, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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