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'
          }
        }
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that entries are 'hydrated' with project/workspace names, which adds some context about the return format. However, it lacks critical details such as whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior, or error handling. For a tool with 5 parameters and no annotations, this is a significant gap in transparency.

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?

The description is highly concise and front-loaded, consisting of two clear sentences. The first sentence states the core functionality and filters, while the second explains the return format. There is no wasted language, and every sentence adds value, making it easy for an agent to parse quickly.

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?

Given the complexity (5 parameters, no annotations, no output schema), the description is somewhat incomplete. It covers the basic purpose and return format but misses behavioral details like read-only nature, error cases, or pagination. Without an output schema, the description should ideally elaborate more on the return structure, but it does mention hydration, which helps. It's adequate for a simple retrieval tool but leaves gaps for robust agent usage.

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 description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by implying date range filtering and hydration of results, but it doesn't explain parameter interactions (e.g., that 'period' might override 'start_date'/'end_date') or provide usage examples. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get time entries with optional date range filters.' It specifies the verb ('Get') and resource ('time entries'), and mentions the return format ('hydrated entries with project/workspace names'). However, it doesn't explicitly differentiate from siblings like 'toggl_daily_report' or 'toggl_weekly_report', which might also retrieve time-related data, leaving some ambiguity about when to use this versus those alternatives.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus sibling tools. It mentions optional filters but doesn't specify contexts, prerequisites, or alternatives. For example, it doesn't compare to 'toggl_daily_report' or 'toggl_weekly_report', which might offer aggregated views, leaving the agent to infer usage based on parameter names alone.

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/verygoodplugins/mcp-toggl'

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