Skip to main content
Glama

getProjectsReportingUtilization

Generate detailed utilization reports in CSV, HTML, PDF, or XLSX formats. Filter by date, user, team, or project to analyze resource allocation and productivity for accessible personnel within Teamwork MCP.

Instructions

Generate utilization report in various formats (CSV, HTML, PDF, XLSX). Generates a utilization report containing all people for the provided filters. Only the people that the logged-in user can access will be returned.

Input Schema

NameRequiredDescriptionDefault
IncludeCompletedTasksNoinclude completed tasks
companyIdsNofilter by company ids
endDateNofilter by end date
fieldsUsersNoQuery parameter: fields[users]
fieldsUtilizationsNoQuery parameter: fields[utilizations]
formatYesThe format of the report
groupByNogroup by
includeNoinclude
includeArchivedProjectsNoinclude archived projects
includeClientsNoinclude client users
includeCollaboratorsNoinclude collaborators
includeTotalsNoadds report summary to response
includeUtilizationsNoadds report rows for individual entities
isCustomDateRangeNodetermine if the query is for a custom date range
isReportDownloadNogenerate a report document
jobRoleIdsNofilter by jobrole ids
legacyResponseNoreturn response without summary and its legacy body structure
orderByNosort by
orderModeNogroup by
pageNopage number
pageSizeNonumber of items in a page
projectIdsNofilter by project ids
reportFormatNodefine the format of the report
searchTermNofilter by user first or last name
selectedColumnsNocustomise the report by selecting columns to be displayed.
skipCountsNoSkipCounts allows you to skip doing counts on a list API endpoint for performance reasons.
sortNosort by (deprecated, use orderBy)
sortOrderNoorder mode
startDateNofilter by start date
teamIdsNofilter by team ids
userIdsNofilter by userIds
zoomNodetermine the type of zoom filter used to display on the report

Input Schema (JSON Schema)

{ "properties": { "IncludeCompletedTasks": { "description": "include completed tasks", "type": "boolean" }, "companyIds": { "description": "filter by company ids", "type": "array" }, "endDate": { "description": "filter by end date", "type": "string" }, "fieldsUsers": { "description": "Query parameter: fields[users]", "type": "array" }, "fieldsUtilizations": { "description": "Query parameter: fields[utilizations]", "type": "array" }, "format": { "description": "The format of the report", "enum": [ "csv", "html", "pdf", "xlsx" ], "type": "string" }, "groupBy": { "description": "group by", "enum": [ "day", "week", "month" ], "type": "string" }, "include": { "description": "include", "type": "array" }, "includeArchivedProjects": { "description": "include archived projects", "type": "boolean" }, "includeClients": { "description": "include client users", "type": "boolean" }, "includeCollaborators": { "description": "include collaborators", "type": "boolean" }, "includeTotals": { "description": "adds report summary to response", "type": "boolean" }, "includeUtilizations": { "description": "adds report rows for individual entities", "type": "boolean" }, "isCustomDateRange": { "description": "determine if the query is for a custom date range", "type": "boolean" }, "isReportDownload": { "description": "generate a report document", "type": "boolean" }, "jobRoleIds": { "description": "filter by jobrole ids", "type": "array" }, "legacyResponse": { "description": "return response without summary and its legacy body structure", "type": "boolean" }, "orderBy": { "description": "sort by", "enum": [ "name", "percentutilization", "percentestimatedutilization", "availableminutes", "unavailableminutes", "loggedminutes", "billableminutes", "unbillableminutes", "companycount", "achieved", "target", "allocatedutilization", "totalworkingminutes", "availableutilization", "unavailableutilization" ], "type": "string" }, "orderMode": { "description": "group by", "enum": [ "weekly", "monthly" ], "type": "string" }, "page": { "description": "page number", "type": "integer" }, "pageSize": { "description": "number of items in a page", "type": "integer" }, "projectIds": { "description": "filter by project ids", "type": "array" }, "reportFormat": { "description": "define the format of the report", "enum": [ "pdf" ], "type": "string" }, "searchTerm": { "description": "filter by user first or last name", "type": "string" }, "selectedColumns": { "description": "customise the report by selecting columns to be displayed.", "type": "array" }, "skipCounts": { "description": "SkipCounts allows you to skip doing counts on a list API endpoint for performance reasons.", "type": "boolean" }, "sort": { "description": "sort by (deprecated, use orderBy)", "enum": [ "name", "percentutilization", "percentestimatedutilization", "availableminutes", "unavailableminutes", "loggedminutes", "billableminutes", "unbillableminutes", "billableutilization", "nonbillableutilization" ], "type": "string" }, "sortOrder": { "description": "order mode", "enum": [ "asc", "desc" ], "type": "string" }, "startDate": { "description": "filter by start date", "type": "string" }, "teamIds": { "description": "filter by team ids", "type": "array" }, "userIds": { "description": "filter by userIds", "type": "array" }, "zoom": { "description": "determine the type of zoom filter used to display on the report", "enum": [ "week", "month", "last3months", "quarterbyweek", "quarterbymonth" ], "type": "string" } }, "required": [ "format" ], "type": "object" }

