# get_metric

Get metric data from DNA.

<!-- INPUT_BLOCK_START -->

## Input

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `metric` | `Metric` | Yes | The metric to query (occupancy or adr) - [Metric](#metric) |
| `mode` | `Mode` | Yes | The result type: timeSeries, bigNumber, categoryBreakdown, ranking, distribution, or correlation. - [Mode](#mode) |
| `timeRange` | `unknown` | Yes | Time range configuration |
| `groupBy` | `GroupBy[]` | No | Dimensions to group by. One or more of "BUILDING", "UNIT_TYPE", "UNIT", "CITY", "WORKSPACE" (e.g., ["BUILDING", "UNIT_TYPE"]) - [GroupBy](#groupby) |
| `filters` | `unknown` | No | Filters to apply. Supported entities: workspace, unitType, building, unit. Supported operators: eq (equals), neq/ne (not equals), in (in list), nin (not in list). Example: { building: { id: { eq: "1366" } }, unitType: { id: { in: ["1234", "5678"] } } } |

### Metric

| Value | Description |
| --- | --- |
| `occupancy` | % of unit-nights sold vs available. |
| `adr` | Average Daily Rate — mean nightly revenue per sold unit-night. |

### Mode

| Value | Description |
| --- | --- |
| `timeSeries` | Points bucketed over time by the requested granularity. |
| `bigNumber` | Single scalar plus previousValue and delta for period-over-period. |
| `categoryBreakdown` | Values grouped by a categorical dimension (e.g. building). |
| `ranking` | Ordered leaderboard of entities (top/bottom N). |
| `distribution` | Histogram — counts across value buckets. |
| `correlation` | X/Y scatter of two metrics per entity. |

### GroupBy

| Value | Description |
| --- | --- |
| `BUILDING` | Group by building. |
| `UNIT_TYPE` | Group by unit type (multi-unit group). |
| `UNIT` | Group by individual unit (property). |
| `CITY` | Group by city (from unit address). |
| `WORKSPACE` | Group by workspace. |

<!-- INPUT_BLOCK_END -->

<!-- OUTPUT_BLOCK_START -->

## Output

| Field | Type | Description |
| --- | --- | --- |
| `content` | `ContentItem[]` | Array of content items returned by the tool - [ContentItem](#contentitem) |
| `isError` | `boolean` | Whether the tool execution resulted in an error |

### ContentItem

| Field | Type | Description |
| --- | --- | --- |
| `type` | `'text'` | Content type (currently only 'text' is supported) |
| `text` | `string` | The text content to display |

<!-- OUTPUT_BLOCK_END -->
