> ## Documentation Index
> Fetch the complete documentation index at: https://develop.cotality.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trestle

> Search MLS listings, count inventory, look up field values, and find properties by address with the Trestle MCP server — read-only, for agents and developers building listing and market workflows.

Use the Trestle MCP server to answer listing questions in an agent without hand-writing API calls — for example, finding active homes that match a client's criteria, sizing local inventory, or checking an address against MLS data. All six tools are read-only.

| Tool | Use it to |
| - | - |
| `trestle-search_property` | Search `Property` listings with OData arguments |
| `trestle-aggregate_property` | Count listings grouped by one to three fields |
| `trestle-lookup_enumerations` | Find the valid values for a lookup field |
| `trestle-search_entity` | Search `Member`, `Office`, `OpenHouse`, `Field`, and other entity sets |
| `trestle-get_property_information` | Look up listing data by street address |
| `trestle-lint_trestle_odata_query` | Check an OData query before you run it |

***

## Data scope

| Attribute | Value |
| - | - |
| **Access** | Read-only. No tool creates or changes MLS data. |
| **Source** | MLS listing data served by Trestle |
| **Query language** | OData (`$filter`, `$select`, `$orderby`, `$top`, `$skip`, `$count`, `$expand`, `$search`, `$apply`) |
| **Output format** | JSON. OData collections for search tools. Null fields are omitted and zero values are kept. |
| **Limits** | `aggregate_property` groups by up to three scalar fields and scans up to `5000` records by default. `get_property_information` accepts up to `25` addresses per call by default. Free-text arguments are capped at 8,192 characters by default. |
| **Exclusions** | No writes. Field-to-field comparisons in a `$filter` aren't supported. Navigation and multi-value lookup fields can't be used in `group_by`. |

***

## `trestle-search_property`

Searches Trestle `Property` records using OData query arguments.

**When to use:**

* You need listings that match price, status, location, or feature criteria
* You need specific fields for a known listing
* You need listings with open houses, using `expand_expression`

**Examples:**

* *"Find active homes in Austin listed between $400,000 and $600,000"*
* *"Show the five most recently reduced listings in Denver"*

### Input schema

| Parameter | Type | Required | Description |
| - | - | - | - |
| `filter_expression` | `string` | No | OData `$filter`. Example: `City eq 'Austin' and ListPrice ge 400000`. |
| `select_expression` | `string` | No | OData `$select`. Comma-separated fields to return. |
| `orderby_expression` | `string` | No | OData `$orderby`. Example: `ListPrice asc`. |
| `top_count` | `integer` | No | Maximum rows to return (`$top`). |
| `skip_count` | `integer` | No | Rows to skip (`$skip`) for paging. |
| `count_required` | `boolean` | No | Include the total match count (`$count`). |
| `expand_expression` | `string` | No | OData `$expand`. Example: `OpenHouse($select=OpenHouseStartTime)`. |
| `search_expression` | `string` | No | OData `$search` free-text term. |
| `apply_expression` | `string` | No | OData `$apply` for transformations such as `aggregate(ListPrice with sum as Total)`. |

### Example request

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "trestle-search_property",
    "arguments": {
      "filter_expression": "City eq 'Austin' and StandardStatus eq 'Active' and ListPrice ge 400000 and ListPrice le 600000",
      "select_expression": "ListingId,ListPrice,City,BedroomsTotal,BathroomsTotalInteger",
      "orderby_expression": "ListPrice asc",
      "top_count": 10,
      "count_required": true
    }
  }
}
```

### Output schema

An OData collection. Rows are in `value`, and the total match count is in `@odata.count` when you set
`count_required`. Null fields are omitted, and zero values are kept.

***

## `trestle-aggregate_property`

Counts `Property` records grouped by one to three scalar fields. Results are exact and bounded.

**When to use:**

* You need counts by status, property type, city, or another scalar field
* You need a market snapshot without downloading every row

**Examples:**

* *"How many active listings are there in Austin by property type?"*
* *"Count listings by status in Seattle"*

### Input schema

| Parameter | Type | Required | Description |
| - | - | - | - |
| `filter_expression` | `string` | No | OData filter that narrows the records counted. Strongly recommended. |
| `group_by` | `array[string]` | Yes | One to three scalar fields to group by. Navigation and multi-value lookup fields are rejected. |
| `top_count` | `integer` | No | Groups to return. Default `20`, maximum `100`. |
| `max_records` | `integer` | No | Most records the call may scan. Default `5000`. |
| `sort_by` | `string` | No | Group ordering. Default `count desc`. |

### Example request

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "trestle-aggregate_property",
    "arguments": {
      "filter_expression": "City eq 'Austin' and StandardStatus eq 'Active'",
      "group_by": ["PropertyType"],
      "top_count": 5,
      "max_records": 5000,
      "sort_by": "count desc"
    }
  }
}
```