Implementation Reference

  • The handler function that executes the tool logic by calling the getUtilization service and returning the result as formatted text or error message.
    export async function handleGetProjectsReportingUtilization(input: any) { try { const data = await getUtilization({ ...input, format: input.format.toLowerCase() }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } }
  • The tool definition object containing name, description, input schema for validation, and annotations.
    export const getProjectsReportingUtilizationDefinition = { name: "getProjectsReportingUtilization", description: "Generate utilization report in various formats (CSV, HTML, PDF, XLSX). Generates a utilization report containing all people for the provided filters. Only the people that the logged-in user can access will be returned.", inputSchema: { type: 'object', properties: { format: { type: 'string', description: 'The format of the report', enum: ['csv', 'html', 'pdf', 'xlsx'] }, zoom: { type: 'string', description: 'determine the type of zoom filter used to display on the report', enum: [ 'week', 'month', 'last3months', 'quarterbyweek', 'quarterbymonth' ] }, startDate: { type: 'string', description: 'filter by start date' }, sortOrder: { type: 'string', description: 'order mode', enum: [ 'asc', 'desc' ] }, sort: { type: 'string', description: 'sort by (deprecated, use orderBy)', enum: [ 'name', 'percentutilization', 'percentestimatedutilization', 'availableminutes', 'unavailableminutes', 'loggedminutes', 'billableminutes', 'unbillableminutes', 'billableutilization', 'nonbillableutilization' ] }, searchTerm: { type: 'string', description: 'filter by user first or last name' }, reportFormat: { type: 'string', description: 'define the format of the report', enum: [ 'pdf' ] }, orderMode: { type: 'string', description: 'group by', enum: [ 'weekly', 'monthly' ] }, orderBy: { type: 'string', description: 'sort by', enum: [ 'name', 'percentutilization', 'percentestimatedutilization', 'availableminutes', 'unavailableminutes', 'loggedminutes', 'billableminutes', 'unbillableminutes', 'companycount', 'achieved', 'target', 'allocatedutilization', 'totalworkingminutes', 'availableutilization', 'unavailableutilization' ] }, groupBy: { type: 'string', description: 'group by', enum: [ 'day', 'week', 'month' ] }, endDate: { type: 'string', description: 'filter by end date' }, pageSize: { type: 'integer', description: 'number of items in a page' }, page: { type: 'integer', description: 'page number' }, skipCounts: { type: 'boolean', description: 'SkipCounts allows you to skip doing counts on a list API endpoint for performance reasons.' }, legacyResponse: { type: 'boolean', description: 'return response without summary and its legacy body structure' }, isReportDownload: { type: 'boolean', description: 'generate a report document' }, isCustomDateRange: { type: 'boolean', description: 'determine if the query is for a custom date range' }, includeUtilizations: { type: 'boolean', description: 'adds report rows for individual entities' }, includeTotals: { type: 'boolean', description: 'adds report summary to response' }, includeCollaborators: { type: 'boolean', description: 'include collaborators' }, includeClients: { type: 'boolean', description: 'include client users' }, includeArchivedProjects: { type: 'boolean', description: 'include archived projects' }, IncludeCompletedTasks: { type: 'boolean', description: 'include completed tasks' }, userIds: { type: 'array', description: 'filter by userIds' }, teamIds: { type: 'array', description: 'filter by team ids' }, selectedColumns: { type: 'array', description: 'customise the report by selecting columns to be displayed.' }, projectIds: { type: 'array', description: 'filter by project ids' }, jobRoleIds: { type: 'array', description: 'filter by jobrole ids' }, include: { type: 'array', description: 'include' }, fieldsUtilizations: { type: 'array', description: 'Query parameter: fields[utilizations]' }, fieldsUsers: { type: 'array', description: 'Query parameter: fields[users]' }, companyIds: { type: 'array', description: 'filter by company ids' } }, required: ['format'] }, annotations: { title: "Get the Utilization of People in Projects", readOnlyHint: false, destructiveHint: false, openWorldHint: false } };
  • Registration of the tool's definition and handler in the toolPairs array, which populates toolDefinitions and toolHandlersMap.
    { definition: getProjectsReportingUtilization, handler: handleGetProjectsReportingUtilization },
  • The supporting service function that performs the actual API call to retrieve utilization data from the Teamwork API endpoint.
    async function getUtilization(params: GetUtilizationParams) { const api = ensureApiClient(); const endpoint = `/reporting/precanned/utilization.${params.format}`; const response = await api.get(endpoint, { params }); return response.data; } export default getUtilization;

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/Vizioz/Teamwork-MCP'

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