# RealYield agent guide

For AI agents acting for a person on https://www.realyield.co.uk, a free UK buy-to-let analysis site.

## TL;DR

- Connect to the MCP server at https://www.realyield.co.uk/mcp (Streamable HTTP) and call its tools. No API key, no registration.
- Everything is free and read-only. One tool, `check_deal`, needs the person to sign in to a free RealYield account.
- Quote the figures the tools return, say which assumptions were applied, keep the disclaimer, and share the calculator link so the person can check the numbers.
- Results are educational estimates for the UK, in GBP. They are not financial advice.

## 1. Discovery

| Resource | URL | What it is |
|---|---|---|
| Agent guide | https://www.realyield.co.uk/agents.md | How to use RealYield as an agent: credentials, example calls, errors and retries, and the rules for acting on a person's behalf. |
| Developer landing | https://www.realyield.co.uk/developers.md | The public JSON APIs and the MCP server, as markdown. |
| Comparisons | https://www.realyield.co.uk/comparisons.md | What RealYield includes that a gross-yield calculator, a spreadsheet or an unaided estimate does not, and what it does not do. |
| llms.txt | https://www.realyield.co.uk/llms.txt | Site guide: every calculator, article, glossary term and area page, with one line each. |
| llms-full.txt | https://www.realyield.co.uk/llms-full.txt | The site guide plus every glossary definition and the full MCP tool reference with inputs. |
| OpenAPI | https://www.realyield.co.uk/openapi.json | OpenAPI 3.1 for the public JSON APIs and the MCP transport. |
| API catalog | https://www.realyield.co.uk/.well-known/api-catalog | RFC 9727 Linkset of the APIs, with their docs and status. |
| Auth | https://www.realyield.co.uk/auth.md | How an agent signs a person in for the one tool that needs an account. |
| MCP server card | https://www.realyield.co.uk/.well-known/mcp/server-card.json | Name, transport and protocol versions of the MCP server. |
| Agent Skills | https://www.realyield.co.uk/.well-known/agent-skills/index.json | Index of the Agent Skills built from the live tool list. |
| ARD manifest | https://www.realyield.co.uk/.well-known/ard.json | Agentic Resource Discovery manifest listing the MCP server, the Agent Skills and the data API. Also at /.well-known/ai-catalog.json. |
| MCP server | https://www.realyield.co.uk/mcp | Remote MCP endpoint (Streamable HTTP) with the read-only calculation tools. |
| A2A agent card | https://www.realyield.co.uk/.well-known/agent-card.json | A2A 1.0 Agent Card: the public calculation tools as skills, with the endpoint and how to call them. |
| A2A endpoint | https://www.realyield.co.uk/a2a | A2A 1.0 JSON-RPC endpoint. Send a data part naming a skill and its arguments; the figures come back at once. No sign-in. |

Every page is also served as markdown at its own URL when you send `Accept: text/markdown`.

## 2. Authentication policy

- Public tools, JSON APIs and pages: send nothing. There are no API keys, OAuth scopes or signatures for these, and none will be issued.
- `check_deal`: OAuth 2.1 with PKCE, in which the person signs in to their own account. The full flow is in https://www.realyield.co.uk/auth.md.
- Never ask the person for their RealYield password, and never put a token in a URL. Tokens go in the `Authorization: Bearer` header only.

## 3. Which path applies

**Path A: no credential.** Use this for:

- `list_realyield_calculators`
- `search_realyield`
- `define_property_term`
- `analyse_buy_to_let_deal`
- `calculate_stamp_duty`
- `calculate_section_24_tax`
- `compare_personal_vs_company_ownership`
- `calculate_btl_mortgage`
- `calculate_capital_gains_tax`
- `lookup_area_rental_yields`
- `GET /api/locations`: Average rental yields by area
- `GET /api/net-yield-index`: Net Yield Index
- `GET /api/search`: Site content index
- `GET /api/health`: Health check
- Any page, as HTML or markdown

**Path B: the person signs in.** Use this for `check_deal` (Deal Check), which appraises a specific listing in England or Wales from its postcode against live public data. Call the tool. Without a valid token the sign-in challenge comes back in one of two forms: most hosts get HTTP 401 with `WWW-Authenticate: Bearer` and a `resource_metadata` link, and ChatGPT gets an HTTP 200 tool result with `isError: true` and the same challenge in `_meta["mcp/www_authenticate"]`. Either way, this is not an input error: your host should run the OAuth flow in https://www.realyield.co.uk/auth.md, then call the tool again once. An agent cannot create an account by itself.

