getTasksMetricsComplete
Retrieve the total count of completed tasks from Teamwork projects using the Teamwork MCP server to simplify task management and tracking.
Instructions
Get the total count of completed tasks in Teamwork
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function that implements the core logic of the 'getTasksMetricsComplete' tool. It fetches completed tasks metrics via API and returns the JSON response or an error message.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) { logger.error(`Error in getTasksMetricsComplete handler: ${error.message}`); return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } }
- The tool schema/definition specifying name, description, empty input schema (no parameters), and annotations for the MCP tool.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:78-78 (registration)Registration of the 'getTasksMetricsComplete' tool in the central toolPairs array, linking its definition and handler for use in the MCP system.{ definition: getTasksMetricsComplete, handler: handleGetTasksMetricsComplete },