todoist_quick_add_task
Quickly create tasks in Todoist using natural language input. Specify details like due dates, reminders, and notes directly in the task description for efficient task management.
Instructions
Create a task using Todoist's Quick Add feature with natural language parsing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Additional note for the task (optional) | |
| reminder | No | Reminder time (optional) | |
| text | Yes | Natural language text for quick task creation (e.g., 'Buy milk tomorrow at 2pm #shopping') |
Implementation Reference
- src/index.ts:1157-1174 (handler)The main handler logic for the todoist_quick_add_task tool. Validates input arguments using isQuickAddArgs type guard, constructs the quickAddData object, calls todoistClient.quickAddTask, and returns a formatted success response with the result.if (name === "todoist_quick_add_task") { if (!isQuickAddArgs(args)) { throw new Error("Invalid arguments for todoist_quick_add_task"); } const quickAddData: any = { text: args.text }; if (args.note) quickAddData.note = args.note; if (args.reminder) quickAddData.reminder = args.reminder; const result = await todoistClient.quickAddTask(quickAddData); return { content: [{ type: "text", text: `Task created via Quick Add:\n${JSON.stringify(result, null, 2)}` }], isError: false, }; }
- src/index.ts:68-89 (schema)The Tool object definition that specifies the name, description, and inputSchema (JSON Schema) for validating arguments to the todoist_quick_add_task tool.const QUICK_ADD_TASK_TOOL: Tool = { name: "todoist_quick_add_task", description: "Create a task using Todoist's Quick Add feature with natural language parsing", inputSchema: { type: "object", properties: { text: { type: "string", description: "Natural language text for quick task creation (e.g., 'Buy milk tomorrow at 2pm #shopping')" }, note: { type: "string", description: "Additional note for the task (optional)" }, reminder: { type: "string", description: "Reminder time (optional)" } }, required: ["text"] } };
- src/index.ts:1083-1121 (registration)Registration of the tool in the ListToolsRequestSchema handler. The QUICK_ADD_TASK_TOOL is included in the array of available tools returned by the server (specifically at line 1087).server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ // Task tools CREATE_TASK_TOOL, QUICK_ADD_TASK_TOOL, GET_TASKS_TOOL, GET_TASK_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, COMPLETE_TASK_TOOL, REOPEN_TASK_TOOL, SEARCH_TASKS_TOOL, MOVE_TASK_TOOL, BULK_MOVE_TASKS_TOOL, // Project tools GET_PROJECTS_TOOL, GET_PROJECT_TOOL, CREATE_PROJECT_TOOL, UPDATE_PROJECT_TOOL, DELETE_PROJECT_TOOL, // Section tools GET_SECTIONS_TOOL, CREATE_SECTION_TOOL, UPDATE_SECTION_TOOL, DELETE_SECTION_TOOL, // Label tools CREATE_LABEL_TOOL, GET_LABEL_TOOL, GET_LABELS_TOOL, UPDATE_LABEL_TOOL, DELETE_LABEL_TOOL, // Comment tools CREATE_COMMENT_TOOL, GET_COMMENT_TOOL, GET_COMMENTS_TOOL, UPDATE_COMMENT_TOOL, DELETE_COMMENT_TOOL, ], }));
- src/index.ts:763-774 (helper)Type guard helper function used in the handler to validate that the arguments contain the required 'text' field and are of the correct type.function isQuickAddArgs(args: unknown): args is { text: string; note?: string; reminder?: string; } { return ( typeof args === "object" && args !== null && "text" in args && typeof (args as { text: string }).text === "string" ); }