list_cities
Find cities with available bookable experiences on tickadoo to help users discover destinations for theatre, shows, events, and tours.
Instructions
List all cities where tickadoo® has bookable experiences. Use to help users discover available destinations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | Language code | en |
| query | No | Optional city name or slug filter (e.g. 'new', 'paris', 'tokyo') | |
| limit | No | Maximum number of cities to return (default 50) |
Implementation Reference
- src/shared/server.ts:176-198 (handler)The handler for the 'list_cities' tool, which filters and formats a list of cities.
async ({ language, query, limit }) => { try { const filter = query?.trim().toLowerCase(); const withSlug = (await getCities(language)) .filter((city): city is City & { slug: string } => Boolean(city.slug)) .filter(city => !filter || city.name.toLowerCase().includes(filter) || city.slug.toLowerCase().includes(filter)) .sort((a, b) => a.name.localeCompare(b.name)); if (!withSlug.length) { return createTextResponse(`No cities found matching "${query}".`); } const cities = withSlug.slice(0, limit); const list = cities.map(city => `📍 ${city.name} → ${buildBookingUrl(city.slug)}`).join("\n"); const header = filter ? `Found ${withSlug.length} matching cities${withSlug.length > cities.length ? ` (showing ${cities.length})` : ""}:` : `Showing ${cities.length} of ${withSlug.length} cities, sorted alphabetically. Use the optional query parameter to filter further:`; return createTextResponse(`tickadoo® city directory\n\n${header}\n\n${list}`); } catch (error) { return createTextResponse(`Error: ${getErrorMessage(error)}`, { isError: true }); } }, - src/shared/server.ts:167-174 (registration)Registration of the 'list_cities' tool with its schema definition in src/shared/server.ts.
server.tool( "list_cities", "List all cities where tickadoo® has bookable experiences. Use to help users discover available destinations.", { language: z.string().optional().default("en").describe("Language code"), query: z.string().optional().describe("Optional city name or slug filter (e.g. 'new', 'paris', 'tokyo')"), limit: z.number().int().positive().max(200).optional().default(50).describe("Maximum number of cities to return (default 50)"), },