Skip to main content
Glama

toggl_get_time_entries

Retrieve time entries from Toggl Track with date range filters. Returns detailed entries including project and workspace information for tracking and reporting.

Instructions

Get time entries with optional date range filters. Returns hydrated entries with project/workspace names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoPredefined period to fetch entries for
start_dateNoStart date (YYYY-MM-DD format)
end_dateNoEnd date (YYYY-MM-DD format)
workspace_idNoFilter by workspace ID
project_idNoFilter by project ID

Implementation Reference

  • The main handler for the 'toggl_get_time_entries' tool. Ensures cache is warmed, determines date range from parameters (period, start_date, end_date), fetches time entries via TogglAPI, filters by workspace_id or project_id if provided, hydrates entries with project/workspace names from cache, and returns JSON with entry count and hydrated entries list.
    case 'toggl_get_time_entries': { await ensureCache(); let entries: TimeEntry[]; if (args?.period) { const range = getDateRange(args.period as any); entries = await api.getTimeEntriesForDateRange(range.start, range.end); } else if (args?.start_date || args?.end_date) { const start = args?.start_date ? new Date(args.start_date as string) : new Date(); const end = args?.end_date ? new Date(args.end_date as string) : new Date(); entries = await api.getTimeEntriesForDateRange(start, end); } else { entries = await api.getTimeEntriesForToday(); } // Filter by workspace/project if specified if (args?.workspace_id) { entries = entries.filter(e => e.workspace_id === args.workspace_id); } if (args?.project_id) { entries = entries.filter(e => e.project_id === args.project_id); } // Hydrate with names const hydrated = await cache.hydrateTimeEntries(entries); return { content: [{ type: 'text', text: JSON.stringify({ count: hydrated.length, entries: hydrated }, null, 2) }] }; }
  • Defines the tool metadata including name, description, and input schema for 'toggl_get_time_entries'. The schema specifies optional parameters for filtering time entries by predefined periods or custom date ranges, and by workspace or project IDs.
    { name: 'toggl_get_time_entries', description: 'Get time entries with optional date range filters. Returns hydrated entries with project/workspace names.', inputSchema: { type: 'object', properties: { period: { type: 'string', enum: ['today', 'yesterday', 'week', 'lastWeek', 'month', 'lastMonth'], description: 'Predefined period to fetch entries for' }, start_date: { type: 'string', description: 'Start date (YYYY-MM-DD format)' }, end_date: { type: 'string', description: 'End date (YYYY-MM-DD format)' }, workspace_id: { type: 'number', description: 'Filter by workspace ID' }, project_id: { type: 'number', description: 'Filter by project ID' } } }, },

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