Skip to main content
Glama
ratheesh-aot

Clockify MCP Server

by ratheesh-aot

get_detailed_report

Generate detailed time tracking reports by filtering data across users, projects, clients, and tasks, then export in JSON, PDF, CSV, or XLSX formats.

Instructions

Generate a detailed time tracking report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesWorkspace ID
dateRangeStartYesStart date (ISO 8601 format)
dateRangeEndYesEnd date (ISO 8601 format)
usersNoArray of user IDs to filter
clientsNoArray of client IDs to filter
projectsNoArray of project IDs to filter
tasksNoArray of task IDs to filter
tagsNoArray of tag IDs to filter
billableNoFilter by billable status
descriptionNoFilter by description
withoutDescriptionNoFilter entries without description
customFieldIdsNoArray of custom field IDs
sortColumnNoSort column (DATE, USER, PROJECT, etc.)
sortOrderNoSort order
pageNoPage number (default: 1)
pageSizeNoPage size (default: 50, max: 1000)
exportTypeNoExport format

Implementation Reference

  • The handler function that implements the core logic of the 'get_detailed_report' tool. It maps input parameters to the Clockify API payload and fetches the detailed report from the reports API.
      private async getDetailedReport(args: any) {
        const { workspaceId, ...reportData } = args;
    
        const payload = {
          dateRangeStart: reportData.dateRangeStart,
          dateRangeEnd: reportData.dateRangeEnd,
          detailedFilter: {
            sortColumn: reportData.sortColumn || "DATE",
            sortOrder: reportData.sortOrder || "DESCENDING",
            page: reportData.page || 1,
            pageSize: Math.min(reportData.pageSize || 50, 1000),
            options: {
              totals: "CALCULATE",
            },
          },
          users: reportData.users ? { ids: reportData.users } : undefined,
          clients: reportData.clients ? { ids: reportData.clients } : undefined,
          projects: reportData.projects ? { ids: reportData.projects } : undefined,
          tasks: reportData.tasks ? { ids: reportData.tasks } : undefined,
          tags: reportData.tags ? { ids: reportData.tags } : undefined,
          billable: reportData.billable,
          description: reportData.description,
          withoutDescription: reportData.withoutDescription,
          customFieldIds: reportData.customFieldIds,
          sortColumn: reportData.sortColumn,
          sortOrder: reportData.sortOrder,
          page: reportData.page,
          pageSize: reportData.pageSize,
          exportType: reportData.exportType || "JSON",
        };
    
        // Remove undefined properties
        Object.keys(payload).forEach(key => {
          if (payload[key as keyof typeof payload] === undefined) {
            delete payload[key as keyof typeof payload];
          }
        });
    
        const report = await this.makeRequest(
          `/workspaces/${workspaceId}/reports/detailed`,
          "POST",
          payload,
          "https://reports.api.clockify.me/v1"
        );
    
        const summary = `Detailed Report Summary:
    Total Entries: ${report.timeentries?.length || 0}
    Total Duration: ${report.totals?.[0]?.totalTime || "0:00:00"}
    Date Range: ${reportData.dateRangeStart} to ${reportData.dateRangeEnd}`;
    
        return {
          content: [
            {
              type: "text",
              text: summary,
            },
          ],
          isError: false,
        };
      }
  • Input schema definition for the 'get_detailed_report' tool, specifying parameters, types, descriptions, and required fields.
    inputSchema: {
      type: "object",
      properties: {
        workspaceId: { type: "string", description: "Workspace ID" },
        dateRangeStart: { type: "string", description: "Start date (ISO 8601 format)" },
        dateRangeEnd: { type: "string", description: "End date (ISO 8601 format)" },
        users: { type: "array", items: { type: "string" }, description: "Array of user IDs to filter" },
        clients: { type: "array", items: { type: "string" }, description: "Array of client IDs to filter" },
        projects: { type: "array", items: { type: "string" }, description: "Array of project IDs to filter" },
        tasks: { type: "array", items: { type: "string" }, description: "Array of task IDs to filter" },
        tags: { type: "array", items: { type: "string" }, description: "Array of tag IDs to filter" },
        billable: { type: "boolean", description: "Filter by billable status" },
        description: { type: "string", description: "Filter by description" },
        withoutDescription: { type: "boolean", description: "Filter entries without description" },
        customFieldIds: { type: "array", items: { type: "string" }, description: "Array of custom field IDs" },
        sortColumn: { type: "string", description: "Sort column (DATE, USER, PROJECT, etc.)" },
        sortOrder: { type: "string", enum: ["ASCENDING", "DESCENDING"], description: "Sort order" },
        page: { type: "number", description: "Page number (default: 1)" },
        pageSize: { type: "number", description: "Page size (default: 50, max: 1000)" },
        exportType: { type: "string", enum: ["JSON", "PDF", "CSV", "XLSX"], description: "Export format" },
      },
      required: ["workspaceId", "dateRangeStart", "dateRangeEnd"],
  • src/index.ts:663-689 (registration)
    Registration of the 'get_detailed_report' tool in the list of available tools returned by ListToolsRequestSchema.
    {
      name: "get_detailed_report",
      description: "Generate a detailed time tracking report",
      inputSchema: {
        type: "object",
        properties: {
          workspaceId: { type: "string", description: "Workspace ID" },
          dateRangeStart: { type: "string", description: "Start date (ISO 8601 format)" },
          dateRangeEnd: { type: "string", description: "End date (ISO 8601 format)" },
          users: { type: "array", items: { type: "string" }, description: "Array of user IDs to filter" },
          clients: { type: "array", items: { type: "string" }, description: "Array of client IDs to filter" },
          projects: { type: "array", items: { type: "string" }, description: "Array of project IDs to filter" },
          tasks: { type: "array", items: { type: "string" }, description: "Array of task IDs to filter" },
          tags: { type: "array", items: { type: "string" }, description: "Array of tag IDs to filter" },
          billable: { type: "boolean", description: "Filter by billable status" },
          description: { type: "string", description: "Filter by description" },
          withoutDescription: { type: "boolean", description: "Filter entries without description" },
          customFieldIds: { type: "array", items: { type: "string" }, description: "Array of custom field IDs" },
          sortColumn: { type: "string", description: "Sort column (DATE, USER, PROJECT, etc.)" },
          sortOrder: { type: "string", enum: ["ASCENDING", "DESCENDING"], description: "Sort order" },
          page: { type: "number", description: "Page number (default: 1)" },
          pageSize: { type: "number", description: "Page size (default: 50, max: 1000)" },
          exportType: { type: "string", enum: ["JSON", "PDF", "CSV", "XLSX"], description: "Export format" },
        },
        required: ["workspaceId", "dateRangeStart", "dateRangeEnd"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'generates' a report without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, if it requires specific permissions, rate limits, side effects, or what the output looks like (e.g., file download vs. data return). For a tool with 17 parameters and no annotations, this is a significant gap.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for a tool where parameter details are handled in the schema. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (17 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain the output format (e.g., whether it returns data or triggers a file download), behavioral constraints, or how it differs from sibling reporting tools. For a detailed reporting tool with many filters and export options, more context is needed.

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 17 parameters thoroughly with descriptions, enums, and defaults. The description adds no additional parameter semantics beyond implying it's for time tracking reports, which is already clear from parameter names like 'dateRangeStart'. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description 'Generate a detailed time tracking report' clearly states the action (generate) and resource (time tracking report), but lacks specificity about what makes it 'detailed' compared to sibling tools like 'get_summary_report' or 'get_time_entries'. It distinguishes itself from creation/deletion tools but not clearly from other reporting tools.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_summary_report' or 'get_time_entries'. The description implies it's for generating reports but doesn't specify scenarios, prerequisites, or exclusions. Sibling tools include other reporting options, but no comparison is offered.

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/ratheesh-aot/clockify-mcp'

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