Skip to main content
Glama

Count trips per filter value

get_facets
Read-onlyIdempotent

Get facet counts for filterable fields, respecting current filters.

CRITICAL: You MUST include ALL established filters in every call — especially niche, market, adults, children, and arrivalWeeks/arrivalMonths. The facetFields parameter only controls which breakdowns are returned, NOT which filters are applied. If you omit a filter like arrivalWeeks, the counts will include ALL dates — giving misleading numbers that won't match actual availability for the user's requested dates.

Example — WRONG: User wants ski in France next week for 2 people. You call get_facets with niche="ski", market="dk", countries=["france"], facetFields=["destinationSlug"]. This returns counts across ALL dates — showing destinations that may have 0 results for next week.

Example — RIGHT: Same scenario. You call get_facets with niche="ski", market="dk", countries=["france"], arrivalWeeks=["2026-W15"], adults=2, children=0, facetFields=["destinationSlug"]. This returns only destinations with actual availability for next week with 2 adults.

Returns: { totalCount, facets: { fieldName: { value: count, ... }, ... }, hierarchical } hierarchical lists field pairs (e.g. country ↔ destination) whose bucket counts are not expected to sum to totalCount.

Common use cases:

  • Check destination availability: facetFields=["countrySlug", "destinationSlug"] — include arrivalWeeks + adults + children

  • Check date availability: facetFields=["arrivalYearWeek", "arrivalYearMonth"] — include destination/country + adults + children

  • Explore filter options: facetFields=["durationDays", "provider"] — include ALL current filters

  • Answer "where else can I go?": facetFields=["countrySlug", "destinationSlug"] — include ALL current filters (dates, travelers)

Facetable fields — common (every niche): countrySlug, destinationSlug, provider, centrumDistanceRange, priceRange, pricePerPersonRange, durationDays, arrivalYearWeek, arrivalYearMonth, arrivalDate, stars, guestRatingBucket, transport, accommodationType, mealPlanType, accommodationFeatures. Niche-scoped (only meaningful on that niche): ski — skiPassIncluded, skiLiftDistanceRange, skiBusDistanceRange, skiSlopeDistanceRange, guideIncluded, transferIncluded; golf — greenFeeIncluded, courseDistanceRange, golfRoundsRange, golfTripType, golfBagIncluded, guideIncluded, transferIncluded; surf — surfSchoolIncluded, beachDistanceRange, waveType; diving — diveCenter; hiking — difficultyLevel, dailyDistanceRange, trailheadDistanceRange, tripFormat, routeDistanceRange, elevationGainRange, luggageTransportIncluded, guideIncluded, gpxAvailable; charter — beachDistanceRange, guideIncluded, transferIncluded; cycling — difficultyLevel, cyclingType, tripFormat, routeDistanceRange, elevationGainRange, eBikeAvailable, luggageTransportIncluded, guideIncluded, bikeRentalAvailable, gpxAvailable; football — league, homeTeam, awayTeam, team, matchDate, hotelIncluded; carrental — carSupplier, carClass, carBodyType, transmission, fuelType, seats, zeroExcess, pickupStation, pickupStationType; f1 — guideIncluded, hotelIncluded, race, season, raceDate, ticketType, raceDays, transferIncluded; running — guideIncluded, hotelIncluded, race, season, raceDate, transferIncluded, distances, terrain, raceSeries, entryIncluded; americanfootball — guideIncluded, league, homeTeam, awayTeam, team, matchDate, hotelIncluded, season, transferIncluded, gameType; yoga — transferIncluded, retreatFocus, yogaLevel, yogaStyles, meditationIncluded, vegetarianMeals, danishInstructor; triathlon — guideIncluded, hotelIncluded, race, season, raceDate, transferIncluded, entryIncluded, tripType, triathlonDistance, raceBrand, bikeTransportIncluded; cruise — guideIncluded, cruiseType, cruiseLine, cabinType, cruiseRegion, embarkationCountry, flightIncluded, drinksIncluded, excursionsIncluded; coach — guideIncluded, excursionsIncluded, coachTripType, pickupRegion; holidayhome — beachDistanceRange, maxPersons, bedrooms, houseSizeRange, petsAllowed, consumptionIncluded, freeCancellation; roundtrip — excursionsIncluded, tourFormat, danishGuide, guaranteedDeparture; citybreak — transferIncluded, excursionsIncluded, escorted; dance — transferIncluded, danceStyles, danceLevel, soloWelcome.

