getTasksMetricsComplete
Retrieve the total count of completed tasks in Teamwork to monitor project progress and completion metrics.
Instructions
Get the total count of completed tasks in Teamwork
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function that executes the getTasksMetricsComplete tool logic. It calls the Teamwork API endpoint /tasks/metrics/complete.json and returns the response data.
export async function handleGetTasksMetricsComplete() { try { logger.info('Getting metrics for completed tasks'); // Make API call const apiClient = getApiClientForVersion(); const response = await apiClient.get('/tasks/metrics/complete.json'); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return createErrorResponse(error, 'Retrieving completed tasks metrics'); } } - The tool definition/schema for getTasksMetricsComplete. Defines the tool name, description, input schema (no params needed), and annotations.
export const getTasksMetricsCompleteDefinition = { name: "getTasksMetricsComplete", description: "Get the total count of completed tasks in Teamwork", inputSchema: { type: "object", properties: {}, required: [] }, annotations: { title: "Get the Total Count of Completed Tasks", readOnlyHint: false, destructiveHint: false, openWorldHint: false } }; - src/tools/index.ts:21-21 (registration)Import of the getTasksMetricsComplete definition and handler from its source file.
import { getTasksMetricsCompleteDefinition as getTasksMetricsComplete, handleGetTasksMetricsComplete } from './tasks/getTasksMetricsComplete.js'; - src/tools/index.ts:78-78 (registration)Registration of the tool pair (definition + handler) in the toolPairs array.
{ definition: getTasksMetricsComplete, handler: handleGetTasksMetricsComplete }, - src/tools/index.ts:126-126 (registration)Re-export of handleGetTasksMetricsComplete from the tools index.
export { handleGetTasksMetricsComplete } from './tasks/getTasksMetricsComplete.js'; - src/utils/config.ts:251-251 (helper)Listing of 'getTasksMetricsComplete' in the 'Tasks' tool group within the configuration.
'Tasks': ['getTasks', 'getTasksByProjectId', 'getTaskListsByProjectId', 'getTaskById', 'createTask', 'createSubTask', 'updateTask', 'deleteTask', 'getTasksMetricsComplete', 'getTasksMetricsLate', 'getTaskSubtasks', 'getTaskComments'],