todoist_test_performance
Measure Todoist API performance and response times through automated test iterations to identify optimization opportunities.
Instructions
Measure performance and response times of Todoist API operations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iterations | No | Number of iterations to run for each test (default: 5) |
Implementation Reference
- src/handlers/test-handlers.ts:294-332 (handler)The main handler function that implements the todoist_test_performance tool. It measures API response times for getProjects and getTasks over multiple iterations, computing average, min, max times.export async function handleTestPerformance( todoistClient: TodoistApi, args?: { iterations?: number } ): Promise<{ averageResponseTime: number; minResponseTime: number; maxResponseTime: number; iterations: number; results: Array<{ operation: string; time: number }>; }> { const iterations = args?.iterations || 5; const results: Array<{ operation: string; time: number }> = []; for (let i = 0; i < iterations; i++) { // Test project retrieval const projectStart = Date.now(); await todoistClient.getProjects(); results.push({ operation: "getProjects", time: Date.now() - projectStart }); // Test task retrieval const taskStart = Date.now(); await todoistClient.getTasks(); results.push({ operation: "getTasks", time: Date.now() - taskStart }); } const times = results.map((r) => r.time); const averageResponseTime = times.reduce((sum, t) => sum + t, 0) / times.length; const minResponseTime = Math.min(...times); const maxResponseTime = Math.max(...times); return { averageResponseTime, minResponseTime, maxResponseTime, iterations, results, }; }
- src/tools/test-tools.ts:32-46 (schema)Tool schema definition including name, description, and input schema for iterations parameter.export const TEST_PERFORMANCE_TOOL: Tool = { name: "todoist_test_performance", description: "Measure performance and response times of Todoist API operations", inputSchema: { type: "object", properties: { iterations: { type: "number", description: "Number of iterations to run for each test (default: 5)", default: 5, }, }, }, };
- src/index.ts:363-369 (registration)Dispatch case in the main tool handler switch statement that routes the tool call to the handleTestPerformance function.case "todoist_test_performance": const performanceResult = await handleTestPerformance( apiClient, args as { iterations?: number } ); result = JSON.stringify(performanceResult, null, 2); break;