KosmoKrator

data

Google Maps Lua API for KosmoKrator Agents

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

Lua Namespace

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

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.google_maps.geocode_address({address = "example_address", components = "example_components", region = "example_region", language = "example_language"}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("google-maps"))' --json
kosmo integrations:lua --eval 'print(docs.read("google-maps.geocode_address"))' --json

Workflow file

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

workflow.lua
local google_maps = app.integrations.google_maps
local result = google_maps.geocode_address({address = "example_address", components = "example_components", region = "example_region", language = "example_language"})

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.google_maps, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.google_maps.default.* or app.integrations.google_maps.work.* when you configured named credential accounts.

MCP-only Lua

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

Google Maps — Lua API Reference

Use app.integrations.google_maps to geocode addresses, search places, inspect place details, get directions, and calculate distance matrices.

google_maps_geocode_address

Convert an address into geographic coordinates.

local result = app.integrations.google_maps.google_maps_geocode_address({
  address = "1600 Amphitheatre Parkway, Mountain View, CA",
  region = "us",
  language = "en"
})

google_maps_reverse_geocode

Convert latitude and longitude into address results.

local result = app.integrations.google_maps.google_maps_reverse_geocode({
  latitude = 37.422,
  longitude = -122.084
})

google_maps_search_places

Search places with optional location, radius, type, price, and open-now filters.

local result = app.integrations.google_maps.google_maps_search_places({
  query = "coffee near Brussels",
  type = "cafe",
  open_now = true
})

google_maps_get_place_details

Fetch details for a Google Place ID. Use fields to keep responses focused.

local result = app.integrations.google_maps.google_maps_get_place_details({
  place_id = "ChIJN1t_tDeuEmsRUsoyG83frY4",
  fields = { "name", "formatted_address", "geometry", "rating" }
})

google_maps_get_directions

Get directions between two locations.

local result = app.integrations.google_maps.google_maps_get_directions({
  origin = "Brussels Central Station",
  destination = "Atomium, Brussels",
  mode = "transit"
})

google_maps_get_distance_matrix

Calculate distances and durations for origin-destination pairs.

local result = app.integrations.google_maps.google_maps_get_distance_matrix({
  origins = { "Brussels", "Antwerp" },
  destinations = { "Ghent", "Leuven" },
  units = "metric"
})

google_maps_get_current_user

Verify credentials and estimate the current requester location through the Geolocation API.

local result = app.integrations.google_maps.google_maps_get_current_user({})
Raw agent markdown
# Google Maps — Lua API Reference

Use `app.integrations.google_maps` to geocode addresses, search places, inspect place details, get directions, and calculate distance matrices.

## google_maps_geocode_address

Convert an address into geographic coordinates.

```lua
local result = app.integrations.google_maps.google_maps_geocode_address({
  address = "1600 Amphitheatre Parkway, Mountain View, CA",
  region = "us",
  language = "en"
})
```

## google_maps_reverse_geocode

Convert latitude and longitude into address results.

```lua
local result = app.integrations.google_maps.google_maps_reverse_geocode({
  latitude = 37.422,
  longitude = -122.084
})
```

## google_maps_search_places

Search places with optional location, radius, type, price, and open-now filters.

```lua
local result = app.integrations.google_maps.google_maps_search_places({
  query = "coffee near Brussels",
  type = "cafe",
  open_now = true
})
```

## google_maps_get_place_details

Fetch details for a Google Place ID. Use `fields` to keep responses focused.

```lua
local result = app.integrations.google_maps.google_maps_get_place_details({
  place_id = "ChIJN1t_tDeuEmsRUsoyG83frY4",
  fields = { "name", "formatted_address", "geometry", "rating" }
})
```

## google_maps_get_directions

Get directions between two locations.

```lua
local result = app.integrations.google_maps.google_maps_get_directions({
  origin = "Brussels Central Station",
  destination = "Atomium, Brussels",
  mode = "transit"
})
```

## google_maps_get_distance_matrix

Calculate distances and durations for origin-destination pairs.

```lua
local result = app.integrations.google_maps.google_maps_get_distance_matrix({
  origins = { "Brussels", "Antwerp" },
  destinations = { "Ghent", "Leuven" },
  units = "metric"
})
```

## google_maps_get_current_user

