KosmoKrator

productivity

Contabo Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.contabo.*. Use lua_read_doc("integrations.contabo") 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 Contabo workflow without starting an interactive agent session.

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

Workflow file

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

workflow.lua
local contabo = app.integrations.contabo
local result = contabo.list_instances({page = 1, per_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.contabo, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.contabo.default.* or app.integrations.contabo.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Contabo, 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.

Contabo — Lua API Reference

list_instances

List all compute instances (VPS) in the Contabo account.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default: 1)
per_pageintegernoItems per page (default: 20)

Example

local result = app.integrations.contabo.list_instances({
  per_page = 50
})

for _, instance in ipairs(result.data) do
  print(instance.name .. " (" .. instance.status .. ") - " .. instance.ipConfig.v4.ip)
end

get_instance

Get details for a specific compute instance (VPS).

Parameters

NameTypeRequiredDescription
idintegeryesThe instance ID

Example

local result = app.integrations.contabo.get_instance({ id = 12345 })
local inst = result.data
print(inst.name .. " - " .. inst.region .. " - " .. inst.ipConfig.v4.ip)

list_snapshots

List all snapshots in the Contabo account.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default: 1)
per_pageintegernoItems per page (default: 20)

Example

local result = app.integrations.contabo.list_snapshots({})

for _, snap in ipairs(result.data) do
  print(snap.name .. " - instance: " .. snap.instanceId .. " - " .. snap.createdDate)
end

list_images

List all custom images in the Contabo account.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default: 1)
per_pageintegernoItems per page (default: 20)

Example

local result = app.integrations.contabo.list_images({})

for _, image in ipairs(result.data) do
  print(image.name .. " - " .. image.osType .. " (" .. image.sizeMb .. " MB)")
end

list_networks

List all private networks in the Contabo account.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default: 1)
per_pageintegernoItems per page (default: 20)

Example

local result = app.integrations.contabo.list_networks({})

for _, network in ipairs(result.data) do
  print(network.name .. " - " .. network.region .. " - " .. network.cidr)
end

list_ssh_keys

List all registered SSH keys in the Contabo account.

Parameters

None.

Example

local result = app.integrations.contabo.list_ssh_keys({})

for _, key in ipairs(result.data) do
  print(key.name .. " - " .. key.fingerPrint)
end

get_current_user

Get the current authenticated Contabo account information.

Parameters

None.

Example

local result = app.integrations.contabo.get_current_user({})
local user = result.data
print("Account: " .. user.email .. " (tenant: " .. user.tenantId .. ")")

Multi-Account Usage

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

-- Default account (always works)
app.integrations.contabo.list_instances({})

-- Explicit default (portable across setups)
app.integrations.contabo.default.list_instances({})

-- Named accounts
app.integrations.contabo.production.list_instances({})
app.integrations.contabo.staging.list_instances({})

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

Raw agent markdown
# Contabo — Lua API Reference

## list_instances

List all compute instances (VPS) in the Contabo account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Items per page (default: 20) |

### Example

```lua
local result = app.integrations.contabo.list_instances({
  per_page = 50
})

for _, instance in ipairs(result.data) do
  print(instance.name .. " (" .. instance.status .. ") - " .. instance.ipConfig.v4.ip)
end
```

---

## get_instance

Get details for a specific compute instance (VPS).

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The instance ID |

### Example

```lua
local result = app.integrations.contabo.get_instance({ id = 12345 })
local inst = result.data
print(inst.name .. " - " .. inst.region .. " - " .. inst.ipConfig.v4.ip)
```

---

## list_snapshots

List all snapshots in the Contabo account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Items per page (default: 20) |

### Example

```lua
local result = app.integrations.contabo.list_snapshots({})

for _, snap in ipairs(result.data) do
  print(snap.name .. " - instance: " .. snap.instanceId .. " - " .. snap.createdDate)
end
```

---

## list_images

List all custom images in the Contabo account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Items per page (default: 20) |

### Example

```lua
local result = app.integrations.contabo.list_images({})

for _, image in ipairs(result.data) do
  print(image.name .. " - " .. image.osType .. " (" .. image.sizeMb .. " MB)")
end
```

---

## list_networks

List all private networks in the Contabo account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |
| `per_page` | integer | no | Items per page (default: 20) |

### Example

```lua
local result = app.integrations.contabo.list_networks({})

for _, network in ipairs(result.data) do
  print(network.name .. " - " .. network.region .. " - " .. network.cidr)
end
```

---

## list_ssh_keys

List all registered SSH keys in the Contabo account.

### Parameters

None.

### Example

```lua
local result = app.integrations.contabo.list_ssh_keys({})

for _, key in ipairs(result.data) do
  print(key.name .. " - " .. key.fingerPrint)
end
```

---

## get_current_user

Get the current authenticated Contabo account information.

### Parameters

None.

### Example

```lua
local result = app.integrations.contabo.get_current_user({})
local user = result.data
print("Account: " .. user.email .. " (tenant: " .. user.tenantId .. ")")
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.contabo.list_instances({})

-- Explicit default (portable across setups)
app.integrations.contabo.default.list_instances({})

-- Named accounts
app.integrations.contabo.production.list_instances({})
app.integrations.contabo.staging.list_instances({})
```

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

Functions

list_instances Read

List all compute instances (VPS) in the Contabo account. Returns IDs, names, status, region, and IP addresses.

Lua path
app.integrations.contabo.list_instances
Full name
contabo.contabo_list_instances
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of instances per page (default: 20).
get_instance Read

Get details for a specific Contabo compute instance (VPS) by ID. Returns full instance information including IP addresses, region, and configuration.

Lua path
app.integrations.contabo.get_instance
Full name
contabo.contabo_get_instance
ParameterTypeRequiredDescription
id integer yes The instance ID.
list_snapshots Read

List all snapshots in the Contabo account. Returns snapshot IDs, names, instance IDs, and creation dates.

Lua path
app.integrations.contabo.list_snapshots
Full name
contabo.contabo_list_snapshots
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of snapshots per page (default: 20).
list_images Read

List all custom images in the Contabo account. Returns image IDs, names, OS type, and size.

Lua path
app.integrations.contabo.list_images
Full name
contabo.contabo_list_images
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of images per page (default: 20).
list_networks Read

List all private networks in the Contabo account. Returns network IDs, names, regions, and CIDR ranges.

Lua path
app.integrations.contabo.list_networks
Full name
contabo.contabo_list_networks
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of networks per page (default: 20).
list_ssh_keys Read

List all registered SSH keys in the Contabo account. Returns key IDs, names, and fingerprints.

Lua path
app.integrations.contabo.list_ssh_keys
Full name
contabo.contabo_list_ssh_keys
ParameterTypeRequiredDescription
No parameters.
get_current_user Read

Get information about the current authenticated Contabo account, including email, tenant, and user ID.

Lua path
app.integrations.contabo.get_current_user
Full name
contabo.contabo_get_current_user
ParameterTypeRequiredDescription
No parameters.