Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

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
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
timeEntryIdYesTime entry ID

Implementation Reference

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

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