KosmoKrator

productivity

Google Tasks Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Google Tasks KosmoKrator integration.

7 functions 5 read 2 write Manual OAuth token auth

Lua Namespace

Agents call this integration through app.integrations.google_tasks.*. Use lua_read_doc("integrations.google-tasks") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Google Tasks — Lua API Reference

list_task_lists

List all task lists for the authenticated user.

Parameters

NameTypeRequiredDescription
maxResultsintegernoMax task lists per page (default: 20, max: 100)
pageTokenstringnoToken for the next page of results
showCompletedbooleannoShow completed tasks (default: true)
showHiddenbooleannoShow hidden task lists (default: false)

Example

local result = app.integrations["google-tasks"].list_task_lists({
  maxResults = 20
})

for _, list in ipairs(result.items) do
  print(list.id .. ": " .. list.title)
end

get_task_list

Get a specific task list by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe task list ID

Example

local result = app.integrations["google-tasks"].get_task_list({
  id = "MDczMjU3MzI5NjU3MzQ1NzI5MjQ6MDow"
})

print(result.title)

create_task_list

Create a new task list.

Parameters

NameTypeRequiredDescription
titlestringyesTitle of the new task list

Example

local result = app.integrations["google-tasks"].create_task_list({
  title = "Work Projects"
})

print("Created list: " .. result.id .. " — " .. result.title)

list_tasks

List tasks in a specific task list.

Parameters

NameTypeRequiredDescription
list_idstringyesThe task list ID (use "@" for default list)
maxResultsintegernoMax tasks per page (default: 20, max: 100)
pageTokenstringnoToken for the next page of results
showCompletedbooleannoInclude completed tasks (default: true)
dueDatestringnoISO 8601 date to filter tasks due before this date

Example

local result = app.integrations["google-tasks"].list_tasks({
  list_id = "MDczMjU3MzI5NjU3MzQ1NzI5MjQ6MDow",
  maxResults = 10,
  showCompleted = false
})

for _, task in ipairs(result.items) do
  local due = task.due or "no due date"
  print(task.title .. " — due: " .. due)
end

get_task

Get a specific task by ID from a task list.

Parameters

NameTypeRequiredDescription
list_idstringyesThe task list ID
idstringyesThe task ID

Example

local result = app.integrations["google-tasks"].get_task({
  list_id = "MDczMjU3MzI5NjU3MzQ1NzI5MjQ6MDow",
  id = "task_id_here"
})

print(result.title)
print(result.notes or "No notes")
print("Status: " .. result.status)

create_task

Create a new task in a task list.

Parameters

NameTypeRequiredDescription
list_idstringyesThe task list ID (use "@" for default list)
titlestringyesTitle of the task
notesstringnoNotes or description
duestringnoDue date in RFC 3339 format (e.g., "2026-04-30T00:00:00.000Z")

Example

local result = app.integrations["google-tasks"].create_task({
  list_id = "@default",
  title = "Review pull request",
  notes = "Check the new API endpoints in the integration package",
  due = "2026-04-07T00:00:00.000Z"
})

print("Created task: " .. result.id .. " — " .. result.title)

get_current_user

Get information about the currently authenticated Google user.

Parameters

None.

Example

local result = app.integrations["google-tasks"].get_current_user({})

print("Connected as: " .. (result.name or "unknown"))

Multi-Account Usage

If you have multiple Google accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations["google-tasks"].list_task_lists({})

-- Explicit default (portable across setups)
app.integrations["google-tasks"].default.list_task_lists({})

-- Named accounts
app.integrations["google-tasks"].work.list_task_lists({})
app.integrations["google-tasks"].personal.list_task_lists({})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Google Tasks — Lua API Reference

## list_task_lists

List all task lists for the authenticated user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `maxResults` | integer | no | Max task lists per page (default: 20, max: 100) |
| `pageToken` | string | no | Token for the next page of results |
| `showCompleted` | boolean | no | Show completed tasks (default: true) |
| `showHidden` | boolean | no | Show hidden task lists (default: false) |

### Example

```lua
local result = app.integrations["google-tasks"].list_task_lists({
  maxResults = 20
})

for _, list in ipairs(result.items) do
  print(list.id .. ": " .. list.title)
end
```

---

## get_task_list

Get a specific task list by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The task list ID |

### Example

```lua
local result = app.integrations["google-tasks"].get_task_list({
  id = "MDczMjU3MzI5NjU3MzQ1NzI5MjQ6MDow"
})

print(result.title)
```

---

## create_task_list

Create a new task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | Title of the new task list |

### Example

```lua
local result = app.integrations["google-tasks"].create_task_list({
  title = "Work Projects"
})

print("Created list: " .. result.id .. " — " .. result.title)
```

---

## list_tasks

List tasks in a specific task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | yes | The task list ID (use `"@"` for default list) |
| `maxResults` | integer | no | Max tasks per page (default: 20, max: 100) |
| `pageToken` | string | no | Token for the next page of results |
| `showCompleted` | boolean | no | Include completed tasks (default: true) |
| `dueDate` | string | no | ISO 8601 date to filter tasks due before this date |

