# openhome agent guide

openhome is a Portuguese property portal for buying and renting homes. Agents can search public listings and locations, read official price statistics, and read an account owner's data with a token the owner creates.

Base URL: https://openhome.fun

## Quick start

REST public action:

```sh
curl -sS 'https://openhome.fun/api/agent/v1/actions/openhome.listings.search' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"operation":"buy","per_page":3}}'
```

MCP uses stateless Streamable HTTP. This example uses the 2025-11-25 handshake. Use the protocol version returned by initialize in subsequent requests. SDK clients can negotiate their supported revision.

```sh
curl -sS 'https://openhome.fun/mcp' \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'
curl -sS 'https://openhome.fun/mcp' \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -sS 'https://openhome.fun/mcp' \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
curl -sS 'https://openhome.fun/mcp' \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"openhome.listings.search","arguments":{"operation":"buy","per_page":3}}}'
```

## Discovery

- [Agent guide](https://openhome.fun/AGENTS.md)
- [Site overview](https://openhome.fun/llms.txt)
- [Full action schemas](https://openhome.fun/llms-full.txt)
- [OpenAPI](https://openhome.fun/openapi.json)
- [API docs](https://openhome.fun/api/docs)
- [MCP](https://openhome.fun/mcp)
- [Agent connections](https://openhome.fun/agents)
- [Action registry](https://openhome.fun/api/agent/v1/actions)
- [Readiness and revision](https://openhome.fun/readyz)

## Authorization

Sign in at [Agents](https://openhome.fun/agents). Under **Connections**, name a token, select the scopes to share, and choose **Create token**. Copy the secret when it appears. It is shown once. Pass it as `Authorization: Bearer oha_…` to REST or MCP. Tokens use the `oha_` prefix followed by 64 hexadecimal characters and expire after 90 days by default. The token API accepts lifetimes from 1 to 365 days. Revoke tokens under **Connections** to stop future access.

`ohs_` service keys (by arrangement) allow selected public reads.

| Scope | Grants |
| --- | --- |
| `account:read` | Get account |
| `favorites:read` | List favorites |
| `saved_searches:read` | List saved searches |
| `manage:cases:read` | List maintenance requests |
| `manage:cases:read` | Read a maintenance request |
| `manage:cases:read` | Export case records |
| `manage:cases:write` | Create a maintenance request |
| `manage:cases:write` | Request information |
| `manage:cases:write` | Select an approved contractor |
| `manage:cases:write` | Record a quote |
| `manage:cases:write` | Propose a visit |
| `manage:cases:write` | Record a note |
| `manage:cases:write` | Request resident confirmation |

- `400 invalid_input` means the input failed validation. See the issues in the response.
- `401 auth_required` means the REST action requires a token. MCP returns a tool error with the same code.
- `401 invalid_token` means the supplied token is invalid, expired, or revoked. Check the Bearer challenge.
- `403 insufficient_scope` means the token lacks the required scope. MCP returns a tool error with the same code.
- `404 unknown_action` means the REST action ID does not exist. A missing listing or location returns `404 not_found`.
- `429 too_many_requests` means the rate limit was reached.

## Actions

| Action | Scope | Backing REST route | Description |
| --- | --- | --- | --- |
| `openhome.listings.search` | public | `GET /api/v1/listings` | Find public homes to buy or rent in Portugal. |
| `openhome.listings.get` | public | `GET /api/v1/listings/:id` | Read a public listing by numeric ID or OH- reference. |
| `openhome.locations.search` | public | `GET /api/v1/locations/search` | Autocomplete Portuguese places and get their search paths. |
| `openhome.prices.get` | public | `GET /api/v1/prices` | Read official INE price statistics by operation, with source and dates. |
| `openhome.account.me` | account:read | `GET /api/v1/auth/me` | Read the profile of the token owner. |
| `openhome.favorites.list` | favorites:read | `GET /api/v1/favorites` | Read the token owner's favorite listings, newest first. |
| `openhome.saved_searches.list` | saved_searches:read | `GET /api/v1/saved-searches` | Read the token owner's saved searches and their match counts. |
| `openhome.manage.cases.list` | manage:cases:read | `GET /api/v1/manage/cases` | Read an organisation's maintenance work queue with next action, responsible party and deadline. |
| `openhome.manage.cases.read` | manage:cases:read | `GET /api/v1/manage/cases/:uid` | Read one case with timeline, work orders, visits, quotes, budget, invoices and message delivery states. |
| `openhome.manage.records.export` | manage:cases:read | `GET /api/v1/manage/cases/:uid` | Export the full record of a case for filing (evidence is referenced, never inlined). |
| `openhome.manage.cases.create` | manage:cases:write | `POST /api/v1/manage/cases` | File a repair request for a managed property. Urgency follows the organisation's deterministic rules. |
| `openhome.manage.cases.request_info` | manage:cases:write | `POST /api/v1/manage/cases/:uid/answers` | Ask the reporter for missing information that changes the next action. |
| `openhome.manage.cases.dispatch` | manage:cases:write | `POST /api/v1/manage/cases/:uid/dispatch` | Offer the job to the organisation's approved roster (or a named roster member). Repeats never create a second dispatch. |
| `openhome.manage.quotes.record` | manage:cases:write | `POST /api/v1/manage/work-orders/:uid/quotes` | Record a contractor quote or change order. Within standing authority it is reserved; otherwise a manager decides. |
| `openhome.manage.visits.propose` | manage:cases:write | `POST /api/v1/manage/work-orders/:uid/visits` | Propose an appointment. A proposal is not a booking: entry consent is given only by the resident or a manager. |
| `openhome.manage.cases.note` | manage:cases:write | `POST /api/v1/manage/cases/:uid` | Add an internal note to the case history (never shown to residents or contractors). |
| `openhome.manage.cases.request_confirmation` | manage:cases:write | `POST /api/v1/manage/cases/:uid/confirm` | Ask the resident to confirm the repair. Silence never becomes a verified resolution. |

Call any action with `POST /api/agent/v1/actions/{id}` and a JSON object with an `input` property. Successful REST responses contain `ok`, `action`, `version`, and `result`. MCP returns the result in `structuredContent` and as JSON text.

## Limits

Listing search returns up to 50 items per page. Location autocomplete returns up to 30. Anonymous REST executions and MCP requests share a limit of 60 requests per 60 seconds per IP. Users can create 10 tokens per hour.

## Data and verification

Price statistics use official data with source URLs and observation periods. Demo listings are marked in development and excluded from listing totals and official statistics. Scoped actions read the token owner's data. Result URLs are absolute and lead to the corresponding public data or signed-in account pages. Compare official prices with their source links. `GET /readyz` reports health and the deployed revision.

## Unsupported

There is no A2A service or OAuth server. All agent actions in this release are read-only. App writes remain human-only in the UI.
