Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

stop_time_entry

Stop active time tracking in Clockify by ending the current time entry. This tool halts ongoing work sessions to ensure accurate time records for billing and productivity analysis.

Instructions

Stop a running time entry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
userIdYesUser ID
endNoEnd time (ISO 8601 format, optional - defaults to now)

Implementation Reference

  • The main handler function for the 'stop_time_entry' tool. It takes workspaceId, userId, and optional end time, then sends a PATCH request to the Clockify API endpoint `/workspaces/{workspaceId}/user/{userId}/time-entries` with the end time to stop the running time entry. Returns a success message with the end time and duration.
    private async stopTimeEntry(args: any) {
      const { workspaceId, userId, end } = args;
      const endTime = end || new Date().toISOString();
    
      const result = await this.makeRequest(
        `/workspaces/${workspaceId}/user/${userId}/time-entries`,
        "PATCH" as "PATCH",
        { end: endTime }
      );
    
      return {
        content: [
          {
            type: "text",
            text: `Time entry stopped at ${endTime}\nDuration: ${result.timeInterval.duration}`,
          },
        ],
        isError: false,
      };
    }
  • The input schema definition for the 'stop_time_entry' tool, specifying required workspaceId and userId, and optional end time as string in ISO 8601 format.
    inputSchema: {
      type: "object",
      properties: {
        workspaceId: { type: "string", description: "Workspace ID" },
        userId: { type: "string", description: "User ID" },
        end: { type: "string", description: "End time (ISO 8601 format, optional - defaults to now)" },
      },
      required: ["workspaceId", "userId"],
    },
  • src/index.ts:357-368 (registration)
    The tool registration in the list of tools returned by ListToolsRequestSchema, including name, description, and input schema.
      name: "stop_time_entry",
      description: "Stop a running time entry",
      inputSchema: {
        type: "object",
        properties: {
          workspaceId: { type: "string", description: "Workspace ID" },
          userId: { type: "string", description: "User ID" },
          end: { type: "string", description: "End time (ISO 8601 format, optional - defaults to now)" },
        },
        required: ["workspaceId", "userId"],
      },
    },
  • src/index.ts:743-745 (registration)
    The switch case in the CallToolRequestSchema handler that validates parameters and dispatches to the stopTimeEntry handler method.
    case "stop_time_entry":
      if (!args?.workspaceId || !args?.userId) throw new McpError(ErrorCode.InvalidParams, 'workspaceId and userId are required');
      return await this.stopTimeEntry(args as any);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a mutation (stopping changes state) but doesn't disclose permissions needed, side effects (e.g., does it trigger notifications?), error conditions, or what happens if no running entry exists. The description adds no context beyond the basic action.

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 zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by conveying essential information without fluff.

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 no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or error handling, nor does it hint at return values. Given the complexity of stopping a time entry (which likely involves state changes and validation), more context is needed for safe and effective use.

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 parameters are fully documented in the schema. The description adds no additional meaning about parameters—it doesn't explain why workspaceId and userId are required, how they relate to stopping, or the implications of the optional 'end' parameter. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Stop') and resource ('a running time entry'), making the purpose immediately understandable. It distinguishes from siblings like 'create_time_entry' or 'update_time_entry' by focusing on stopping rather than creating or modifying. However, it doesn't specify what constitutes a 'running' time entry versus other states.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., that a time entry must be running first), exclusions, or relationships with sibling tools like 'update_time_entry' or 'duplicate_time_entry'. The agent must infer usage from context alone.

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