### Output schema

One entry per group, with the grouped field values and a `count`. If more records match than
`max_records`, the tool returns a `limit_exceeded` problem and no partial groups.

***

## `trestle-lookup_enumerations`

Looks up the valid values for a Trestle lookup field.

**When to use:**

* You need the exact literal for a status, property type, or feature field before filtering
* You need to list every value a lookup accepts

**Examples:**

* *"What are the valid listing statuses?"*
* *"What pool features can I filter on?"*

### Input schema

| Parameter | Type | Required | Description |
| - | - | - | - |
| `lookup_name` | `string` | No | The lookup to read, such as `StandardStatus` or `PoolFeatures`. This is a field's lookup, not an entity like `Property`. |
| `resource_name` | `string` | No | Resource that owns the lookup. |
| `filter_expression` | `string` | No | OData `$filter`. |
| `select_expression` | `string` | No | OData `$select`. Example: `LookupName,LookupValue`. |
| `orderby_expression` | `string` | No | OData `$orderby`. |
| `top_count` | `integer` | No | Maximum rows to return. |
| `skip_count` | `integer` | No | Rows to skip. |
| `count_required` | `boolean` | No | Include the total count. |
| `expand_expression` | `string` | No | OData `$expand`. |
| `apply_expression` | `string` | No | OData `$apply`. |

### Example request

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "trestle-lookup_enumerations",
    "arguments": {
      "lookup_name": "StandardStatus",
      "select_expression": "LookupName,LookupValue",
      "orderby_expression": "LookupValue asc",
      "top_count": 100
    }
  }
}
```

***

## `trestle-search_entity`

Searches a supported Trestle entity set other than `Property`, such as `Member`, `Office`,
`OpenHouse`, or `Field`.

**When to use:**

* You need open house schedules, agents, offices, or field metadata
* You need to discover which fields exist on a resource

**Examples:**

* *"List the fields available on the Property resource"*
* *"Which open houses are scheduled this weekend?"*

### Input schema

| Parameter | Type | Required | Description |
| - | - | - | - |
| `entity_set` | `string` | Yes | The entity set to query. An unsupported name returns an error. |
| `filter_expression` | `string` | No | OData `$filter`. |
| `select_expression` | `string` | No | OData `$select`. |
| `orderby_expression` | `string` | No | OData `$orderby`. |
| `top_count` | `integer` | No | Maximum rows to return. |
| `skip_count` | `integer` | No | Rows to skip. |
| `count_required` | `boolean` | No | Include the total count. |
| `expand_expression` | `string` | No | OData `$expand`. |
| `search_expression` | `string` | No | OData `$search` term. |
| `apply_expression` | `string` | No | OData `$apply`. |

> [!TIP]
>
> For open houses filtered by city or status, use `trestle-search_property` with
> `expand_expression="OpenHouse(...)"`. Schedule fields live on `OpenHouse`, but address, city, price,
> and status live on the related `Property`.

### Example request

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "trestle-search_entity",
    "arguments": {
      "entity_set": "Field",
      "filter_expression": "ResourceName eq 'Property'",
      "select_expression": "ResourceName,FieldName,LookupName,Type",
      "orderby_expression": "FieldName asc",
      "top_count": 25
    }
  }
}
```

***

