KosmoKrator

data

Loom Lua API for KosmoKrator Agents

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

Lua Namespace

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

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Loom workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.loom.list_videos({limit = 1, page = 1}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("loom"))' --json
kosmo integrations:lua --eval 'print(docs.read("loom.list_videos"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local loom = app.integrations.loom
local result = loom.list_videos({limit = 1, page = 1})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.loom, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.loom.default.* or app.integrations.loom.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Loom, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

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

Loom — Lua API Reference

list_videos

List Loom videos with pagination support.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of videos to return (default: 20, max: 50)
pageintegernoPage number for pagination (default: 1)

Examples

List recent videos

local result = app.integrations.loom.list_videos({
  limit = 10,
  page = 1
})

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

Paginate through all videos

local page = 1
local limit = 50

repeat
  local result = app.integrations.loom.list_videos({
    limit = limit,
    page = page
  })

  for _, video in ipairs(result.videos or {}) do
    print(video.title)
  end

  page = page + 1
until #result == 0 or #result < limit

get_video

Get detailed information about a specific Loom video.

Parameters

NameTypeRequiredDescription
video_idstringyesThe unique identifier of the Loom video

Examples

Get video details

local result = app.integrations.loom.get_video({
  video_id = "abc123-def456"
})

print(result.title)
print(result.duration)
print(result.playback_url)

create_video

Create a new Loom video placeholder with a title and optional description.

Parameters

NameTypeRequiredDescription
titlestringyesThe title of the video
descriptionstringnoAn optional description for the video

Examples

Create a video

local result = app.integrations.loom.create_video({
  title = "Sprint Review - Week 14",
  description = "Weekly sprint review covering completed features and blockers."
})

print("Created video: " .. result.id)

delete_video

Delete a Loom video permanently. This action cannot be undone.

Parameters

NameTypeRequiredDescription
video_idstringyesThe unique identifier of the video to delete

Examples

Delete a video

local result = app.integrations.loom.delete_video({
  video_id = "abc123-def456"
})

print(result)

list_folders

List Loom folders with pagination support.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of folders to return (default: 20)
pageintegernoPage number for pagination (default: 1)

Examples

List folders

local result = app.integrations.loom.list_folders({
  limit = 20,
  page = 1
})

for _, folder in ipairs(result.folders or result) do
  print(folder.name .. " (ID: " .. folder.id .. ")")
end

get_folder

Get detailed information about a specific Loom folder.

Parameters

NameTypeRequiredDescription
folder_idstringyesThe unique identifier of the Loom folder

Examples

Get folder details

local result = app.integrations.loom.get_folder({
  folder_id = "folder-abc123"
})

print(result.name)
print("Video count: " .. result.video_count)

list_workspaces

List all Loom workspaces accessible to the authenticated user.

Parameters

No parameters required.

Examples

List workspaces

local result = app.integrations.loom.list_workspaces({})

for _, workspace in ipairs(result.workspaces or result) do
  print(workspace.name .. " (ID: " .. workspace.id .. ")")
end

get_current_user

Get the authenticated Loom user’s profile information.

Parameters

No parameters required.

Examples

Get current user profile

local result = app.integrations.loom.get_current_user({})

print("Logged in as: " .. result.name .. " (" .. result.email .. ")")

Multi-Account Usage

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

-- Default account (always works)
app.integrations.loom.function_name({...})

-- Explicit default (portable across setups)
app.integrations.loom.default.function_name({...})

-- Named accounts
app.integrations.loom.work.function_name({...})
app.integrations.loom.personal.function_name({...})

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

Raw agent markdown
# Loom — Lua API Reference

## list_videos

List Loom videos with pagination support.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of videos to return (default: 20, max: 50) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Examples

#### List recent videos

```lua
local result = app.integrations.loom.list_videos({
  limit = 10,
  page = 1
})

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

#### Paginate through all videos

```lua
local page = 1
local limit = 50

repeat
  local result = app.integrations.loom.list_videos({
    limit = limit,
    page = page
  })

  for _, video in ipairs(result.videos or {}) do
    print(video.title)
  end

  page = page + 1
until #result == 0 or #result < limit
```

---

## get_video

Get detailed information about a specific Loom video.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `video_id` | string | yes | The unique identifier of the Loom video |

### Examples

#### Get video details

```lua
local result = app.integrations.loom.get_video({
  video_id = "abc123-def456"
})

