30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

GeoDirectory List Locations

geodirectory/list-locations lists the countries, regions, cities or neighbourhoods configured on this site.

Requires the Location Manager add-on. Without it the locations table does not exist and the ability says so rather than returning an empty list that reads as “no locations configured”.

At a glance

Abilitygeodirectory/list-locations
ToolsetGeoDirectory — toolset/geodirectory
GroupGeoDirectory › Locations
RequiresAcrossAI Pro, plus GeoDirectory active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

How it works

Countries, regions and cities are not three tables. Each row is a city, carrying its region and its country as fields on the same record — so the country and region views are projections over the same data rather than separate lists.

That has a practical consequence: there is no such thing as creating a country. A country exists because a city names it, and it stops existing when the last city naming it is removed.

It also means a typo in a country name creates a new country. Two cities spelling the same country differently produce two countries in the archive, with the listings split between them.

Neighbourhoods are a genuine sub-level and only exist when neighbourhoods are enabled.

The slug filter fetches one location rather than listing, which is the cheap way to check whether a location already exists before creating it.

Input

NameTypeRequiredWhat it is
typestringNoWhich level to list. neighbourhoods needs neighbourhoods enabled.
slugstringNoFetch one location by slug instead of listing.
countrystringNoFilter to this country.
regionstringNoFilter to this region.
citystringNoFilter to this city.
searchstringNoFree-text search on the location name.
orderbystringNoSort key. Defaults to city.
orderstringNoSort direction.
per_pageintegerNoRows per page.
pageintegerNoPage number.

What comes back

NameTypeWhat it is
locationsarrayEach location row with its city, region, country and coordinates.
totalintegerHow many matched.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Which cities does our directory cover?

It resolves to one call:

{
  "ability": "geodirectory/list-locations",
  "parameters": {
    "type": "cities"
  }
}

Worth knowing

  • Every row is a city. Countries and regions are projections over them.
  • A typo in a country name creates a second country.
  • Neighbourhoods need to be enabled separately.
  • Requires the Location Manager add-on.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading