Skip to main content
Glama

toggl_start_timer

Start a new Toggl timer to track time for specific tasks with optional project, tags, and workspace details for accurate time management.

Instructions

Start a new time entry timer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the time entry
project_idNoProject ID (optional)
tagsNoTags for the entry
task_idNoTask ID (optional)
workspace_idNoWorkspace ID (uses default if not provided)

Implementation Reference

  • MCP tool handler for 'toggl_start_timer': extracts input arguments, determines workspace ID, calls TogglAPI.startTimer, hydrates the entry with cache data, and returns a success response with the entry details.
    case 'toggl_start_timer': { const workspaceId = args?.workspace_id || defaultWorkspaceId; if (!workspaceId) { throw new Error('Workspace ID required (set TOGGL_DEFAULT_WORKSPACE_ID or provide workspace_id)'); } const entry = await api.startTimer( workspaceId as number, args?.description as string | undefined, args?.project_id as number | undefined, args?.task_id as number | undefined, args?.tags as string[] | undefined ); await ensureCache(); const hydrated = await cache.hydrateTimeEntries([entry]); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: 'Timer started', entry: hydrated[0] }, null, 2) }] }; }
  • Schema definition for the 'toggl_start_timer' tool, including name, description, and input schema properties.
    { name: 'toggl_start_timer', description: 'Start a new time entry timer', inputSchema: { type: 'object', properties: { description: { type: 'string', description: 'Description of the time entry' }, workspace_id: { type: 'number', description: 'Workspace ID (uses default if not provided)' }, project_id: { type: 'number', description: 'Project ID (optional)' }, task_id: { type: 'number', description: 'Task ID (optional)' }, tags: { type: 'array', items: { type: 'string' }, description: 'Tags for the entry' } } }, },
  • src/index.ts:386-388 (registration)
    Registers the tools list (including 'toggl_start_timer') to be returned on ListTools requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • TogglAPI.startTimer helper: constructs payload for a running timer (duration: -1) and delegates to createTimeEntry.
    async startTimer(workspaceId: number, description?: string, projectId?: number, taskId?: number, tags?: string[]): Promise<TimeEntry> { const entry: Partial<CreateTimeEntryRequest> = { description, project_id: projectId, task_id: taskId, tags, start: new Date().toISOString(), duration: -1 // Negative duration indicates running timer }; return this.createTimeEntry(workspaceId, entry); }
  • TogglAPI.createTimeEntry helper: formats the POST request payload and sends it to Toggl API to create the time entry.
    async createTimeEntry(workspaceId: number, entry: Partial<CreateTimeEntryRequest>): Promise<TimeEntry> { const payload: CreateTimeEntryRequest = { workspace_id: workspaceId, created_with: 'mcp-toggl', start: entry.start || new Date().toISOString(), ...entry }; return this.request<TimeEntry>('POST', `/workspaces/${workspaceId}/time_entries`, payload); }

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