Skip to main content
Glama

stop_timer

Stop a running timer and finalize the time entry with calculated hours.

Instructions

Stop a running timer and finalize the time entry with calculated hours.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the running time entry to stop

Implementation Reference

  • StopTimerHandler class implementing ToolHandler. Validates args with StopTimerSchema, calls harvestClient.stopTimer(), and returns the resulting time entry as JSON. Errors are caught and handled via handleMCPToolError.
    class StopTimerHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(StopTimerSchema, args, 'stop timer');
          logger.info('Stopping timer via Harvest API', { timeEntryId: validatedArgs.id });
          const timeEntry = await this.config.harvestClient.stopTimer(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(timeEntry, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'stop_timer');
        }
      }
    }
  • Registration of the 'stop_timer' tool in the registerTimeEntryTools function. Maps tool name 'stop_timer' with its input schema (id required) and handler (StopTimerHandler).
    {
      tool: {
        name: 'stop_timer',
        description: 'Stop a running timer and finalize the time entry with calculated hours.',
        inputSchema: {
          type: 'object',
          properties: {
            id: { type: 'number', description: 'The ID of the running time entry to stop' },
          },
          required: ['id'],
          additionalProperties: false,
        },
      },
      handler: new StopTimerHandler(config),
    },
  • StopTimerSchema Zod schema: validates input expects an object with a single required field: id (positive integer).
    export const StopTimerSchema = z.object({
      id: z.number().int().positive(), // Time entry ID
    });
  • StopTimerInput type derived from StopTimerSchema.
    export type StopTimerInput = z.infer<typeof StopTimerSchema>;
  • Harvest API client delegates stopTimer to TimeEntriesClient. Entry point for the API call chain.
    async stopTimer(input: StopTimerInput): Promise<any> {
      return this.timeEntriesClient.stopTimer(input);
Behavior2/5

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

With no annotations, the description carries full disclosure burden. It mentions 'finalize with calculated hours' but omits side effects (e.g., no undo), error handling (e.g., calling on already stopped timer), or whether additional steps are required.

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?

Single sentence with no unnecessary words. Directly states action and result.

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

Completeness3/5

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

For a simple mutation with one required parameter and no output schema, the description covers the core purpose. However, it lacks details on behavior for invalid IDs or non-running timers, and doesn't clarify if calculation is automatic.

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 coverage is 100% and parameter description is clear. The description adds no extra context beyond what the schema provides (e.g., format, constraints, or edge cases). Baseline score applied.

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

Purpose5/5

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

The description clearly states the action ('stop a running timer') and the outcome ('finalize the time entry with calculated hours'), using a specific verb and resource that distinguishes it from siblings like start_timer and restart_timer.

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

Usage Guidelines3/5

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

The description implies usage when a timer is running, but provides no explicit guidance on when not to use it or alternatives (e.g., restart_timer for paused timers). The agent must infer context.

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/ianaleck/harvest-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server