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-python1export TODOIST_API_TOKEN=***Example
The following agent will create a new task in Todoist.
1"""2Example showing how to use the Todoist Tools with Kern34Requirements: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-python78Usage:9- Set the following environment variables:10 export TODOIST_API_TOKEN="your_api_token"1112- Or provide them when creating the TodoistTools instance13"""1415from kern.agent import Agent16from kern.models.openai import OpenAIResponses17from kern.tools.todoist import TodoistTools1819todoist_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 )3536# Example 1: Create a task37print("\n=== Create a task ===")38todoist_agent.print_response("Create a todoist task to buy groceries tomorrow at 10am")3940# Example 2: Delete a task41print("\n=== Delete a task ===")42todoist_agent.print_response(43 "Delete the todoist task to buy groceries tomorrow at 10am"44)4546# Example 3: Get all tasks47print("\n=== Get all tasks ===")48todoist_agent.print_response("Get all the todoist tasks")Toolkit Params
| Parameter | Type | Default | Description |
|---|---|---|---|
api_token | str | None | If you want to manually supply the TODOIST_API_TOKEN. |
Toolkit Functions
| Function | Description |
|---|---|
create_task | Creates a new task in Todoist with optional project assignment, due date, priority, and labels. |
get_task | Fetches a specific task. |
update_task | Updates an existing task with new properties such as content, due date, priority, etc. |
close_task | Marks a task as completed. |
delete_task | Deletes a specific task from Todoist. |
get_active_tasks | Retrieves all active (non-completed) tasks. |
get_projects | Retrieves 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
- View Tools