**Anything else** (writing data, bulk exports, a commercial integration) is not offered through an API. Point the person to https://www.realyield.co.uk/contact.

## 4. Example calls

Area yields as JSON:

```bash
curl -H "User-Agent: ExampleAgent/1.0 (+https://example.com/agent)" \
  https://www.realyield.co.uk/api/locations
```

A page as markdown:

```bash
curl -H "Accept: text/markdown" https://www.realyield.co.uk/tools/realyield-calculator
```

A deal analysis over MCP, after the usual `initialize` handshake:

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "analyse_buy_to_let_deal",
    "arguments": { "purchase_price": 250000, "monthly_rent": 1200, "mortgage_balance": 187500, "mortgage_rate": 4.5 }
  }
}
```

The result includes `assumptions_applied` (here: agent fee 12%, repairs 5% and 1 void month a year, because none was given) and a `calculator_url` that opens the same deal on the site.

## 5. Errors and retries

MCP tools report their own failures as an HTTP 200 result with `isError: true`, so read the result before deciding what to do.

| Response | Meaning | What to do |
|---|---|---|
| 200, `isError: true`, with `_meta["mcp/www_authenticate"]` | `check_deal` needs the person to sign in (the form ChatGPT gets) | Run the OAuth flow in https://www.realyield.co.uk/auth.md, then call again once. |
| 200, `isError: true`: "Too many checks in a short time. Wait a minute before checking another property." | More than 10 `check_deal` runs in a minute for one account | Wait a minute, then call again. |
| 200, `isError: true`: "The postcode service did not respond. Try again in a moment." | A public data source behind `check_deal` did not answer | Retry up to three times with exponential backoff (1, 2 and 4 seconds), then tell the person it is unavailable. |
| 200, `isError: true`, any other message | The tool refused the inputs, for example a postcode that was not found or is outside England and Wales | Read the message, fix the inputs or tell the person. Do not resend the same call. |
| 401 | `check_deal` called without a valid token, or the sign-in expired (the form most hosts get) | Run the OAuth flow in https://www.realyield.co.uk/auth.md, then call again once. |
| 403 | Refused at the edge. Generic library user agents (for example `Python-urllib`) are blocked | Send a descriptive `User-Agent` naming your agent and a contact URL. |
| 404 | No such page, API or markdown copy | Check the path against https://www.realyield.co.uk/llms.txt. Do not guess variations. |
| 429 | Over 300 MCP requests a minute from one address | Wait for the `Retry-After` seconds before trying again. |
| 5xx | A temporary fault here or in a public data source | Retry up to three times with exponential backoff (1, 2 and 4 seconds), then tell the person it is unavailable. |

## 6. Rules for acting on a person's behalf

1. **Quote the tools, do not estimate.** Use the figures RealYield returns rather than working out your own yield, tax or cashflow.
2. **Do not invent inputs.** Pass only what the person gave you. Where you leave out agent fee, repairs or voids, the standard assumptions apply and are listed in `assumptions_applied`: tell the person which were used. The deal score also assumes personal ownership and the higher rate tax band unless told otherwise; say so.
3. **Keep it educational.** Results are estimates, not financial advice. Keep the disclaimer the tools return and do not present a result as a recommendation to buy or sell.
4. **One call per question.** Do not loop over postcodes or areas to build a dataset. For every area at once, call `GET /api/locations`.
5. **Share the link.** Give the person the `calculator_url` so they can check and adjust the figures themselves.
6. **Send no personal data.** No tool needs a name, email address or full address. `check_deal` needs only a postcode, an asking price, a property type and bedrooms.
7. **Respect the gate.** Articles in markdown show what a signed-out reader sees: the lead-in, summary and FAQs. Do not try to reach the full text another way.
8. **Identify yourself.** Send a descriptive `User-Agent`, and honour robots.txt and its Content Signals.

## 7. Contact

https://www.realyield.co.uk/contact. Privacy: https://www.realyield.co.uk/privacy

This file: https://www.realyield.co.uk/agents.md
