Skip to main content
Glama

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"], }, },

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