list_calendars applied the list-first pattern to Calendar. Now apply the same pattern to Tasks. You need the task list ID before you can insert a task — how do you get it?
Two calls. First GOOGLETASKS_LIST_TASK_LISTS to get the task list IDs. Then GOOGLETASKS_LIST_TASKS with the ID I want to use.
Exactly. Same pattern as list-then-fetch in Gmail and Calendar. GOOGLETASKS_LIST_TASK_LISTS returns task list dicts each with an id and title. Then GOOGLETASKS_LIST_TASKS with a specific list ID returns the tasks inside it:
lists_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
task_lists = lists_result.get("items", [])
# pick the list ID you want
tasks_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASKS, {"task_list_id": list_id})
tasks = tasks_result.get("items", [])The response key is "items" not "tasks" or "lists"? That is inconsistent with Gmail.
Google Tasks uses "items" as the list key — different from Gmail's "messages". API response keys are set by the underlying service, not by Composio. Always check the actual response shape in your first run, and use .get() with an empty list for any key you are not sure about.
So I can list my task lists, find my "Follow-ups" list ID, and then fetch all the current tasks to see what's pending. No opening the Tasks app.
Your project follow-up dashboard from one Python function. The data is always yours:
def list_tasks(list_id: str) -> list:
lists_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
tasks_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASKS, {"task_list_id": list_id})
tasks = tasks_result.get("items", [])
print(f"Found {len(tasks)} tasks in list")
return tasksMy pending follow-ups are now one function call. I have been opening the Tasks app fifteen times a day.
The two-call pattern is intentional: list to discover IDs, fetch to get contents. From here you add a task — same list ID, one more action.
GOOGLETASKS_LIST_TASK_LISTS returns the available task lists. Then GOOGLETASKS_LIST_TASKS returns tasks within a specific list:
lists_result = toolset.execute_action(
action=Action.GOOGLETASKS_LIST_TASK_LISTS,
params={}
)
task_lists = lists_result.get('taskLists', [])This mirrors list_calendars + find_events: first discover available resources, then fetch items from a specific one. The list_id passed to list_tasks is the id field from one of the task list dicts.
Task list vs tasks: GOOGLETASKS_LIST_TASK_LISTS lists the containers (e.g. 'My Tasks', 'Client Work'). GOOGLETASKS_LIST_TASKS lists the individual tasks inside a container.
list_calendars applied the list-first pattern to Calendar. Now apply the same pattern to Tasks. You need the task list ID before you can insert a task — how do you get it?
Two calls. First GOOGLETASKS_LIST_TASK_LISTS to get the task list IDs. Then GOOGLETASKS_LIST_TASKS with the ID I want to use.
Exactly. Same pattern as list-then-fetch in Gmail and Calendar. GOOGLETASKS_LIST_TASK_LISTS returns task list dicts each with an id and title. Then GOOGLETASKS_LIST_TASKS with a specific list ID returns the tasks inside it:
lists_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
task_lists = lists_result.get("items", [])
# pick the list ID you want
tasks_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASKS, {"task_list_id": list_id})
tasks = tasks_result.get("items", [])The response key is "items" not "tasks" or "lists"? That is inconsistent with Gmail.
Google Tasks uses "items" as the list key — different from Gmail's "messages". API response keys are set by the underlying service, not by Composio. Always check the actual response shape in your first run, and use .get() with an empty list for any key you are not sure about.
So I can list my task lists, find my "Follow-ups" list ID, and then fetch all the current tasks to see what's pending. No opening the Tasks app.
Your project follow-up dashboard from one Python function. The data is always yours:
def list_tasks(list_id: str) -> list:
lists_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
tasks_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASKS, {"task_list_id": list_id})
tasks = tasks_result.get("items", [])
print(f"Found {len(tasks)} tasks in list")
return tasksMy pending follow-ups are now one function call. I have been opening the Tasks app fifteen times a day.
The two-call pattern is intentional: list to discover IDs, fetch to get contents. From here you add a task — same list ID, one more action.
GOOGLETASKS_LIST_TASK_LISTS returns the available task lists. Then GOOGLETASKS_LIST_TASKS returns tasks within a specific list:
lists_result = toolset.execute_action(
action=Action.GOOGLETASKS_LIST_TASK_LISTS,
params={}
)
task_lists = lists_result.get('taskLists', [])This mirrors list_calendars + find_events: first discover available resources, then fetch items from a specific one. The list_id passed to list_tasks is the id field from one of the task list dicts.
Task list vs tasks: GOOGLETASKS_LIST_TASK_LISTS lists the containers (e.g. 'My Tasks', 'Client Work'). GOOGLETASKS_LIST_TASKS lists the individual tasks inside a container.
Create a free account to get started. Paid plans unlock all tracks.