KosmoKrator

other

Supabase Lua API for KosmoKrator Agents

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

9 functions 9 read 0 write Bearer token auth

Lua Namespace

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

Supabase — Lua API Reference

list_projects

List all Supabase projects in the organization.

Parameters

None.

Example

local result = app.integrations.supabase.list_projects({})

for _, project in ipairs(result) do
  print(project.id .. ": " .. project.name .. " (" .. project.region .. ")")
end

get_project

Get details of a specific Supabase project.

Parameters

NameTypeRequiredDescription
project_refstringyesThe project reference ID

Example

local result = app.integrations.supabase.get_project({
  project_ref = "my_project_ref"
})

print("Project: " .. result.name)
print("Region: " .. result.region)
print("Status: " .. result.status)

list_tables

List all tables in a Supabase project.

Parameters

NameTypeRequiredDescription
project_refstringyesThe project reference ID

Example

local result = app.integrations.supabase.list_tables({
  project_ref = "my_project_ref"
})

for _, table in ipairs(result) do
  print(table.id .. ": " .. table.name)
end

get_table

Get details of a specific table in a project.

Parameters

NameTypeRequiredDescription
project_refstringyesThe project reference ID
table_idstringyesThe table ID

Example

local result = app.integrations.supabase.get_table({
  project_ref = "my_project_ref",
  table_id = "my_table_id"
})

print("Table: " .. result.name)

list_rows

List rows in a Supabase table.

Parameters

NameTypeRequiredDescription
project_refstringyesThe project reference ID
table_namestringyesThe table name or ID
limitintegernoMaximum number of rows to return (default: 100)
offsetintegernoOffset for pagination (default: 0)
selectstringnoComma-separated list of columns to select
orderstringnoColumn to order by, with optional direction (e.g. "id.desc")

Example

local result = app.integrations.supabase.list_rows({
  project_ref = "my_project_ref",
  table_name = "users",
  limit = 10,
  order = "created_at.desc"
})

for _, row in ipairs(result) do
  print(row.id .. ": " .. (row.name or "unnamed"))
end

get_row

Get a single row by its ID.

Parameters

NameTypeRequiredDescription
project_refstringyesThe project reference ID
table_namestringyesThe table name or ID
row_idstringyesThe row ID

Example

local result = app.integrations.supabase.get_row({
  project_ref = "my_project_ref",
  table_name = "users",
  row_id = "my_row_id"
})

for key, value in pairs(result) do
  print("  " .. key .. " = " .. tostring(value))
end

get_current_user

Get the currently authenticated Supabase user profile.

Parameters

None.

Example

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

