KosmoKrator

other

Radar Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write Bearer token auth

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.

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

NameTypeRequiredDescription
limitintegernoNumber of results to return (default: 100, max: 1000)
cursorstringnoPagination cursor from a previous response
tagstringnoFilter geofences by tag
groupstringnoFilter 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

NameTypeRequiredDescription
geofence_idstringyesThe 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

NameTypeRequiredDescription
namestringyesThe name of the geofence
descriptionstringnoA description of the geofence
typestringnoThe geofence type: "circle", "polygon", or "isochrone"
coordinatesstringnoGeoJSON coordinates or a center point (e.g. "lat,lng")
radiusintegernoRadius in meters (for circle geofences)
tagstringnoA tag to categorize the geofence
groupstringnoA group identifier for the geofence
external_idstringnoAn optional external ID for mapping to your own records
metadataobjectnoOptional 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

NameTypeRequiredDescription
limitintegernoNumber of results to return (default: 100, max: 1000)
cursorstringnoPagination cursor from a previous response
tagsstringnoFilter 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

NameTypeRequiredDescription
user_idstringyesThe 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

NameTypeRequiredDescription
limitintegernoNumber of results to return (default: 100, max: 1000)
cursorstringnoPagination cursor from a previous response
typestringnoFilter by event type, e.g. "user.entered_geofence", "user.exited_geofence"
user_idstringnoFilter events by user ID
geofence_idstringnoFilter 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({...})
```

Metadata-Derived Lua Example

local result = app.integrations.radar.radar_list_geofences({
  limit = 1,
  cursor = "example_cursor",
  tag = "example_tag",
  group = "example_group"
})
print(result)

Functions

radar_list_geofences

List geofences from Radar with optional filters for tag, group, and pagination.

Operation
Read read
Full name
radar.radar_list_geofences
ParameterTypeRequiredDescription
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

radar_get_geofence

Retrieve detailed information about a specific geofence by its ID.

Operation
Read read
Full name
radar.radar_get_geofence
ParameterTypeRequiredDescription
geofence_id string yes The unique identifier of the geofence to retrieve.

radar_create_geofence

Create a new geofence in Radar with a name, type, and geometry.

Operation
Write write
Full name
radar.radar_create_geofence
ParameterTypeRequiredDescription
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.

radar_list_users

List users from Radar with optional filters for tags and pagination.

Operation
Read read
Full name
radar.radar_list_users
ParameterTypeRequiredDescription
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)

radar_get_user

Retrieve detailed information about a specific Radar user by their ID.

Operation
Read read
Full name
radar.radar_get_user
ParameterTypeRequiredDescription
user_id string yes The unique identifier of the user to retrieve.

radar_list_events

List events from Radar with optional filters for type, user, and pagination.

Operation
Read read
Full name
radar.radar_list_events
ParameterTypeRequiredDescription
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

radar_get_current_user

Get the currently authenticated Radar user's account information.

Operation
Read read
Full name
radar.radar_get_current_user
ParameterTypeRequiredDescription
No parameters.