Todoist

TodoistTools enables an Agent to interact with Todoist.

Prerequisites

The following example requires the todoist-api-python library. and a Todoist API token which can be obtained from the Todoist Developer Portal.

1uv pip install todoist-api-python
1export TODOIST_API_TOKEN=***

Example

The following agent will create a new task in Todoist.

1"""
2Example showing how to use the Todoist Tools with Kern
3
4Requirements:
5- Sign up/login to Todoist and get a Todoist API Token (get from https://app.todoist.com/app/settings/integrations/developer)
6- uv pip install todoist-api-python
7
8Usage:
9- Set the following environment variables:
10 export TODOIST_API_TOKEN="your_api_token"
11
12- Or provide them when creating the TodoistTools instance
13"""
14
15from kern.agent import Agent
16from kern.models.openai import OpenAIResponses
17from kern.tools.todoist import TodoistTools
18
19todoist_agent = Agent(
20 name="Todoist Agent",
21 role="Manage your todoist tasks",
22 instructions=[
23 "When given a task, create a todoist task for it.",
24 "When given a list of tasks, create a todoist task for each one.",
25 "When given a task to update, update the todoist task.",
26 "When given a task to delete, delete the todoist task.",
27 "When given a task to get, get the todoist task.",
28 ],
29 id="todoist-agent",
30 model=OpenAIResponses(id="gpt-5.2"),
31 tools=[TodoistTools()],
32 markdown=True,
33 debug_mode=True,
34 )
35
36# Example 1: Create a task
37print("\n=== Create a task ===")
38todoist_agent.print_response("Create a todoist task to buy groceries tomorrow at 10am")
39
40# Example 2: Delete a task
41print("\n=== Delete a task ===")
42todoist_agent.print_response(
43 "Delete the todoist task to buy groceries tomorrow at 10am"
44)
45
46# Example 3: Get all tasks
47print("\n=== Get all tasks ===")
48todoist_agent.print_response("Get all the todoist tasks")

Toolkit Params

ParameterTypeDefaultDescription
api_tokenstrNoneIf you want to manually supply the TODOIST_API_TOKEN.

Toolkit Functions

FunctionDescription
create_taskCreates a new task in Todoist with optional project assignment, due date, priority, and labels.
get_taskFetches a specific task.
update_taskUpdates an existing task with new properties such as content, due date, priority, etc.
close_taskMarks a task as completed.
delete_taskDeletes a specific task from Todoist.
get_active_tasksRetrieves all active (non-completed) tasks.
get_projectsRetrieves all projects in Todoist.

You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Developer Resources