Skip to main content
Glama

toggl_stop_timer

Stop the currently running timer in Toggl Track to end time tracking sessions and update work logs.

Instructions

Stop the currently running timer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler logic for the 'toggl_stop_timer' tool. It checks if there's a currently running timer, stops it using the TogglAPI, hydrates the entry with cached data (project/workspace names), and returns a formatted JSON response.
    case 'toggl_stop_timer': { const current = await api.getCurrentTimeEntry(); if (!current) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: 'No timer currently running' }) }] }; } const stopped = await api.stopTimer(current.workspace_id, current.id); await ensureCache(); const hydrated = await cache.hydrateTimeEntries([stopped]); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: 'Timer stopped', entry: hydrated[0] }, null, 2) }] }; }
  • The tool definition including name, description, and input schema (no parameters required). This is used for tool listing and validation.
    { name: 'toggl_stop_timer', description: 'Stop the currently running timer', inputSchema: { type: 'object', properties: {}, required: [] }, },
  • Supporting utility method in TogglAPI class that stops a timer by updating the time entry with the current timestamp via the Toggl API PUT request.
    async stopTimer(workspaceId: number, timeEntryId: number): Promise<TimeEntry> { const now = new Date().toISOString(); return this.updateTimeEntry(workspaceId, timeEntryId, { stop: now }); }
  • src/index.ts:386-388 (registration)
    Registration of the tool list handler, which returns the tools array containing 'toggl_stop_timer' when clients query available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { 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/verygoodplugins/mcp-toggl'

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