Verify credentials and estimate the current requester location through the Geolocation API.

```lua
local result = app.integrations.google_maps.google_maps_get_current_user({})
```
Metadata-derived Lua example
local result = app.integrations.google_maps.geocode_address({address = "example_address", components = "example_components", region = "example_region", language = "example_language"})
print(result)

Functions

geocode_address Read

Convert a street address into geographic coordinates and place details using Google Maps geocoding.

Lua path
app.integrations.google_maps.geocode_address
Full name
google-maps.google_maps_geocode_address
ParameterTypeRequiredDescription
address string yes Street address to geocode.
components object no Optional component filters such as {"country": "US"}.
region string no Optional region bias such as "us".
language string no Optional language code such as "en".
reverse_geocode Read

Convert latitude and longitude coordinates into street addresses using Google Maps reverse geocoding.

Lua path
app.integrations.google_maps.reverse_geocode
Full name
google-maps.google_maps_reverse_geocode
ParameterTypeRequiredDescription
latitude number yes Latitude coordinate.
longitude number yes Longitude coordinate.
components object no Optional component filters.
language string no Optional language code.
result_type string no Optional result type filter such as "street_address".
location_type string no Optional location type filter such as "ROOFTOP".
search_places Read

Search for places with a text query using Google Maps Places search.

Lua path
app.integrations.google_maps.search_places
Full name
google-maps.google_maps_search_places
ParameterTypeRequiredDescription
query string yes Text search query such as "restaurants in Sydney".
location string no Optional location bias as "lat,lng".
radius number no Optional radius in meters.
language string no Optional language code.
type string no Optional place type such as "restaurant".
open_now boolean no Whether to return only places open now.
min_price integer no Optional minimum price level from 0 to 4.
max_price integer no Optional maximum price level from 0 to 4.
get_place_details Read

Get detailed information about a specific Google Maps place by Place ID.

Lua path
app.integrations.google_maps.get_place_details
Full name
google-maps.google_maps_get_place_details
ParameterTypeRequiredDescription
place_id string yes Google Place ID.
fields array no Optional list of fields to include.
language string no Optional language code.
region string no Optional region code.
reviews_no_translations string no Set to "true" to disable review translations.
reviews_sort string no Review sort order such as "most_relevant" or "newest".
get_directions Read

Get directions between an origin and destination using Google Maps Directions API.

Lua path
app.integrations.google_maps.get_directions
Full name
google-maps.google_maps_get_directions
ParameterTypeRequiredDescription
origin string yes Starting point as address, Place ID, or "lat,lng".
destination string yes Destination as address, Place ID, or "lat,lng".
mode string no Travel mode: driving, walking, bicycling, or transit.
waypoints string no Optional pipe-separated waypoints.
alternatives boolean no Whether to return alternative routes.
avoid array no Avoid options such as tolls, highways, ferries.
language string no Optional language code.
units string no Unit system: metric or imperial.
departure_time string no Departure time as "now" or Unix timestamp.
arrival_time string no Arrival time as Unix timestamp for transit.
transit_mode string no Transit modes such as bus, subway, train, tram, or rail.
transit_routing_preference string no Transit preference: less_walking or fewer_transfers.
get_distance_matrix Read

Calculate travel distances and durations between multiple origins and destinations.

Lua path
app.integrations.google_maps.get_distance_matrix
Full name
google-maps.google_maps_get_distance_matrix
ParameterTypeRequiredDescription
origins array yes Origin addresses or "lat,lng" strings.
destinations array yes Destination addresses or "lat,lng" strings.
mode string no Travel mode: driving, walking, bicycling, or transit.
language string no Optional language code.
units string no Unit system: metric or imperial.
departure_time string no Departure time as "now" or Unix timestamp.
arrival_time string no Arrival time as Unix timestamp for transit.
avoid array no Avoid options such as tolls, highways, ferries.
transit_mode string no Transit modes as a pipe-separated string.
transit_routing_preference string no Transit preference: less_walking or fewer_transfers.
get_current_user Read

Get geolocation data for the current requester and verify Google Maps API credentials.

Lua path
app.integrations.google_maps.get_current_user
Full name
google-maps.google_maps_get_current_user
ParameterTypeRequiredDescription
No parameters.