KosmoKrator

productivity

Microsoft To Do Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Microsoft To Do KosmoKrator integration.

7 functions 5 read 2 write Manual OAuth token auth

Lua Namespace

Agents call this integration through app.integrations.microsoft_todo.*. Use lua_read_doc("integrations.microsoft_todo") 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.

Microsoft To Do — Lua API Reference

list_lists

List all Microsoft To Do task lists for the authenticated user.

Parameters

None.

Response

Returns an object with lists (array) and count (number).

Each list contains:

  • id — unique list identifier
  • displayName — the list name
  • wellknownListName — e.g. "defaultList", "none"
  • isOwner — whether the user owns the list
  • isShared — whether the list is shared

Example

local result = app.integrations.microsoft_todo.list_lists()

for _, list in ipairs(result.lists) do
  print(list.displayName .. " (" .. list.id .. ")")
end

get_list

Get a specific Microsoft To Do task list by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe unique identifier of the task list

Example

local result = app.integrations.microsoft_todo.get_list({
  id = "AQMkAGI1NzQz..."
})

print(result.displayName)

create_list

Create a new Microsoft To Do task list.

Parameters

NameTypeRequiredDescription
displayNamestringyesThe name of the new task list

Example

local result = app.integrations.microsoft_todo.create_list({
  displayName = "Work Tasks"
})

print("Created list: " .. result.displayName .. " (ID: " .. result.id .. ")")

list_tasks

List all tasks in a Microsoft To Do task list.

Parameters

NameTypeRequiredDescription
list_idstringyesThe unique identifier of the task list

Response

Returns an object with tasks (array) and count (number).

Each task contains:

  • id — unique task identifier
  • title — task title
  • status"notStarted", "inProgress", "completed", "waitingOnOthers", "deferred"
  • body — body content object (may be null)
  • dueDateTime — due date object (may be null)
  • importance"low", "normal", "high"
  • createdDateTime — creation timestamp
  • lastModifiedDateTime — last modified timestamp

Example

local result = app.integrations.microsoft_todo.list_tasks({
  list_id = "AQMkAGI1NzQz..."
})

for _, task in ipairs(result.tasks) do
  local status = task.status or "unknown"
  print(task.title .. " [" .. status .. "]")
end

get_task

Get a specific task from a Microsoft To Do task list.

Parameters

NameTypeRequiredDescription
list_idstringyesThe unique identifier of the task list
idstringyesThe unique identifier of the task

Example

local result = app.integrations.microsoft_todo.get_task({
  list_id = "AQMkAGI1NzQz...",
  id = "AAMkAGI1NzQz..."
})

print(result.title)
print(result.status)
if result.dueDateTime then
  print("Due: " .. result.dueDateTime.dateTime)
end

create_task

Create a new task in a Microsoft To Do task list.

Parameters

NameTypeRequiredDescription
list_idstringyesThe unique identifier of the task list
titlestringyesThe title of the task
bodystringnoBody/content text for the task
due_datestringnoDue date in ISO 8601 format (e.g., "2026-04-30T00:00:00")
due_timezonestringnoTimezone for the due date (e.g., "UTC", "Europe/Amsterdam"). Defaults to "UTC"

Example

local result = app.integrations.microsoft_todo.create_task({
  list_id = "AQMkAGI1NzQz...",
  title = "Review pull request",
  body = "Check the new authentication module",
  due_date = "2026-04-30T17:00:00",
  due_timezone = "Europe/Amsterdam"
})

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

get_current_user

Get the authenticated Microsoft user’s profile.

Parameters

None.

Response

Returns an object with:

  • id — user ID
  • displayName — user’s display name
  • mail — email address
  • userPrincipalName — UPN
  • jobTitle — job title
  • officeLocation — office location

Example

local result = app.integrations.microsoft_todo.get_current_user()

print("Connected as: " .. result.displayName)
print("Email: " .. (result.mail or result.userPrincipalName))

Multi-Account Usage

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

-- Default account (always works)
app.integrations.microsoft_todo.list_lists({})

-- Explicit default (portable across setups)
app.integrations.microsoft_todo.default.list_lists({})

-- Named accounts
app.integrations.microsoft_todo.work.list_lists({})
app.integrations.microsoft_todo.personal.create_task({
  list_id = "...",
  title = "Book vacation"
})

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

Raw agent markdown
# Microsoft To Do — Lua API Reference

## list_lists

List all Microsoft To Do task lists for the authenticated user.

### Parameters

None.

### Response

Returns an object with `lists` (array) and `count` (number).

Each list contains:
- `id` — unique list identifier
- `displayName` — the list name
- `wellknownListName` — e.g. `"defaultList"`, `"none"`
- `isOwner` — whether the user owns the list
- `isShared` — whether the list is shared

### Example

```lua
local result = app.integrations.microsoft_todo.list_lists()

for _, list in ipairs(result.lists) do
  print(list.displayName .. " (" .. list.id .. ")")
end
```

---

## get_list

Get a specific Microsoft To Do task list by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique identifier of the task list |

### Example

```lua
local result = app.integrations.microsoft_todo.get_list({
  id = "AQMkAGI1NzQz..."
})

print(result.displayName)
```

---

## create_list

Create a new Microsoft To Do task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `displayName` | string | yes | The name of the new task list |

### Example

```lua
local result = app.integrations.microsoft_todo.create_list({
  displayName = "Work Tasks"
})

print("Created list: " .. result.displayName .. " (ID: " .. result.id .. ")")
```

---

## list_tasks

List all tasks in a Microsoft To Do task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | yes | The unique identifier of the task list |

### Response

Returns an object with `tasks` (array) and `count` (number).

Each task contains:
- `id` — unique task identifier
- `title` — task title
- `status` — `"notStarted"`, `"inProgress"`, `"completed"`, `"waitingOnOthers"`, `"deferred"`
- `body` — body content object (may be null)
- `dueDateTime` — due date object (may be null)
- `importance` — `"low"`, `"normal"`, `"high"`
- `createdDateTime` — creation timestamp
- `lastModifiedDateTime` — last modified timestamp

### Example

```lua
local result = app.integrations.microsoft_todo.list_tasks({
  list_id = "AQMkAGI1NzQz..."
})

for _, task in ipairs(result.tasks) do
  local status = task.status or "unknown"
  print(task.title .. " [" .. status .. "]")
end
```

---

## get_task

Get a specific task from a Microsoft To Do task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | yes | The unique identifier of the task list |
| `id` | string | yes | The unique identifier of the task |

### Example

```lua
local result = app.integrations.microsoft_todo.get_task({
  list_id = "AQMkAGI1NzQz...",
  id = "AAMkAGI1NzQz..."
})

print(result.title)
print(result.status)
if result.dueDateTime then
  print("Due: " .. result.dueDateTime.dateTime)
end
```

---

## create_task

Create a new task in a Microsoft To Do task list.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | yes | The unique identifier of the task list |
| `title` | string | yes | The title of the task |
| `body` | string | no | Body/content text for the task |
| `due_date` | string | no | Due date in ISO 8601 format (e.g., `"2026-04-30T00:00:00"`) |
| `due_timezone` | string | no | Timezone for the due date (e.g., `"UTC"`, `"Europe/Amsterdam"`). Defaults to `"UTC"` |

### Example

```lua
local result = app.integrations.microsoft_todo.create_task({
  list_id = "AQMkAGI1NzQz...",
  title = "Review pull request",
  body = "Check the new authentication module",
  due_date = "2026-04-30T17:00:00",
  due_timezone = "Europe/Amsterdam"
})

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

---

## get_current_user

Get the authenticated Microsoft user's profile.

### Parameters

None.

### Response

Returns an object with:
- `id` — user ID
- `displayName` — user's display name
- `mail` — email address
- `userPrincipalName` — UPN
- `jobTitle` — job title
- `officeLocation` — office location

### Example

```lua
local result = app.integrations.microsoft_todo.get_current_user()

print("Connected as: " .. result.displayName)
print("Email: " .. (result.mail or result.userPrincipalName))
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.microsoft_todo.list_lists({})

-- Explicit default (portable across setups)
app.integrations.microsoft_todo.default.list_lists({})

-- Named accounts
app.integrations.microsoft_todo.work.list_lists({})
app.integrations.microsoft_todo.personal.create_task({
  list_id = "...",
  title = "Book vacation"
})
```

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

Metadata-Derived Lua Example

local result = app.integrations.microsoft_todo.todo_list_lists({})
print(result)

Functions

todo_list_lists

List all Microsoft To Do task lists for the authenticated user. Returns the list ID, display name, and well-known name for each list.

Operation
Read read
Full name
microsoft_todo.todo_list_lists
ParameterTypeRequiredDescription
No parameters.

todo_get_list

Get a specific Microsoft To Do task list by its ID. Returns the list details including display name and well-known name.

Operation
Read read
Full name
microsoft_todo.todo_get_list
ParameterTypeRequiredDescription
id string yes The unique identifier of the todo task list.

todo_create_list

Create a new Microsoft To Do task list. Provide a display name for the list.

Operation
Write write
Full name
microsoft_todo.todo_create_list
ParameterTypeRequiredDescription
displayName string yes The name of the new task list (e.g., "Shopping List", "Work Tasks").

todo_list_tasks

List all tasks in a Microsoft To Do task list. Returns task titles, statuses, body content, and due dates.

Operation
Read read
Full name
microsoft_todo.todo_list_tasks
ParameterTypeRequiredDescription
list_id string yes The unique identifier of the todo task list.

todo_get_task

Get a specific task from a Microsoft To Do task list by its ID. Returns full task details including title, body, status, due date, and importance.

Operation
Read read
Full name
microsoft_todo.todo_get_task
ParameterTypeRequiredDescription
list_id string yes The unique identifier of the todo task list.
id string yes The unique identifier of the task.

todo_create_task

Create a new task in a Microsoft To Do task list. Provide a title, and optionally a body and due date.

Operation
Write write
Full name
microsoft_todo.todo_create_task
ParameterTypeRequiredDescription
list_id string yes The unique identifier of the todo task list to add the task to.
title string yes The title of the task (e.g., "Buy groceries").
body string no Optional body/content text for the task.
due_date string no Optional due date in ISO 8601 format (e.g., "2026-04-30T00:00:00").
due_timezone string no Timezone for the due date (e.g., "UTC", "Europe/Amsterdam"). Defaults to "UTC".

todo_get_current_user

Get the authenticated Microsoft user profile. Returns display name, email, and other account details. Useful for verifying which account is connected.

Operation
Read read
Full name
microsoft_todo.todo_get_current_user
ParameterTypeRequiredDescription
No parameters.