getProjectsPeopleMetricsPerformance
Analyze team performance by tracking completed tasks per user during specified periods to identify top contributors and productivity trends.
Instructions
Performance of users completing the most tasks. Count the number of completed tasks by user for the provided period. By default the user with the most completed tasks is shown first.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | No | Start date for the performance metrics period | |
| endDate | No | End date for the performance metrics period | |
| orderMode | No | Order mode for sorting results |
Implementation Reference
- The main MCP tool handler function. It calls the getPeopleMetricsPerformance service with input parameters and returns the response as formatted JSON or an error response.export async function handleGetProjectsPeopleMetricsPerformance(input: any) { try { const response = await getPeopleMetricsPerformance(input); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error: any) { return createErrorResponse(error, 'Retrieving people performance metrics'); } }
- The tool schema/definition including name, description, input schema for parameters (startDate, endDate, orderMode), and annotations.export const getProjectsPeopleMetricsPerformanceDefinition = { name: "getProjectsPeopleMetricsPerformance", description: "Performance of users completing the most tasks. Count the number of completed tasks by user for the provided period. By default the user with the most completed tasks is shown first.", inputSchema: { type: 'object', properties: { startDate: { type: 'string', description: 'Start date for the performance metrics period' }, endDate: { type: 'string', description: 'End date for the performance metrics period' }, orderMode: { type: 'string', description: 'Order mode for sorting results', enum: [ 'asc', 'desc' ] } } }, annotations: { title: "Get the Metrics of People's Performance in Projects", readOnlyHint: false, destructiveHint: false, openWorldHint: false } };
- src/tools/index.ts:94-94 (registration)Registration of the tool's definition and handler in the central toolPairs array, which populates toolDefinitions and toolHandlersMap for MCP.{ definition: getProjectsPeopleMetricsPerformance, handler: handleGetProjectsPeopleMetricsPerformance },
- Helper service function that performs the actual API call to Teamwork's /people/metrics/performance.json endpoint with the provided parameters.export async function getPeopleMetricsPerformance(params: GetPeopleMetricsPerformanceParams = {}) { const api = getApiClientForVersion('v3'); const response = await api.get('/people/metrics/performance.json', { params }); return response.data; } export default getPeopleMetricsPerformance;
- src/tools/index.ts:45-45 (registration)Import of the tool definition and handler from the implementation file.import { getProjectsPeopleMetricsPerformanceDefinition as getProjectsPeopleMetricsPerformance, handleGetProjectsPeopleMetricsPerformance } from './people/getPeopleMetricsPerformance.js';