print(result.title)
print(result.duration)
print(result.playback_url)
```

---

## create_video

Create a new Loom video placeholder with a title and optional description.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | The title of the video |
| `description` | string | no | An optional description for the video |

### Examples

#### Create a video

```lua
local result = app.integrations.loom.create_video({
  title = "Sprint Review - Week 14",
  description = "Weekly sprint review covering completed features and blockers."
})

print("Created video: " .. result.id)
```

---

## delete_video

Delete a Loom video permanently. This action cannot be undone.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `video_id` | string | yes | The unique identifier of the video to delete |

### Examples

#### Delete a video

```lua
local result = app.integrations.loom.delete_video({
  video_id = "abc123-def456"
})

print(result)
```

---

## list_folders

List Loom folders with pagination support.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of folders to return (default: 20) |
| `page` | integer | no | Page number for pagination (default: 1) |

### Examples

#### List folders

```lua
local result = app.integrations.loom.list_folders({
  limit = 20,
  page = 1
})

for _, folder in ipairs(result.folders or result) do
  print(folder.name .. " (ID: " .. folder.id .. ")")
end
```

---

## get_folder

Get detailed information about a specific Loom folder.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `folder_id` | string | yes | The unique identifier of the Loom folder |

### Examples

#### Get folder details

```lua
local result = app.integrations.loom.get_folder({
  folder_id = "folder-abc123"
})

print(result.name)
print("Video count: " .. result.video_count)
```

---

## list_workspaces

List all Loom workspaces accessible to the authenticated user.

### Parameters

No parameters required.

### Examples

#### List workspaces

```lua
local result = app.integrations.loom.list_workspaces({})

for _, workspace in ipairs(result.workspaces or result) do
  print(workspace.name .. " (ID: " .. workspace.id .. ")")
end
```

---

## get_current_user

Get the authenticated Loom user's profile information.

### Parameters

No parameters required.

### Examples

#### Get current user profile

```lua
local result = app.integrations.loom.get_current_user({})

print("Logged in as: " .. result.name .. " (" .. result.email .. ")")
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.loom.function_name({...})

-- Explicit default (portable across setups)
app.integrations.loom.default.function_name({...})

-- Named accounts
app.integrations.loom.work.function_name({...})
app.integrations.loom.personal.function_name({...})
```

All functions are identical across accounts — only the credentials differ.
Metadata-derived Lua example
local result = app.integrations.loom.list_videos({limit = 1, page = 1})
print(result)

Functions

list_videos Read

List Loom videos. Returns video titles, IDs, durations, URLs, and creation dates. Use limit and page for pagination.

Lua path
app.integrations.loom.list_videos
Full name
loom.loom_list_videos
ParameterTypeRequiredDescription
limit integer no Maximum number of videos to return (default: 20, max: 50).
page integer no Page number for pagination (default: 1).
get_video Read

Get detailed information about a specific Loom video by its ID, including playback URL, duration, thumbnail, and metadata.

Lua path
app.integrations.loom.get_video
Full name
loom.loom_get_video
ParameterTypeRequiredDescription
video_id string yes The unique identifier of the Loom video.
create_video Write

Create a new Loom video with a title and optional description. Returns the video details and upload URLs.

Lua path
app.integrations.loom.create_video
Full name
loom.loom_create_video
ParameterTypeRequiredDescription
title string yes The title of the video.
description string no An optional description for the video.
delete_video Write

Delete a Loom video permanently. This action cannot be undone.

Lua path
app.integrations.loom.delete_video
Full name
loom.loom_delete_video
ParameterTypeRequiredDescription
video_id string yes The unique identifier of the Loom video to delete.
list_workspaces Read

List all Loom workspaces accessible to the authenticated user, including workspace names and member information.

Lua path
app.integrations.loom.list_workspaces
Full name
loom.loom_list_workspaces
ParameterTypeRequiredDescription
No parameters.
list_folders Read

List Loom folders. Returns folder names, IDs, and video counts. Use limit and page for pagination.

Lua path
app.integrations.loom.list_folders
Full name
loom.loom_list_folders
ParameterTypeRequiredDescription
limit integer no Maximum number of folders to return (default: 20).
page integer no Page number for pagination (default: 1).
get_folder Read

Get detailed information about a specific Loom folder by its ID, including name, video count, and hierarchy.

Lua path
app.integrations.loom.get_folder
Full name
loom.loom_get_folder
ParameterTypeRequiredDescription
folder_id string yes The unique identifier of the Loom folder.
get_current_user Read

Get the authenticated Loom user's profile information, including name, email, and account details.

Lua path
app.integrations.loom.get_current_user
Full name
loom.loom_get_current_user
ParameterTypeRequiredDescription
No parameters.