get_price_stats
Get price statistics for a slice of the Portugal used-car market: how many listings match, the median price, the p25–p75 range, the median price per kilometre and a breakdown by body type. Use this when the user asks what something costs, whether an asking price is fair, or how two makes compare — instead of listing individual cars. Takes the same filters as search_cars and describes exactly the set that tool would return, so the two never disagree. Reports medians and quartiles rather than averages, because car prices have a long right tail and a single luxury listing moves an average.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fuel | No | Fuel type. GASOLINE = gasolina, ELECTRIC = eléctrico, HYBRID = full hybrid, PLUG_IN_HYBRID = PHEV. | |
| make | No | Make slug (e.g. toyota, bmw, volkswagen). Not free text — the slug is the same in every market. | |
| kmMax | No | Maximum kilometres on the odometer. | |
| model | No | Model slug (e.g. corolla, serie-3, golf). Requires `make` to disambiguate. | |
| yearMax | No | Maximum registration year. | |
| yearMin | No | Minimum registration year. | |
| bodyType | No | Body style. SEDAN = berlina, HATCHBACK = citadino, COMBI = carrinha, CABRIO = descapotável, MINIVAN = monovolume. | |
| district | No | District or region inside the market (e.g. Lisboa, Porto, Berlin, Madrid). Matched exactly. | |
| priceMax | No | Maximum price in the market currency. Listings with no published price are excluded by either bound. | |
| priceMin | No | Minimum price in the market currency. | |
| condition | No | Vehicle condition. new = 0 km / registered this year; semi_new = <2 years and <20 000 km; used = everything else. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Listings matching the filters, with or without a published price. | |
| price | No | Price distribution, in percentiles. null when no matching listing publishes a price. There is deliberately no min or max: listings come from third-party sources and the extremes are set by data errors, not by the market. | |
| market | Yes | ||
| priced | Yes | Subset with a published price — the base of every figure below. A large gap to `count` means many listings in this slice are 'price on request'. | |
| currency | Yes | ||
| byBodyType | Yes | Up to 6 most represented body types, each with its own median. | |
| pricePerKmMedian | No | Median price per kilometre on the odometer, in the listing currency (order of magnitude 0.05–3). Small = the car has done a lot for its price. |