Using the tools
Short recipes with the exact tool calls. Each call is the params of a tools/call request.
Search, show details, send the user to book
- Search with the user’s dates and guests.
- Show the stays. When the user picks one, fetch its details.
- Give the user the
customerUrlfrom the search result. It opens that stay on Nsuna with the same dates and guests, and that is where they book.
{
"name": "search_stays",
"arguments": {
"destination": "Cape Town",
"dateFrom": "2027-03-10",
"dateTo": "2027-03-12",
"occupancy": {
"adultCount": 2,
"rooms": 1
},
"limit": 2
}
}
{
"name": "get_stay",
"arguments": {
"placeId": "a29e43e1-466c-4ffa-a73c-cda75cd5a0f0"
}
}
The customerUrl from get_stay has no dates, so keep the one from the search:
https://app.nsuna.com/stays/a29e43e1-466c-4ffa-a73c-cda75cd5a0f0?dateFrom=2027%2F03%2F10&dateTo=2027%2F03%2F12&adultCount=2&rooms=1
The server cannot book. Do not tell the user a stay is reserved.
Handle an ambiguous destination
When the text matches several places, the result has status: "choose_destination" and no stays.
{
"name": "search_stays",
"arguments": {
"destination": "Spring"
}
}
{
"status": "choose_destination",
"destination": null,
"suggestions": [
{
"id": "10121",
"name": "Spring",
"type": "CITY",
"address": [
"Montgomery County",
"United States of America"
]
},
{
"id": "3000748021",
"name": "Spring",
"type": "CITY",
"address": [
"Wiesenburg/Mark",
"Brandenburg Region",
"Germany"
]
},
{
"id": "3088",
"name": "Springbok",
"type": "CITY",
"address": [
"Nama Khoi",
"Northern Cape",
"South Africa"
]
}
],
"stays": [],
"hasMore": false
}
Ask the user which place they mean, or pick the one that fits the conversation. Then search again with its id and type:
{
"name": "search_stays",
"arguments": {
"destinationId": "3088",
"destinationType": "CITY",
"dateFrom": "2027-03-10",
"dateTo": "2027-03-12"
}
}
A search by ID skips the lookup, so destination.name in that result is null. Keep the name from the suggestion.
Family or group searches
Put guests in occupancy. List one age per child in childAges (0–17). rooms defaults to 1 and cannot exceed adultCount.
{
"name": "search_stays",
"arguments": {
"destination": "Cape Town",
"dateFrom": "2027-03-10",
"dateTo": "2027-03-12",
"occupancy": {
"adultCount": 2,
"rooms": 1,
"childAges": [
4,
9
]
}
}
}
The booking link carries the same party:
https://app.nsuna.com/stays/a29e43e1-466c-4ffa-a73c-cda75cd5a0f0?dateFrom=2027%2F03%2F10&dateTo=2027%2F03%2F12&adultCount=2&rooms=1&childAge=4&childAge=9
Without occupancy, a dated search assumes 2 adults in 1 room.
Undated browsing or dated pricing
| Without dates | With dates | |
|---|---|---|
| Call | destination only | destination, dateFrom, dateTo, optional occupancy |
availability | Always unknown | available, unavailable or unknown |
price | Never | On available stays, when provided |
customerUrl | Plain property page | Property page with dates and guests |
Browse without dates when the user is exploring. Ask for dates before you talk about price or availability, and treat the price as a starting total to confirm on Nsuna.