Skip to main content
Glama

toggl_daily_report

Generate a daily report showing hours worked by project and workspace from Toggl Track data. Specify a date and output format to track time allocation.

Instructions

Generate a daily report with hours by project and workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate for report (YYYY-MM-DD format, defaults to today)
formatNoOutput format (default: json)

Implementation Reference

  • Main handler logic for the 'toggl_daily_report' tool. Fetches time entries for the given date using TogglAPI, hydrates them with project/workspace names using CacheManager, generates the structured report using the generateDailyReport helper from utils.ts, and returns either JSON or formatted text output.
    case 'toggl_daily_report': {
      await ensureCache();
      
      const date = args?.date ? new Date(args.date as string) : new Date();
      const nextDay = new Date(date);
      nextDay.setDate(nextDay.getDate() + 1);
      
      const entries = await api.getTimeEntriesForDateRange(date, nextDay);
      const hydrated = await cache.hydrateTimeEntries(entries);
      
      const report = generateDailyReport(date.toISOString().split('T')[0], hydrated);
      
      if (args?.format === 'text') {
        return {
          content: [{
            type: 'text',
            text: formatReportForDisplay(report)
          }]
        };
      }
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(report, null, 2)
        }]
      };
    }
  • src/index.ts:229-246 (registration)
    Tool registration in the tools list, including name, description, and input schema. This array is returned by the ListToolsRequestHandler.
    {
      name: 'toggl_daily_report',
      description: 'Generate a daily report with hours by project and workspace',
      inputSchema: {
        type: 'object',
        properties: {
          date: {
            type: 'string',
            description: 'Date for report (YYYY-MM-DD format, defaults to today)'
          },
          format: {
            type: 'string',
            enum: ['json', 'text'],
            description: 'Output format (default: json)'
          }
        }
      },
    },
  • Input schema definition for validating tool arguments: optional date (YYYY-MM-DD) and format (json/text).
    {
      name: 'toggl_daily_report',
      description: 'Generate a daily report with hours by project and workspace',
      inputSchema: {
        type: 'object',
        properties: {
          date: {
            type: 'string',
            description: 'Date for report (YYYY-MM-DD format, defaults to today)'
          },
          format: {
            type: 'string',
            enum: ['json', 'text'],
            description: 'Output format (default: json)'
          }
        }
      },
    },
  • Core helper function that processes hydrated time entries to generate the DailyReport structure, including totals, individual entries, project summaries, and workspace summaries using other utilities like groupEntriesByProject, calculateTotalDuration, etc.
    export function generateDailyReport(date: string, entries: HydratedTimeEntry[]): DailyReport {
      const totalSeconds = calculateTotalDuration(entries);
      const reportEntries = entries.map(createReportEntry);
      
      // Group by project
      const byProject = groupEntriesByProject(entries);
      const projectSummaries: ProjectSummary[] = [];
      byProject.forEach((projectEntries, projectName) => {
        projectSummaries.push(generateProjectSummary(projectName, projectEntries));
      });
      
      // Group by workspace
      const byWorkspace = groupEntriesByWorkspace(entries);
      const workspaceSummaries: WorkspaceSummary[] = [];
      byWorkspace.forEach((wsEntries, wsName) => {
        const wsId = wsEntries[0]?.workspace_id || 0;
        workspaceSummaries.push(generateWorkspaceSummary(wsName, wsId, wsEntries));
      });
      
      return {
        date,
        total_hours: secondsToHours(totalSeconds),
        total_seconds: totalSeconds,
        entries: reportEntries,
        by_project: projectSummaries,
        by_workspace: workspaceSummaries
      };
    }
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 states the tool generates a report but doesn't cover critical aspects like authentication requirements, rate limits, data freshness, or whether it's a read-only operation. For a reporting tool with zero annotation coverage, 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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part ('Generate a daily report with hours by project and workspace') directly contributes to understanding the tool's function, making it highly concise and well-structured.

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 tool's moderate complexity (generating a report with two parameters), 100% schema coverage, and no output schema, the description is minimally adequate. It states what the tool does but lacks details on output format beyond the 'format' parameter, behavioral traits, or differentiation from siblings. This leaves gaps in completeness for effective agent use.

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?

The input schema has 100% description coverage, clearly documenting both parameters ('date' and 'format') with defaults and formats. The description doesn't add any parameter-specific details beyond what the schema provides, such as explaining the 'hours by project and workspace' output structure. Baseline 3 is appropriate when 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: 'Generate a daily report with hours by project and workspace.' It specifies the verb ('generate'), resource ('daily report'), and key dimensions ('hours by project and workspace'). However, it doesn't explicitly differentiate from sibling tools like 'toggl_weekly_report' or 'toggl_project_summary,' which prevents a score of 5.

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 alternatives. It doesn't mention sibling tools like 'toggl_weekly_report' for weekly data or 'toggl_project_summary' for project-specific summaries, nor does it specify prerequisites or exclusions. This lack of contextual direction leaves the agent without clear usage cues.

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