print("User: " .. result.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.supabase.list_projects({})

-- Explicit default (portable across setups)
app.integrations.supabase.default.list_projects({})

-- Named accounts
app.integrations.supabase.production.list_projects({})
app.integrations.supabase.staging.list_projects({})

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

Raw agent markdown
# Supabase — Lua API Reference

## list_projects

List all Supabase projects in the organization.

### Parameters

None.

### Example

```lua
local result = app.integrations.supabase.list_projects({})

for _, project in ipairs(result) do
  print(project.id .. ": " .. project.name .. " (" .. project.region .. ")")
end
```

---

## get_project

Get details of a specific Supabase project.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_ref` | string | yes | The project reference ID |

### Example

```lua
local result = app.integrations.supabase.get_project({
  project_ref = "my_project_ref"
})

print("Project: " .. result.name)
print("Region: " .. result.region)
print("Status: " .. result.status)
```

---

## list_tables

List all tables in a Supabase project.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_ref` | string | yes | The project reference ID |

### Example

```lua
local result = app.integrations.supabase.list_tables({
  project_ref = "my_project_ref"
})

for _, table in ipairs(result) do
  print(table.id .. ": " .. table.name)
end
```

---

## get_table

Get details of a specific table in a project.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_ref` | string | yes | The project reference ID |
| `table_id` | string | yes | The table ID |

### Example

```lua
local result = app.integrations.supabase.get_table({
  project_ref = "my_project_ref",
  table_id = "my_table_id"
})

print("Table: " .. result.name)
```

---

## list_rows

List rows in a Supabase table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_ref` | string | yes | The project reference ID |
| `table_name` | string | yes | The table name or ID |
| `limit` | integer | no | Maximum number of rows to return (default: 100) |
| `offset` | integer | no | Offset for pagination (default: 0) |
| `select` | string | no | Comma-separated list of columns to select |
| `order` | string | no | Column to order by, with optional direction (e.g. `"id.desc"`) |

### Example

```lua
local result = app.integrations.supabase.list_rows({
  project_ref = "my_project_ref",
  table_name = "users",
  limit = 10,
  order = "created_at.desc"
})

for _, row in ipairs(result) do
  print(row.id .. ": " .. (row.name or "unnamed"))
end
```

---

## get_row

Get a single row by its ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_ref` | string | yes | The project reference ID |
| `table_name` | string | yes | The table name or ID |
| `row_id` | string | yes | The row ID |

### Example

```lua
local result = app.integrations.supabase.get_row({
  project_ref = "my_project_ref",
  table_name = "users",
  row_id = "my_row_id"
})

for key, value in pairs(result) do
  print("  " .. key .. " = " .. tostring(value))
end
```

---

## get_current_user

Get the currently authenticated Supabase user profile.

### Parameters

None.

### Example

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

print("User: " .. result.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.supabase.list_projects({})

-- Explicit default (portable across setups)
app.integrations.supabase.default.list_projects({})

-- Named accounts
app.integrations.supabase.production.list_projects({})
app.integrations.supabase.staging.list_projects({})
```

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

Metadata-Derived Lua Example

local result = app.integrations.supabase.supabase_get_current_user({})
print(result)

Functions

supabase_get_current_user

Get the currently authenticated Supabase user profile information.

Operation
Read read
Full name
supabase.supabase_get_current_user
ParameterTypeRequiredDescription
No parameters.

supabase_get_project

Get details of a specific Supabase project by its reference ID.

Operation
Read read
Full name
supabase.supabase_get_project
ParameterTypeRequiredDescription
project_ref string yes The project reference ID.

supabase_get_row

Get a single row from a Supabase table by its ID.

Operation
Read read
Full name
supabase.supabase_get_row
ParameterTypeRequiredDescription
project_ref string yes The project reference ID.
table_name string yes The table name or ID.
row_id string yes The row ID.

supabase_get_settings

Get the OpenAPI spec info for the Supabase PostgREST instance. Returns database metadata, available tables, and schema information.

Operation
Read read
Full name
supabase.supabase_get_settings
ParameterTypeRequiredDescription
No parameters.

supabase_get_table

Get details of a specific table in a Supabase project by its ID.

Operation
Read read
Full name
supabase.supabase_get_table
ParameterTypeRequiredDescription
project_ref string yes The project reference ID.
table_id string yes The table ID.

supabase_list_projects

List all Supabase projects in the organization. Returns project IDs, names, and regions.

Operation
Read read
Full name
supabase.supabase_list_projects
ParameterTypeRequiredDescription
No parameters.

supabase_list_rows

List rows in a Supabase table. Returns row data and metadata.

Operation
Read read
Full name
supabase.supabase_list_rows
ParameterTypeRequiredDescription
project_ref string yes The project reference ID.
table_name string yes The table name or ID.
limit integer no Maximum number of rows to return (default: 100).
offset integer no Offset for pagination (default: 0).
select string no Comma-separated list of columns to select.
order string no Column to order by, with optional direction (e.g. "id.desc").

supabase_list_tables

List all tables in a Supabase project. Returns table IDs, names, and schemas.

Operation
Read read
Full name
supabase.supabase_list_tables
ParameterTypeRequiredDescription
project_ref string yes The project reference ID.

supabase_query_with_filters

Query a Supabase table using advanced PostgREST filter operators. Provide filters as a JSON array of objects, each with "column", "operator", and "value" keys. Supported operators: eq, neq, gt, gte, lt, lte, like, ilike, in, is, cs, cd, ov, sl, sr, nxr, nxl, adj, not, or, and. Example filters_json: [ {"column": "status", "operator": "eq", "value": "active"}, {"column": "age", "operator": "gte", "value": 18} ]

Operation
Read read
Full name
supabase.supabase_query_with_filters
ParameterTypeRequiredDescription
table string yes Table name.
filters_json string yes JSON array of filter objects with "column", "operator", and "value" keys.
select string no Comma-separated column names (default "*").
order string no Order clause, e.g., "created_at.desc".
limit integer no Maximum number of rows to return.