todoist_test_connection
Verify Todoist API connection and validate authentication token to ensure proper integration with task management workflows.
Instructions
Test the connection to Todoist API and verify API token validity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/test-handlers.ts:42-63 (handler)The core handler function implementing the 'todoist_test_connection' tool. It tests the Todoist API connection by calling getProjects(), measures response time, and returns a structured TestResult.export async function handleTestConnection( todoistClient: TodoistApi ): Promise<TestResult> { try { const startTime = Date.now(); await todoistClient.getProjects(); const responseTime = Date.now() - startTime; return { status: "success", message: "Connection successful", responseTime, apiVersion: "v2", }; } catch (error) { return { status: "error", message: "Connection failed", error: error instanceof Error ? error.message : "Unknown error", }; } }
- src/tools/test-tools.ts:4-12 (schema)The tool schema definition specifying name, description, and empty input schema (no parameters required).export const TEST_CONNECTION_TOOL: Tool = { name: "todoist_test_connection", description: "Test the connection to Todoist API and verify API token validity", inputSchema: { type: "object", properties: {}, }, };
- src/index.ts:350-353 (registration)Registration and dispatching logic in the main server request handler switch statement, which calls the handler function and formats the JSON response.case "todoist_test_connection": const connectionResult = await handleTestConnection(apiClient); result = JSON.stringify(connectionResult, null, 2); break;
- src/tools/index.ts:48-69 (registration)The test tools (including todoist_test_connection) are imported and included in the ALL_TOOLS array, which is used by the MCP server for tool listing.GET_LABELS_TOOL, CREATE_LABEL_TOOL, UPDATE_LABEL_TOOL, DELETE_LABEL_TOOL, GET_LABEL_STATS_TOOL, } from "./label-tools.js"; export { TEST_CONNECTION_TOOL, TEST_ALL_FEATURES_TOOL, TEST_PERFORMANCE_TOOL, } from "./test-tools.js"; // Combined array of all tools in the same order as the original export const ALL_TOOLS = [ ...TASK_TOOLS, ...PROJECT_TOOLS, ...COMMENT_TOOLS, ...LABEL_TOOLS, ...SUBTASK_TOOLS, ...TEST_TOOLS, ];