Always pass facetFields to limit which facets are returned (improves performance). Filtered facets exclude their own filter to keep all options visible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
utmNo
nicheYes
racesNo
teamsNo
adultsNo
marketYes
oneWayNo
leaguesNo
pageUrlNo
seasonsNo
adClicksNo
childrenNo
escortedNo
maxPriceNo
minPriceNo
minSeatsNo
minStarsNo
raceDaysNo
terrainsNo
widgetIdNo
countriesNo
distancesNo
durationsNo
fuelTypesNo
gameTypesNo
providersNo
tripTypesNo
waveTypesNo
cabinTypesNo
carClassesNo
diveCenterNo
pickupTimeNo
raceBrandsNo
raceDateToNo
raceSeriesNo
transportsNo
yogaLevelsNo
yogaStylesNo
zeroExcessNo
boundingBoxNo
cruiseLinesNo
cruiseTypesNo
danceLevelsNo
danceStylesNo
danishGuideNo
departureToNo
dropoffTimeNo
facetFieldsNo
matchDateToNo
minBedroomsNo
petsAllowedNo
soloWelcomeNo
ticketTypesNo
tourFormatsNo
tripFormatsNo
arrivalDatesNo
arrivalWeeksNo
carBodyTypesNo
carSuppliersNo
cyclingTypesNo
destinationsNo
gpxAvailableNo
previewTokenNo
raceDateFromNo
arrivalMonthsNo
beachDistanceNo
consentReplayNo
cruiseRegionsNo
dailyDistanceNo
departureFromNo
elevationGainNo
entryIncludedNo
golfTripTypesNo
guideIncludedNo
hotelIncludedNo
matchDateFromNo
mealPlanTypesNo
pickupRegionsNo
routeDistanceNo
transmissionsNo
coachTripTypesNo
courseDistanceNo
drinksIncludedNo
eBikeAvailableNo
flightIncludedNo
maxGuestRatingNo
minGuestRatingNo
onlyDiscountedNo
pickupStationsNo
skiBusDistanceNo
centrumDistanceNo
dropoffStationsNo
golfBagIncludedNo
houseSizeRangesNo
skiLiftDistanceNo
skiPassIncludedNo
vegetarianMealsNo
danishInstructorNo
difficultyLevelsNo
freeCancellationNo
golfRoundsRangesNo
greenFeeIncludedNo
marketingConsentNo
skiPassDaysCountNo
skiSlopeDistanceNo
transferIncludedNo
hikingTripFormatsNo
maxPricePerPersonNo
minPricePerPersonNo
trailheadDistanceNo
accommodationTypesNo
excursionsIncludedNo
identityPersistentNo
meditationIncludedNo
pickupStationTypesNo
surfSchoolIncludedNo
triathlonDistancesNo
yogaRetreatFocusesNo
bikeRentalAvailableNo
consumptionIncludedNo
guaranteedDepartureNo
embarkationCountriesNo
onlyMultiDestinationNo
accommodationFeaturesNo
bikeTransportIncludedNo
departureDateFlexDaysNo
cyclingDifficultyLevelsNo
luggageTransportIncludedNo
includeUnratedGuestRatingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the description clears the lower bar and then adds substantial context: the filter-propagation trap, that facetFields controls only output breakdowns, that filtered facets exclude their own filter, and that hierarchical bucket counts may not sum to totalCount. This is exactly the non-obvious behavior an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the critical filter-inclusion warning before any enumeration, and the WRONG/RIGHT example is high-value. The long facetable-field lists are load-bearing given 0% schema coverage, but they make the description dense; slight trimming of niche field lists would help.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 129-parameter tool with no output schema, the description supplies the return shape (totalCount, facets, hierarchical), the facetFields contract, and the filter-propagation rule. Nothing an agent must know to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 129 params, so the description carries the full burden. It documents facetFields semantics thoroughly and enumerates the facetable fields by niche, but the vast majority of filter parameters (the other ~120) are only touched by example, not defined. It compensates well for the critical params but not exhaustively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Get facet counts for filterable fields') and adds the key behavioral qualifier 'respecting current filters'. An agent can immediately tell this is an aggregation/faceting tool distinct from find_trips or search_listings, which return results rather than counts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use it via four concrete use cases (destination availability, date availability, filter exploration, 'where else can I go?'), and the CRITICAL block warns when NOT to omit filters with a wrong/right worked example. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources