modal_list_apps
List all Modal apps. Returns app IDs, names, and status details.
- Operation
- Read
read - Full name
modal.modal_list_apps
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
productivity
Agent-facing Lua documentation and function reference for the Modal KosmoKrator integration.
Agents call this integration through app.integrations.modal.*.
Use lua_read_doc("integrations.modal") inside KosmoKrator to discover the same reference at runtime.
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Modal is a serverless GPU platform for running AI and compute workloads in the cloud. This integration lets you list apps, get app details, browse functions and schedules, and manage volumes and secrets — all from Lua scripts.
Uses a Modal API Key (Bearer token). Configure it in your integration settings. The key authenticates via the Modal REST API at https://api.modal.com/v1. API keys are scoped to the user or workspace that created them — the integration can only access resources within that scope.
All tools are called via app.integrations.modal.<tool_name>({ ... }). Every function takes a single Lua table of named parameters and returns a result table.
local result = app.integrations.modal.get_app({ app_id = "ap-abc123" })
Errors surface as result.error (string). Check for it before using the response.
if result.error then
print("Error: " .. result.error)
return
end
List all Modal apps in the workspace. Returns app IDs, names, and status details.
None.
local result = app.integrations.modal.list_apps({})
if result.error then
print("Error: " .. result.error)
else
for _, app in ipairs(result) do
print(app.name .. " - " .. app.status .. " (" .. app.app_id .. ")")
end
end
Get details for a specific Modal app by ID, including status and metadata.
| Name | Type | Required | Description |
|---|---|---|---|
app_id | string | yes | The ID of the Modal app. |
local result = app.integrations.modal.get_app({ app_id = "ap-abc123" })
if result.error then
print("Error: " .. result.error)
else
print(result.name .. " - " .. result.status)
end
List all functions for a Modal app. Returns function IDs, names, and runtime details.
| Name | Type | Required | Description |
|---|---|---|---|
app_id | string | yes | The ID of the Modal app to list functions for. |
local result = app.integrations.modal.list_functions({ app_id = "ap-abc123" })
if result.error then
print("Error: " .. result.error)
else
for _, fn in ipairs(result) do
print(fn.name .. " - " .. (fn.runtime or "unknown"))
end
end
List all scheduled functions for a Modal app. Returns schedule IDs, cron expressions, and associated function details.
| Name | Type | Required | Description |
|---|---|---|---|
app_id | string | yes | The ID of the Modal app to list schedules for. |
local result = app.integrations.modal.list_schedules({ app_id = "ap-abc123" })
if result.error then
print("Error: " .. result.error)
else
for _, sched in ipairs(result) do
print(sched.function_name .. " - cron: " .. (sched.cron or "N/A"))
end
end
List all Modal volumes. Returns volume IDs, names, and size details.
None.
local result = app.integrations.modal.list_volumes({})
if result.error then
print("Error: " .. result.error)
else
for _, vol in ipairs(result) do
print(vol.name .. " - " .. (vol.size_gb or "?") .. " GB")
end
end
List all Modal secrets. Returns secret names and creation dates. Secret values are never exposed.
None.
local result = app.integrations.modal.list_secrets({})
if result.error then
print("Error: " .. result.error)
else
for _, secret in ipairs(result) do
print(secret.name .. " - created: " .. (secret.created_at or "unknown"))
end
end
Get the current authenticated Modal user information, including name, email, and account details.
None.
local result = app.integrations.modal.get_current_user({})
if result.error then
print("Error: " .. result.error)
else
print("User: " .. (result.name or result.email or "unknown"))
end
If you have multiple Modal accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.modal.list_apps({})
-- Explicit default (portable across setups)
app.integrations.modal.default.list_apps({})
-- Named accounts
app.integrations.modal.production.list_apps({})
app.integrations.modal.staging.list_apps({})
All functions are identical across accounts — only the credentials differ.
# Modal — Lua API Reference
Modal is a serverless GPU platform for running AI and compute workloads in the cloud. This integration lets you list apps, get app details, browse functions and schedules, and manage volumes and secrets — all from Lua scripts.
## Authentication
Uses a **Modal API Key** (Bearer token). Configure it in your integration settings. The key authenticates via the Modal REST API at `https://api.modal.com/v1`. API keys are scoped to the user or workspace that created them — the integration can only access resources within that scope.
---
## Overview
All tools are called via `app.integrations.modal.<tool_name>({ ... })`. Every function takes a single Lua table of named parameters and returns a result table.
```lua
local result = app.integrations.modal.get_app({ app_id = "ap-abc123" })
```
Errors surface as `result.error` (string). Check for it before using the response.
```lua
if result.error then
print("Error: " .. result.error)
return
end
```
---
## list_apps
List all Modal apps in the workspace. Returns app IDs, names, and status details.
### Parameters
None.
### Example
```lua
local result = app.integrations.modal.list_apps({})
if result.error then
print("Error: " .. result.error)
else
for _, app in ipairs(result) do
print(app.name .. " - " .. app.status .. " (" .. app.app_id .. ")")
end
end
```
---
## get_app
Get details for a specific Modal app by ID, including status and metadata.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `app_id` | string | yes | The ID of the Modal app. |
### Example
```lua
local result = app.integrations.modal.get_app({ app_id = "ap-abc123" })
if result.error then
print("Error: " .. result.error)
else
print(result.name .. " - " .. result.status)
end
```
---
## list_functions
List all functions for a Modal app. Returns function IDs, names, and runtime details.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `app_id` | string | yes | The ID of the Modal app to list functions for. |
### Example
```lua
local result = app.integrations.modal.list_functions({ app_id = "ap-abc123" })
if result.error then
print("Error: " .. result.error)
else
for _, fn in ipairs(result) do
print(fn.name .. " - " .. (fn.runtime or "unknown"))
end
end
```
---
## list_schedules
List all scheduled functions for a Modal app. Returns schedule IDs, cron expressions, and associated function details.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `app_id` | string | yes | The ID of the Modal app to list schedules for. |
### Example
```lua
local result = app.integrations.modal.list_schedules({ app_id = "ap-abc123" })
if result.error then
print("Error: " .. result.error)
else
for _, sched in ipairs(result) do
print(sched.function_name .. " - cron: " .. (sched.cron or "N/A"))
end
end
```
---
## list_volumes
List all Modal volumes. Returns volume IDs, names, and size details.
### Parameters
None.
### Example
```lua
local result = app.integrations.modal.list_volumes({})
if result.error then
print("Error: " .. result.error)
else
for _, vol in ipairs(result) do
print(vol.name .. " - " .. (vol.size_gb or "?") .. " GB")
end
end
```
---
## list_secrets
List all Modal secrets. Returns secret names and creation dates. Secret values are never exposed.
### Parameters
None.
### Example
```lua
local result = app.integrations.modal.list_secrets({})
if result.error then
print("Error: " .. result.error)
else
for _, secret in ipairs(result) do
print(secret.name .. " - created: " .. (secret.created_at or "unknown"))
end
end
```
---
## get_current_user
Get the current authenticated Modal user information, including name, email, and account details.
### Parameters
None.
### Example
```lua
local result = app.integrations.modal.get_current_user({})
if result.error then
print("Error: " .. result.error)
else
print("User: " .. (result.name or result.email or "unknown"))
end
```
---
## Multi-Account Usage
If you have multiple Modal accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.modal.list_apps({})
-- Explicit default (portable across setups)
app.integrations.modal.default.list_apps({})
-- Named accounts
app.integrations.modal.production.list_apps({})
app.integrations.modal.staging.list_apps({})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.modal.modal_list_apps({})
print(result) modal_list_appsList all Modal apps. Returns app IDs, names, and status details.
readmodal.modal_list_apps| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
modal_get_appGet details for a specific Modal app by ID, including status and metadata.
readmodal.modal_get_app| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | no | The ID of the Modal app. |
modal_list_functionsList all functions for a Modal app. Returns function IDs, names, and runtime details.
readmodal.modal_list_functions| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | no | The ID of the Modal app to list functions for. |
modal_list_schedulesList all scheduled functions for a Modal app. Returns schedule IDs, cron expressions, and function details.
readmodal.modal_list_schedules| Parameter | Type | Required | Description |
|---|---|---|---|
app_id | string | no | The ID of the Modal app to list schedules for. |
modal_list_volumesList all Modal volumes. Returns volume IDs, names, and size details.
readmodal.modal_list_volumes| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
modal_list_secretsList all Modal secrets. Returns secret names and creation dates (values are not exposed).
readmodal.modal_list_secrets| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
modal_get_current_userGet the current authenticated Modal user information, including name, email, and account details.
readmodal.modal_get_current_user| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||