# `ma_get_bedrooms_distribution`

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

Get Bedrooms Distribution. Product: [Area Insights](/docs/area-insights). Annotations: Read-only.

Call it as `ma_get_bedrooms_distribution` on `https://mcp.casafari.com/` (the backend's own name is `get_bedrooms_distribution`).

Over REST: [`POST /market-analytics-api/distributions/bedrooms`](/docs/rest/area-insights/bedrooms-distribution) (equivalent). [MCP and REST compared](/docs/parity#area-insights).

## Description

Returns a **distribution of properties grouped by the number of bedrooms**.
Each record includes total listings count, average price, and average price per square meter.

#### Business Context
Useful for analyzing pricing differences and market concentration
based on bedroom count — ideal for residential market segmentation.

#### Parameters
| Name | Type | Required | Description |
|------|------|-----------|--------------|
| `request_data` | `MCPBedroomsDistributionRequestSchema` | Yes | Filter configuration for bedroom-based distribution. |

##### Filter highlights
- `type_group`: property type group (e.g., apartment, house)
- `business_type`: `"sale"` or `"rent"`
- `custom_location_boundary`: geographical boundary filter
- `bedrooms_range`: range of bedroom counts
- `exclude_outliers`: optional flag to remove statistical outliers

#### Returns
```json
[
  {
    "bedrooms": "2",
    "properties_count": 324,
    "average_price": 245000.0,
    "average_price_per_sqm": 5200.0
  }
]
```

| Field | Type | Description |
|--------|------|-------------|
| `bedrooms` | `str` | Bedroom count label |
| `properties_count` | `int` | Number of properties |
| `average_price` | `float` | Average property price |
| `average_price_per_sqm` | `float` | Average price per square meter |

#### Example Request
```json
{
  "custom_location_boundary": {
    "circle": {
      "target_point": {"latitude": 48.8566, "longitude": 2.3522},
      "distance": 10000
    }
  },
  "type_group": "apartment",
  "business_type": "sale",
  "bedrooms_range": {"min": 1, "max": 4},
  "exclude_outliers": true
}
```

## Parameters

- `request_data` (object, required)
  - `type_group` (string, required): Estate type group. Values: `apartment`, `house`.
  - `business_type` (string, required): Operation type for which the property is available. Values: `sale`, `rent`.
  - `price_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–2147483647.
    - `max` (integer, optional, nullable) 1–2147483647.
  - `price_per_sqm_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–2147483647.
    - `max` (integer, optional, nullable) 1–2147483647.
  - `rooms_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–15000.
    - `max` (integer, optional, nullable) 1–15000.
  - `bedrooms_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 0–10.
    - `max` (integer, optional, nullable) 0–10.
  - `bathrooms_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–15000.
    - `max` (integer, optional, nullable) 1–15000.
  - `total_area_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–1000000.
    - `max` (integer, optional, nullable) 1–1000000.
  - `plot_area_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–1000000.
    - `max` (integer, optional, nullable) 1–1000000.
  - `construction_year_range` (object, optional, nullable)
    - `min` (integer, optional, nullable) 1–3000.
    - `max` (integer, optional, nullable) 1–3000.
  - `characteristics` (object, optional, nullable)
    - `must_have` (string[], optional): Include only properties that have all these characteristics. Values: `balcony`, `elevator`, `no_elevator`, `garage`, `garden`, `parking`, `storage`, `swimming_pool`, `terrace`, `rental_license`, `furniture`, `rented_out`, `life_annuity`.
    - `exclude` (string[], optional): Exclude properties that contain any of these characteristics. Values: `balcony`, `elevator`, `no_elevator`, `garage`, `garden`, `parking`, `storage`, `swimming_pool`, `terrace`, `rental_license`, `furniture`, `rented_out`, `life_annuity`.
  - `conditions` (string[], optional): Property conditions, as returned by the GET /api/v1/references/conditions endpoint. Values: `used`, `ruin`, `very-good`, `new`, `other`. at least 1 item.
  - `private` (boolean, optional): Whether the property is listed by a private individual, as opposed to an agent or a professional.
  - `bank` (boolean, optional): Whether the property is owned by the bank.
  - `auction` (boolean, optional): Whether the property is the subject of an auction. default false.
  - `exclude_outliers` (boolean, optional): Exclude properties that are significantly underpriced or overpriced compared to similar properties. default true.
  - `custom_location_boundary` (object, required)
    - `location_ids` (integer[], optional): List of location IDs. 1–10 items; 1–2147483647.
    - `circle` (object, optional): Circle boundary to search within.
      - `distance` (integer, required): Maximum distance in meters from the requested `target_point` to the properties. 50–50000.
      - `target_point` (object, required): Target point coordinates to search around.
        - `latitude` (number, required) -90–90.
        - `longitude` (number, required) -180–180.

## Response

The result is returned as `result`:

- `bedrooms` (string, required): The number of bedrooms in the properties that participated in the distribution.
- `properties_count` (integer, required): The number of properties that participated in the distribution.
- `average_price` (number, required): Average price of properties with a specific number of bedrooms.
- `average_price_per_sqm` (number, required): Average price per square meter of properties with a specific number of bedrooms.

## Example call

Required arguments only, with placeholder values; see the parameters above for real ones.

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ma_get_bedrooms_distribution",
    "arguments": {
      "request_data": {
        "type_group": "apartment",
        "business_type": "sale",
        "custom_location_boundary": {
          "location_ids": [
            1
          ]
        }
      }
    }
  }
}
```

## Questions about this

- [What is Area Insights?](/docs/faq/what-is-area-insights)
- [How do I see how properties are distributed by price, bedrooms or time on market, or get a heatmap?](/docs/faq/example-distributions-heatmap)