### Example

```lua
local result = app.integrations["google-tasks"].list_tasks({
  list_id = "MDczMjU3MzI5NjU3MzQ1NzI5MjQ6MDow",
  maxResults = 10,
  showCompleted = false
})

for _, task in ipairs(result.items) do
  local due = task.due or "no due date"
  print(task.title .. " — due: " .. due)
end
```

---

## get_task

Get a specific task by ID from a task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | yes | The task list ID |
| `id` | string | yes | The task ID |

### Example

```lua
local result = app.integrations["google-tasks"].get_task({
  list_id = "MDczMjU3MzI5NjU3MzQ1NzI5MjQ6MDow",
  id = "task_id_here"
})

print(result.title)
print(result.notes or "No notes")
print("Status: " .. result.status)
```

---

## create_task

Create a new task in a task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | yes | The task list ID (use `"@"` for default list) |
| `title` | string | yes | Title of the task |
| `notes` | string | no | Notes or description |
| `due` | string | no | Due date in RFC 3339 format (e.g., `"2026-04-30T00:00:00.000Z"`) |

### Example

```lua
local result = app.integrations["google-tasks"].create_task({
  list_id = "@default",
  title = "Review pull request",
  notes = "Check the new API endpoints in the integration package",
  due = "2026-04-07T00:00:00.000Z"
})

print("Created task: " .. result.id .. " — " .. result.title)
```

---

## get_current_user

Get information about the currently authenticated Google user.

### Parameters

None.

### Example

```lua
local result = app.integrations["google-tasks"].get_current_user({})

print("Connected as: " .. (result.name or "unknown"))
```

---

## Multi-Account Usage

If you have multiple Google accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations["google-tasks"].list_task_lists({})

-- Explicit default (portable across setups)
app.integrations["google-tasks"].default.list_task_lists({})

-- Named accounts
app.integrations["google-tasks"].work.list_task_lists({})
app.integrations["google-tasks"].personal.list_task_lists({})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.google_tasks.gtasks_list_task_lists({
  maxResults = 1,
  pageToken = "example_pageToken",
  showCompleted = true,
  showHidden = true
})
print(result)

Functions

gtasks_list_task_lists

List all task lists for the authenticated user in Google Tasks. Returns task list IDs and titles that can be used to manage tasks within each list.

Operation
Read read
Full name
google-tasks.gtasks_list_task_lists
ParameterTypeRequiredDescription
maxResults integer no Maximum number of task lists to return per page (default: 20, max: 100).
pageToken string no Token for the next page of results from a previous list call.
showCompleted boolean no Whether to show completed tasks in the response (default: true).
showHidden boolean no Whether to show hidden task lists (default: false).

gtasks_get_task_list

Get a specific task list by its ID in Google Tasks. Returns the task list title, ID, and other metadata.

Operation
Read read
Full name
google-tasks.gtasks_get_task_list
ParameterTypeRequiredDescription
id string yes The task list ID (use "list_task_lists" to find IDs).

gtasks_create_task_list

Create a new task list in Google Tasks. Provide a title for the new list.

Operation
Write write
Full name
google-tasks.gtasks_create_task_list
ParameterTypeRequiredDescription
title string yes The title of the new task list (e.g., "Work Projects", "Shopping List").

gtasks_list_tasks

List tasks in a specific task list in Google Tasks. Returns task titles, IDs, status, due dates, and notes. Use "list_task_lists" first to find the task list ID.

Operation
Read read
Full name
google-tasks.gtasks_list_tasks
ParameterTypeRequiredDescription
list_id string yes The task list ID (use "list_task_lists" to find IDs). Use "@" for the default list.
maxResults integer no Maximum number of tasks to return per page (default: 20, max: 100).
pageToken string no Token for the next page of results from a previous list call.
showCompleted boolean no Whether to include completed tasks (default: true).
dueDate string no ISO 8601 timestamp to filter tasks due before this date (e.g., "2026-04-30T00:00:00.000Z").

gtasks_get_task

Get a specific task by its ID from a task list in Google Tasks. Returns the task title, notes, due date, status, and other details.

Operation
Read read
Full name
google-tasks.gtasks_get_task
ParameterTypeRequiredDescription
list_id string yes The task list ID (use "list_task_lists" to find IDs).
id string yes The task ID (use "list_tasks" to find task IDs).

gtasks_create_task

Create a new task in a Google Tasks list. Provide a title, and optionally notes and a due date.

Operation
Write write
Full name
google-tasks.gtasks_create_task
ParameterTypeRequiredDescription
list_id string yes The task list ID (use "list_task_lists" to find IDs). Use "@" for the default list.
title string yes The title of the task (e.g., "Buy groceries").
notes string no Notes or description for the task.
due string no Due date in RFC 3339 format (e.g., "2026-04-30T00:00:00.000Z").

gtasks_get_current_user

Get information about the currently authenticated Google user. Useful for verifying the connected account.

Operation
Read read
Full name
google-tasks.gtasks_get_current_user
ParameterTypeRequiredDescription
No parameters.