## `trestle-get_property_information`

Returns compact property information for one or more street addresses.

**When to use:**

* You have addresses and want listing data without writing an OData filter
* You need to check several addresses in one call

**Examples:**

* *"Get the listing details for 123 Main St, Austin, TX 78701"*
* *"Look up these three addresses and tell me which are active"*

### Input schema

| Parameter | Type | Required | Description |
| - | - | - | - |
| `addresses` | `array[string]` | Yes | Street addresses to look up. The server accepts up to `25` per call by default. More returns `invalid_argument`. A blank list is rejected. |
| `additional_filters` | `string` | No | An OData filter that narrows the results. Example: `StandardStatus eq 'Active'`. |

### Example request

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "tools/call",
  "params": {
    "name": "trestle-get_property_information",
    "arguments": {
      "addresses": ["123 Main St, Austin, TX 78701"],
      "additional_filters": "StandardStatus eq 'Active'"
    }
  }
}
```

***

## `trestle-lint_trestle_odata_query`

Checks OData query arguments without running them. It is advisory: passing lint doesn't guarantee the
query succeeds, and warnings flag behavior the linter couldn't verify.

**When to use:**

* Before any nontrivial `search_property`, `search_entity`, or `aggregate_property` call
* When the query uses unfamiliar fields, enum literals, null checks, `$apply`, or paging
* When a query failed and you need to know why

**Examples:**

* *"Check whether this filter is valid before I run it"*

### Input schema

Takes the same arguments as `trestle-search_entity`: `entity_set` (required) plus the OData
expression arguments (`filter_expression`, `select_expression`, `orderby_expression`, `top_count`,
`skip_count`, `count_required`, `expand_expression`, `search_expression`, and `apply_expression`).

### Example request

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "tools/call",
  "params": {
    "name": "trestle-lint_trestle_odata_query",
    "arguments": {
      "entity_set": "Property",
      "filter_expression": "PreviousListPrice gt ListPrice",
      "select_expression": "PreviousListPrice,ListPrice",
      "top_count": 1
    }
  }
}
```

### Output schema

A lint result with a `verdict` of `pass` or `fail` and a list of `issues`. Each issue carries a
`rule_id`. The example above fails with a field-to-field comparison rule, because Trestle can't compare
two fields in a filter. Compare them client-side instead.

***

## Errors and limits

Failures return an [RFC 9457 Problem Details](https://develop.cotality.com/reference/mcp-errors.md) object with `isError: true`. A
failing lint preflight returns a `422` `validation-error` with `preflight: true`, and the request
never reaches Trestle.

| Code | Meaning |
| - | - |
| `argument_too_large` | A free-text argument is longer than 8,192 characters by default. |
| `argument_control_character` | A free-text argument contains a control character. |
| `invalid_argument` | An argument is malformed, such as unbalanced parentheses, too many addresses, or a blank address list. |
| `limit_exceeded` | `aggregate_property` matched more records than `max_records`. No partial results. |
| `group_limit_exceeded` | `aggregate_property` found more distinct groups than the per-call cap. |
| `unsupported_group_field` | `group_by` names a field that can't be grouped, such as a navigation or multi-value lookup field. |
| `response_too_large` | A Trestle response or tool result exceeds the size cap. Select fewer fields or lower `top_count`. |
| `deadline_exceeded` | The call ran past its time budget. Default 60 seconds. |
| `server_busy` | No request slot was free in time. Retry. |

***

## Related

* [MCP tool errors](https://develop.cotality.com/reference/mcp-errors.md) — the Problem Details format that Trestle failures use
* [Rate limits](https://develop.cotality.com/reference/rate-limits.md) — request quotas and retry guidance
* [CLIP tools](https://develop.cotality.com/mcp/property-data/tools/clip-tools.md) — resolve an address to a CLIP for parcel-level data
* [Property characteristics](https://develop.cotality.com/mcp/property-data/tools/property-characteristics.md) — structural detail for a property
* [Property value](https://develop.cotality.com/mcp/property-value/tools/property-value.md) — AVM estimate and comparable sales for a property
