toggl_get_current_entry
Retrieve the currently active time entry from Toggl Track to monitor ongoing work or manage timers in automation workflows.
Instructions
Get the currently running time entry, if any
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:462-489 (handler)Handler logic for the 'toggl_get_current_entry' tool call. Fetches current entry via API, hydrates with cache, handles no-entry case, returns formatted JSON.case 'toggl_get_current_entry': { const entry = await api.getCurrentTimeEntry(); if (!entry) { return { content: [{ type: 'text', text: JSON.stringify({ running: false, message: 'No timer currently running' }) }] }; } await ensureCache(); const hydrated = await cache.hydrateTimeEntries([entry]); return { content: [{ type: 'text', text: JSON.stringify({ running: true, entry: hydrated[0] }, null, 2) }] }; }
- src/index.ts:179-187 (schema)Schema definition for the tool, including name, description, and empty input schema (no parameters required).{ name: 'toggl_get_current_entry', description: 'Get the currently running time entry, if any', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/toggl-api.ts:180-183 (helper)Core API method implementation that performs the HTTP GET request to Toggl's /me/time_entries/current endpoint to retrieve the running time entry.async getCurrentTimeEntry(): Promise<TimeEntry | null> { const result = await this.request<TimeEntry | null>('GET', '/me/time_entries/current'); return result; }