data
Radar Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Radar KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.radar.*.
Use lua_read_doc("integrations.radar") 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
Radar workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.radar.list_geofences({limit = 1, cursor = "example_cursor", tag = "example_tag", group = "example_group"}))' --json kosmo integrations:lua --eval 'print(docs.read("radar"))' --json
kosmo integrations:lua --eval 'print(docs.read("radar.list_geofences"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local radar = app.integrations.radar
local result = radar.list_geofences({limit = 1, cursor = "example_cursor", tag = "example_tag", group = "example_group"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.radar, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.radar.default.* or app.integrations.radar.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Radar, use the narrower 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.
Radar — Lua API Reference
list_geofences
List geofences from Radar with optional filters for tag, group, and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of results to return (default: 100, max: 1000) |
cursor | string | no | Pagination cursor from a previous response |
tag | string | no | Filter geofences by tag |
group | string | no | Filter geofences by group identifier |
Example
local result = app.integrations.radar.list_geofences({
limit = 50,
tag = "store"
})
for _, geofence in ipairs(result.geofences) do
print(geofence._id .. ": " .. geofence.description)
end
get_geofence
Retrieve detailed information about a specific geofence by its ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
geofence_id | string | yes | The unique identifier of the geofence to retrieve |
Example
local result = app.integrations.radar.get_geofence({
geofence_id = "5e523d5a91a0bc0046c1bdee"
})
local gf = result.geofence
print("Name: " .. gf.description)
print("Tag: " .. (gf.tag or "none"))
create_geofence
Create a new geofence in Radar with a name, type, and geometry.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name of the geofence |
description | string | no | A description of the geofence |
type | string | no | The geofence type: "circle", "polygon", or "isochrone" |
coordinates | string | no | GeoJSON coordinates or a center point (e.g. "lat,lng") |
radius | integer | no | Radius in meters (for circle geofences) |
tag | string | no | A tag to categorize the geofence |
group | string | no | A group identifier for the geofence |
external_id | string | no | An optional external ID for mapping to your own records |
metadata | object | no | Optional custom metadata key-value pairs |
Example
local result = app.integrations.radar.create_geofence({
name = "Downtown Store",
description = "Flagship downtown store geofence",
type = "circle",
coordinates = "40.70390,-73.98970",
radius = 200,
tag = "store",
group = "nyc"
})
print("Created geofence: " .. result.geofence._id)
list_users
List users from Radar with optional filters for tags and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of results to return (default: 100, max: 1000) |
cursor | string | no | Pagination cursor from a previous response |
tags | string | no | Filter users by tags (comma-separated) |
Example
local result = app.integrations.radar.list_users({
limit = 25,
tags = "driver"
})
for _, user in ipairs(result.users) do
print(user._id .. ": " .. (user.description or "unnamed"))
end
get_user
Retrieve detailed information about a specific Radar user by their ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
user_id | string | yes | The unique identifier of the user to retrieve |
Example
local result = app.integrations.radar.get_user({
user_id = "5e523d5a91a0bc0046c1bdee"
})
local user = result.user
print("User: " .. user._id)
print("Location: " .. user.location.latitude .. ", " .. user.location.longitude)
list_events
List events from Radar with optional filters for type, user, and pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of results to return (default: 100, max: 1000) |
cursor | string | no | Pagination cursor from a previous response |
type | string | no | Filter by event type, e.g. "user.entered_geofence", "user.exited_geofence" |
user_id | string | no | Filter events by user ID |
geofence_id | string | no | Filter events by geofence ID |
Example
local result = app.integrations.radar.list_events({
limit = 50,
type = "user.entered_geofence"
})
for _, event in ipairs(result.events) do
print(event.type .. " at " .. event.createdAt)
print(" User: " .. event.user._id)
print(" Geofence: " .. event.geofence._id)
end
get_current_user
Get the currently authenticated Radar user’s account information.
Parameters
This tool takes no parameters.
Example
local result = app.integrations.radar.get_current_user({})
local user = result.user
print("Logged in as: " .. (user.description or user._id))
print("Email: " .. (user.email or "N/A"))
Multi-Account Usage
-- Default account
app.integrations.radar.list_geofences({...})
-- Named accounts
app.integrations.radar.logistics.list_geofences({...})
app.integrations.radar.fleet.list_events({...})Raw agent markdown
# Radar — Lua API Reference
## list_geofences
List geofences from Radar with optional filters for tag, group, and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of results to return (default: 100, max: 1000) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `tag` | string | no | Filter geofences by tag |
| `group` | string | no | Filter geofences by group identifier |
### Example
```lua
local result = app.integrations.radar.list_geofences({
limit = 50,
tag = "store"
})
for _, geofence in ipairs(result.geofences) do
print(geofence._id .. ": " .. geofence.description)
end
```
---
## get_geofence
Retrieve detailed information about a specific geofence by its ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `geofence_id` | string | yes | The unique identifier of the geofence to retrieve |
### Example
```lua
local result = app.integrations.radar.get_geofence({
geofence_id = "5e523d5a91a0bc0046c1bdee"
})
local gf = result.geofence
print("Name: " .. gf.description)
print("Tag: " .. (gf.tag or "none"))
```
---
## create_geofence
Create a new geofence in Radar with a name, type, and geometry.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | string | yes | The name of the geofence |
| `description` | string | no | A description of the geofence |
| `type` | string | no | The geofence type: `"circle"`, `"polygon"`, or `"isochrone"` |
| `coordinates` | string | no | GeoJSON coordinates or a center point (e.g. `"lat,lng"`) |
| `radius` | integer | no | Radius in meters (for circle geofences) |
| `tag` | string | no | A tag to categorize the geofence |
| `group` | string | no | A group identifier for the geofence |
| `external_id` | string | no | An optional external ID for mapping to your own records |
| `metadata` | object | no | Optional custom metadata key-value pairs |
### Example
```lua
local result = app.integrations.radar.create_geofence({
name = "Downtown Store",
description = "Flagship downtown store geofence",
type = "circle",
coordinates = "40.70390,-73.98970",
radius = 200,
tag = "store",
group = "nyc"
})
print("Created geofence: " .. result.geofence._id)
```
---
## list_users
List users from Radar with optional filters for tags and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of results to return (default: 100, max: 1000) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `tags` | string | no | Filter users by tags (comma-separated) |
### Example
```lua
local result = app.integrations.radar.list_users({
limit = 25,
tags = "driver"
})
for _, user in ipairs(result.users) do
print(user._id .. ": " .. (user.description or "unnamed"))
end
```
---
## get_user
Retrieve detailed information about a specific Radar user by their ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `user_id` | string | yes | The unique identifier of the user to retrieve |
### Example
```lua
local result = app.integrations.radar.get_user({
user_id = "5e523d5a91a0bc0046c1bdee"
})
local user = result.user
print("User: " .. user._id)
print("Location: " .. user.location.latitude .. ", " .. user.location.longitude)
```
---
## list_events
List events from Radar with optional filters for type, user, and pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of results to return (default: 100, max: 1000) |
| `cursor` | string | no | Pagination cursor from a previous response |
| `type` | string | no | Filter by event type, e.g. `"user.entered_geofence"`, `"user.exited_geofence"` |
| `user_id` | string | no | Filter events by user ID |
| `geofence_id` | string | no | Filter events by geofence ID |
### Example
```lua
local result = app.integrations.radar.list_events({
limit = 50,
type = "user.entered_geofence"
})
for _, event in ipairs(result.events) do
print(event.type .. " at " .. event.createdAt)
print(" User: " .. event.user._id)
print(" Geofence: " .. event.geofence._id)
end
```
---
## get_current_user
Get the currently authenticated Radar user's account information.
### Parameters
This tool takes no parameters.
### Example
```lua
local result = app.integrations.radar.get_current_user({})
local user = result.user
print("Logged in as: " .. (user.description or user._id))
print("Email: " .. (user.email or "N/A"))
```
---
## Multi-Account Usage
```lua
-- Default account
app.integrations.radar.list_geofences({...})
-- Named accounts
app.integrations.radar.logistics.list_geofences({...})
app.integrations.radar.fleet.list_events({...})
``` local result = app.integrations.radar.list_geofences({limit = 1, cursor = "example_cursor", tag = "example_tag", group = "example_group"})
print(result) Functions
list_geofences Read
List geofences from Radar with optional filters for tag, group, and pagination.
- Lua path
app.integrations.radar.list_geofences- Full name
radar.radar_list_geofences
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of results to return (default: 100, max: 1000) |
cursor | string | no | Pagination cursor from a previous response |
tag | string | no | Filter geofences by tag |
group | string | no | Filter geofences by group identifier |
get_geofence Read
Retrieve detailed information about a specific geofence by its ID.
- Lua path
app.integrations.radar.get_geofence- Full name
radar.radar_get_geofence
| Parameter | Type | Required | Description |
|---|---|---|---|
geofence_id | string | yes | The unique identifier of the geofence to retrieve. |
create_geofence Write
Create a new geofence in Radar with a name, type, and geometry.
- Lua path
app.integrations.radar.create_geofence- Full name
radar.radar_create_geofence
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name of the geofence. |
description | string | no | A description of the geofence. |
type | string | no | The geofence type, e.g. "circle", "polygon", or "isochrone". |
coordinates | string | no | GeoJSON coordinates or a center point (e.g. "lat,lng"). |
radius | integer | no | Radius in meters (for circle geofences). |
tag | string | no | A tag to categorize the geofence. |
group | string | no | A group identifier for the geofence. |
external_id | string | no | An optional external ID for mapping to your own records. |
metadata | object | no | Optional custom metadata key-value pairs. |
list_users Read
List users from Radar with optional filters for tags and pagination.
- Lua path
app.integrations.radar.list_users- Full name
radar.radar_list_users
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of results to return (default: 100, max: 1000) |
cursor | string | no | Pagination cursor from a previous response |
tags | string | no | Filter users by tags (comma-separated) |
get_user Read
Retrieve detailed information about a specific Radar user by their ID.
- Lua path
app.integrations.radar.get_user- Full name
radar.radar_get_user
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | yes | The unique identifier of the user to retrieve. |
list_events Read
List events from Radar with optional filters for type, user, and pagination.
- Lua path
app.integrations.radar.list_events- Full name
radar.radar_list_events
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of results to return (default: 100, max: 1000) |
cursor | string | no | Pagination cursor from a previous response |
type | string | no | Filter by event type, e.g. "user.entered_geofence", "user.exited_geofence" |
user_id | string | no | Filter events by user ID |
geofence_id | string | no | Filter events by geofence ID |
current_user Read
Get the currently authenticated Radar user's account information.
- Lua path
app.integrations.radar.current_user- Full name
radar.radar_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||