dwelldelta-mcp 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -38,8 +38,8 @@ SA rents: South Australian Housing Trust, Government of South Australia,
38
38
  Private Rent Report, whose own page states no licence - the national
39
39
  catalogues list CC BY 4.0 and CC BY 3.0 AU;
40
40
  Tasmanian rents: based on Department of Justice (Tasmania), Rental Bond and
41
- Rental Data, CC BY 4.0 as data.gov.au lists it, with medians calculated by
42
- DwellDelta;
41
+ Rental Data, CC BY 4.0 as read on data.gov.au by DwellDelta's owner in a
42
+ browser, with medians calculated by DwellDelta;
43
43
  NSW sale prices: CC BY 4.0, State of New South Wales (Department of
44
44
  Communities and Justice); New Zealand rents: CC BY 3.0 NZ, the Ministry of
45
45
  Business, Innovation and Employment, Tenancy Services rental bond data; ACT,
package/README.md CHANGED
@@ -10,11 +10,11 @@ Seven read-only tools, and one that adds the user's own rent when they ask:
10
10
 
11
11
  | Tool | What it answers |
12
12
  |---|---|
13
- | `rent_check` | a weekly rent, and any proposed new rent, against the ABS rents index for the capital city since the lease began (the same arithmetic as the rent check at tools.dwelldelta.com.au); or, given a `place` instead of a lease start, against that place's median of new bonds or leases, and its quartiles where published (from 0.12.0) |
13
+ | `rent_check` | a weekly rent, and any proposed new rent, against the ABS rents index for the capital city since the current rent began (`rent_since`, the last rise) or, without it, since the lease began (`lease_start`) (the same arithmetic as the rent check at tools.dwelldelta.com.au); or, given a `place` instead of either month, against that place's median of new bonds or leases, and its quartiles where published (from 0.12.0) |
14
14
  | `property_rents` | the rents of a place asked with no state - a suburb, locality or postcode - answered from the state that holds it (NSW, Victoria, Queensland, WA, SA or, from 0.16.0, Tasmania); an NSW or Tasmanian suburb is answered for its postcode, and a name held in more than one state is listed, not chosen (from 0.12.0). From 0.14.0 also a New Zealand council or region (MBIE's bonds for one month, in NZ$, provisional) and an ACT, NT or Tasmanian postcode (interim ABS cover: the rent paid at the 2021 Census, the capital's rents index, sale prices - not new-bond medians; for Tasmania from 0.16.0 only a postcode its bond medians give no figure for) |
15
15
  | `market_indicators` | the latest RBA cash rate, unemployment, wage growth, rents for all eight capitals, NSW lending, lending standards and arrears, approvals and completions - each with period, source, licence and limits; filter by `geography` |
16
16
  | `vic_rents` | Victorian rents by suburb group from Homes Victoria's Rental Report: the median weekly rent of new leases, the lease count and the change on a year before, for 146 suburb groups and 13 regions; filter by `suburb_group` or `region` (from 0.5.0) |
17
- | `area_rents` | median weekly rent of new bonds, all dwellings together, with the bond count and the change on a year before, for one state per call: NSW by postcode or council (NSW Department of Communities and Justice), Queensland by suburb or council (Residential Tenancies Authority), WA by locality (calculated by DwellDelta from the Government of Western Australia's bond records), SA by suburb (SA Housing Trust, Private Rent Report; its publisher's page states no licence, and the national catalogues list CC BY), Tasmania by postcode (calculated by DwellDelta from the Department of Justice's bond records, private housing, one month at a time; CC BY 4.0 as data.gov.au lists it); each file states CC BY 4.0 (from 0.6.0; SA from 0.11.0; Tasmania from 0.16.0) |
17
+ | `area_rents` | median weekly rent of new bonds, all dwellings together, with the bond count and the change on a year before, for one state per call: NSW by postcode or council (NSW Department of Communities and Justice), Queensland by suburb or council (Residential Tenancies Authority), WA by locality (calculated by DwellDelta from the Government of Western Australia's bond records), SA by suburb (SA Housing Trust, Private Rent Report; its publisher's page states no licence, and the national catalogues list CC BY), Tasmania by postcode (calculated by DwellDelta from the Department of Justice's bond records, private housing, one month at a time; CC BY 4.0 as read on data.gov.au by DwellDelta's owner in a browser); each file states CC BY 4.0 (from 0.6.0; SA from 0.11.0; Tasmania from 0.16.0) |
18
18
  | `nsw_sale_prices` | NSW median sale prices by postcode or council from the NSW Department of Communities and Justice's Rent and Sales Report (CC BY 4.0): the median, the quartiles, the number of sales and the change on a year before, each for all dwellings, houses (non-strata) and units and town houses (strata). Medians of homes sold - never what any one home sold for; a line set by a few very large sales or by many sales at one identical price is marked UNUSUAL (from 0.7.0), and is not a going price |
19
19
  | `data_sources` | the sources, their licences, and what DwellDelta cannot answer |
20
20
  | `contribute_rent` | adds the user's own rent, anonymously, to DwellDelta's suburb benchmarks - only when the user asks, and only after they have read and agreed to the consent wording (from 0.5.0) |
@@ -41,16 +41,18 @@ nothing: it returns the consent wording, the [Contributor Terms](https://tools.d
41
41
  that wording and you have said yes does it call again, with the token. What is then stored, in AWS Sydney, is the
42
42
  suburb (in Western Australia the locality, in Victoria the Homes Victoria suburb group), home type, bedrooms, rent,
43
43
  lease month and lease kind, and whether it is a rent you pay or the rent of a
44
- property you own - never an address, name or email. You get a deletion code; email it to lingtao@xcelerent.com
44
+ property you own - never an address, name or email. You get a deletion code; email it to hello@dwelldelta.com.au
45
45
  and the record is deleted. Only your own rent may be added: an assistant must not add a figure it read on a
46
46
  website or a listing.
47
47
 
48
- From 0.15.0 it sends terms version 2026-11-03, whose consent, Contributor Terms and Privacy Notice name the lease
49
- kind (whether it is a new lease or a renewal), which every contribution has recorded. 0.10.1 to 0.14.0 send
50
- 2026-10-27, which the endpoint accepts for now; once that stops, their contributions are refused (HTTP 409) - update
51
- to 0.15.0 or later. From 0.15.0 a refusal the endpoint is known to give also says what to do, in the package's own
52
- words ("Not added: the contribution was not saved (HTTP 409): the terms have changed: update dwelldelta-mcp (npx -y
53
- dwelldelta-mcp@latest)."); any other reason gives the status alone.
48
+ From 0.17.0 it sends terms version 2026-11-11, whose Contributor Terms and Privacy Notice give hello@dwelldelta.com.au
49
+ as DwellDelta's address; nothing else in them changed for a contributor. 0.15.0 to 0.16.1 send 2026-11-03, whose
50
+ consent, Contributor Terms and Privacy Notice name the lease kind (whether it is a new lease or a renewal), which
51
+ every contribution has recorded; 0.10.1 to 0.14.0 send 2026-10-27. The endpoint accepts both for now; once it stops
52
+ accepting one, contributions sent under it are refused (HTTP 409) - update to the latest version. From 0.15.0 a
53
+ refusal the endpoint is known to give also says what to do, in the package's own words ("Not added: the
54
+ contribution was not saved (HTTP 409): the terms have changed: update dwelldelta-mcp (npx -y dwelldelta-mcp@latest).");
55
+ any other reason gives the status alone.
54
56
 
55
57
  ## NSW sale prices (from 0.7.0)
56
58
 
@@ -107,9 +109,10 @@ bonds lodged in the month (community housing left out); a postcode needs 10 bond
107
109
  30 is a small sample. One month is held, so no change on a year is given. `area` takes a postcode or a suburb name
108
110
  the month's bonds were lodged under (each postcode's line lists them), answered for its whole postcode with a note
109
111
  saying so. The state alone also gives the state's medians by bedrooms and by dwelling type (`state_breakdown`); no
110
- postcode has them, so `dwelling_type` and `bedrooms` are refused for a postcode. The licence is CC BY 4.0 as
111
- data.gov.au lists the dataset, not read at source: `cite_as` says "CC BY 4.0 as data.gov.au lists it", and
112
- `source_url` is data.gov.au's listing.
112
+ postcode has them, so `dwelling_type` and `bedrooms` are refused for a postcode. The licence is CC BY 4.0, read on
113
+ the dataset's page on data.gov.au by DwellDelta's owner in a browser on 2026-11-08: data.gov.au refuses DwellDelta's
114
+ reader, so no automated check reads that page. `cite_as` says "CC BY 4.0 as read on data.gov.au by DwellDelta's owner in a browser" (0.16.x said "as data.gov.au lists it",
115
+ when the licence had been read only in a search result), and `source_url` is data.gov.au's listing.
113
116
 
114
117
  South Australia's file holds one quarter today, so its `compared_with`, year-ago medians and changes are null and no
115
118
  answer names a year it is compared with. Its counts of bonds are rounded to the nearest 5 (the SA Housing Trust's note says so of its totals;
@@ -149,10 +152,11 @@ bonds lodged in an Australian quarter, in Australian dollars. Nothing is compare
149
152
  "Canterbury Region"; "Wellington, NZ" lists the city and the region, and
150
153
  "Wellington" alone, an NSW suburb too, lists all three): MBIE Tenancy Services' median weekly rent of
151
154
  the bonds for private tenancies that began in the latest month, with its geometric mean, quartiles and bond count,
152
- CC BY 3.0 NZ. Every amount is in New Zealand dollars, written NZ$, in fields ending `_nzd`; MBIE calls the data
153
- provisional, so no change on a year is given. A figure on fewer than 30 bonds is a small sample; MBIE gives none
154
- below 5. The answer carries `country: "NZ"`, `currency: "NZD"`, `provisional: true`, `nz_place`, and the place's
155
- page at tools.dwelldelta.com.au/area/nz/.
155
+ CC BY 3.0 NZ. Every amount is in New Zealand dollars, written NZ$, in fields ending `_nzd`; DwellDelta treats the
156
+ data as provisional, so no change on a year is given. The answer's `Provisional:` line, taken from the data file,
157
+ gives what MBIE's page says of this (the file's `source_wording` field says it too; the answer has no such field). A
158
+ figure on fewer than 30 bonds is a small sample; MBIE gives none below 5. The answer carries `country: "NZ"`,
159
+ `currency: "NZD"`, `provisional: true`, `nz_place`, and the place's page at tools.dwelldelta.com.au/area/nz/.
156
160
  - **The ACT, the Northern Territory and Tasmania**, by postcode, or the state or its capital alone (from 0.16.0, for
157
161
  Tasmania only Hobart, the city as before, and a postcode its bond medians give no figure for, saying so; the state
158
162
  alone and a postcode with a bond median are answered from the bonds, as `area_rents` answers them, and Hobart's
@@ -175,6 +179,8 @@ attribution), `data_as_of`, `snapshot_built`, `snapshot_origin` (`published` for
175
179
  tools.dwelldelta.com.au, `bundled` for the copy in the package), `server_version`, `retrieved_at`, and `stale` /
176
180
  `stale_reason`.
177
181
  Every failure is marked `isError` and ends with `Next step:` - an unknown city or geography names the valid ones.
182
+ An unexpected error's next step is "Report this to hello@dwelldelta.com.au." (from 0.17.0; to 0.16.1 the package
183
+ named the owner's own address, which still reaches DwellDelta; the hosted server has given hello@ since 2026-11-10).
178
184
 
179
185
  The indicators are a weekly snapshot, rebuilt every Monday and published at
180
186
  https://tools.dwelldelta.com.au/market/indicators.json. The server uses that file when it is newer than the copy it
@@ -192,6 +198,21 @@ copy city by city (each city's series starts no later and ends no earlier than i
192
198
  later than the current one; otherwise, or with `DWELLDELTA_OFFLINE=1`, the bundled copy answers.
193
199
  `data_as_of` and the `Cite:` line's period say which month the answer runs to.
194
200
 
201
+ ### rent_check from the month the current rent began: `rent_since` (from 0.17.0)
202
+
203
+ - `rent_since` is a new, optional input: the month the current rent began - the last rent rise, or the lease start
204
+ if the rent has not risen - read in the same forms as `lease_start` ("2024-03", "2024-03-01", "March 2024"). Given,
205
+ the comparison runs from it, as the rent check at tools.dwelldelta.com.au does since tools #157.
206
+ - `lease_start` keeps the meaning it was released with: the month the lease began. With `lease_start` alone the
207
+ comparison runs from it as before, and the answer's text opens (after any STALE line) with one line more: "No
208
+ rent_since was given, so this compares from the lease start (lease_start). If the rent has risen since the lease
209
+ began, give rent_since, the month of the last rise." The structured result is unchanged.
210
+ - With both, `rent_since` is the month compared from, and a `rent_since` earlier than `lease_start` is refused (the
211
+ current rent cannot have begun before the lease did). `city` is needed with either.
212
+ - In the structured `result`, `leaseStart` is `lease_start` as given, and is there whenever `lease_start` is; the new
213
+ field `rentSince` is `rent_since` as given, there only when it is. Neither ever stands for the other.
214
+ - `contribute_rent`'s `lease_start` is unchanged: the month the lease began.
215
+
195
216
  ### rent_check reads common input shapes (from 0.13.0)
196
217
 
197
218
  - `city` is read in any case ("sydney"), as "Greater Sydney", or as "Sydney, NSW" (the state must be the city's
@@ -233,12 +254,14 @@ later than the current one; otherwise, or with `DWELLDELTA_OFFLINE=1`, the bundl
233
254
  tools.dwelldelta.com.au, the state's page for the state's own figure, else null), `pages` and `cite_as` (null when
234
255
  every figure is refused); the text gains `Page:` and `Cite as:` lines. Results stay text only, readable by clients
235
256
  on every protocol version the server accepts. No earlier field changes.
236
- - (From 0.16.0.) A WA answer's `cite_as`, and its text's `Cite as:` line, say "Median calculated by DwellDelta
237
- from bond records." before the source ("Medians calculated ..." where the answer gives more than one median; one
238
- given and the other places matched refused is "Median"): the Government of Western Australia publishes one row per
239
- bond and no medians, so the line quoted alone no longer credits it with DwellDelta's figure. The area page's line,
240
- always one place's, says the same. The field's meaning is unchanged, and no other state's line changes: theirs are
241
- their publishers' own medians.
257
+ - (From 0.16.0.) A WA or Tasmanian answer's `cite_as`, and its text's `Cite as:` line, say "Median calculated by
258
+ DwellDelta from bond records." before the source ("Medians calculated ..." where the answer gives more than one
259
+ median; one given and the other places matched refused is "Median"): the Governments of Western Australia and
260
+ Tasmania publish one row per bond and no medians, so the line quoted alone no longer credits them with DwellDelta's
261
+ figure. The area page's line, always one place's, says the same. The field's meaning is unchanged, and no other
262
+ state's line changes: theirs are their publishers' own medians. From 0.17.0, this line and the
263
+ answer's `derived` hold for both states even if their file loses its `derived` flag: the server writes one line to
264
+ stderr saying so, and nothing else changes.
242
265
  - (From 0.16.0.) Tasmania's bond medians (see "Rents by area" above): `area_rents` takes `state: "TAS"`.
243
266
  `property_rents` answers from them a Tasmanian postcode with a median, the state alone, and a suburb the month's
244
267
  bonds were lodged under that no other file holds ("Sandy Bay"), or any with ", TAS" ("Kingston, TAS"), for its whole
@@ -336,6 +359,65 @@ published data file. The structured result says the same, in new fields; every f
336
359
  in `refusals`.
337
360
  - `rent_check` and `market_indicators` say `sample_size: null` and why: an index and these indicators have no count.
338
361
 
362
+ ## Tool annotations and why
363
+
364
+ Every tool sets all four MCP hints explicitly. Here is each value, and the reason for it in what the code does. The
365
+ hosted server (https://mcp.dwelldelta.com.au/mcp), which DwellDelta's Claude directory listing and ChatGPT plugin use,
366
+ registers the seven read-only tools and nothing else; `contribute_rent` is registered only by this package's stdio
367
+ server.
368
+
369
+ | Tool | Served by | readOnlyHint | destructiveHint | idempotentHint | openWorldHint |
370
+ |---|---|---|---|---|---|
371
+ | `rent_check` | npm and hosted | true | false | true | false |
372
+ | `market_indicators` | npm and hosted | true | false | true | false |
373
+ | `data_sources` | npm and hosted | true | false | true | false |
374
+ | `vic_rents` | npm and hosted | true | false | true | false |
375
+ | `area_rents` | npm and hosted | true | false | true | false |
376
+ | `nsw_sale_prices` | npm and hosted | true | false | true | false |
377
+ | `property_rents` | npm and hosted | true | false | true | false |
378
+ | `contribute_rent` | npm only | false | false | false | true |
379
+
380
+ The seven read-only tools share one set of hints (`readOnly` in `register-tools.mjs`):
381
+
382
+ - `readOnlyHint: true` - each tool looks up or computes an answer from DwellDelta's own data files and returns it; it
383
+ creates, updates, deletes and sends nothing. The files are the copies this package ships, DwellDelta's published
384
+ copies at fixed addresses on tools.dwelldelta.com.au (read when the server loads, refreshed by the hosted server no
385
+ more than once an hour, and held to the rules of form above), or, on your own machine, a copy you name with a
386
+ `DWELLDELTA_` variable, or a `dwelldelta-data/market` folder two levels above the package where one exists
387
+ (DwellDelta's own working copy of these files). No argument chooses what is read or fetched. Nothing is kept from
388
+ a call but the hosted server's one log line, below.
389
+ - `destructiveHint: false` - nothing is written, so nothing can be deleted or overwritten.
390
+ - `idempotentHint: true` - the same arguments give the same figures until DwellDelta publishes a newer period, and a
391
+ call changes nothing outside the server's own request log; only `retrieved_at`, and a staleness flag once its due
392
+ date passes, move with the clock.
393
+ - `openWorldHint: false` - each tool answers from a bounded catalog, DwellDelta's own data files at fixed addresses:
394
+ no web search, no address taken from the arguments, no other party. OpenAI's app submission guidelines: "A tool
395
+ confined to a bounded private account, workspace, or catalog may use `false`, even when externally hosted.
396
+ Connectivity alone does not determine this value." (<https://developers.openai.com/apps-sdk/app-submission-guidelines>)
397
+
398
+ What the hosted server logs, one line per request, in fixed words: `http` and `rpc` (the kind of request: its HTTP
399
+ method and its MCP method), `path` (the part of the server asked for: "mcp", "challenge" or "other"), `origin`
400
+ (whether a browser origin was absent, allowed or refused: "none", "allowed" or "refused" - never the origin itself),
401
+ `tool` (which tool was called), `status` (the status code), `ok` (whether it succeeded), `ms` (how long it took),
402
+ `via` (on a request refused before it reaches the server, how it was refused) and `feeds` (only when a data file the
403
+ server fetched from tools.dwelldelta.com.au has failed its checks of the file's text, so that the file was not used or
404
+ some of its rows were left out: that file and each check it failed - nothing from the file and nothing about the
405
+ request). Amazon Web Services adds the time each line was written and its request number for it, and lines of its own
406
+ with a request number, the time taken and the memory used. No line holds the tool's arguments, the answer or any
407
+ header's value. The [Privacy Notice](https://tools.dwelldelta.com.au/privacy/#hosted-mcp) has the detail.
408
+
409
+ `contribute_rent` (`server.mjs`):
410
+
411
+ - `readOnlyHint: false` - its second call, with the consent token and `user_agreed: true`, sends the user's rent to
412
+ DwellDelta's contribution endpoint, which stores it. (The first call stores and sends nothing.)
413
+ - `destructiveHint: false` - the write is additive: one new record. The tool never changes or deletes a stored record
414
+ and has no way to; a contributor has theirs deleted by emailing their deletion code.
415
+ - `idempotentHint: false` - every first call issues a new token, and each token can add the rent once, so the same
416
+ rent can be added again as a second record. (A repeat of a second call is refused: its token is used.)
417
+ - `openWorldHint: true` - it is the one tool that sends anything the user gives it off their machine: the rent goes to
418
+ one fixed address, DwellDelta's own contribution service (an AWS Lambda function in Sydney). It is marked as
419
+ reaching outside, the cautious setting.
420
+
339
421
  ## Licence
340
422
 
341
423
  The code is MIT (see LICENSE). The data is not: each figure keeps its source's licence and attribution, which every
@@ -9,7 +9,7 @@
9
9
  * SA's file may hold one quarter only: then compared_with is null, and no answer names a quarter it is compared with.
10
10
  *
11
11
  * From 0.16.0, Tasmania (postcodes, calculated by DwellDelta from the Department of Justice's bond records, private
12
- * housing only, tools.dwelldelta.com.au/market/tas-rents.json; CC BY 4.0 as data.gov.au lists it, the file's
12
+ * housing only, tools.dwelldelta.com.au/market/tas-rents.json; CC BY 4.0 as read on data.gov.au by DwellDelta's owner in a browser, the file's
13
13
  * licence_note). Its file is a MONTH's, not a quarter's: it has month and month_words and no quarter, so a Tasmanian
14
14
  * answer's quarter is null and it carries month and month_words, fields of its own (a released field keeps its
15
15
  * meaning: quarter is never a month). A suburb name its bonds were lodged under that month finds the whole postcode.
@@ -32,11 +32,12 @@ import { loadJson, envelope, ToolError, FOOTER, FETCH_TIMEOUT_MS, feedSource, CA
32
32
  figureFields, nWords, citeLine, staleNote, flagged, refusalMark, isRecord, passes, readChecked, quiet,
33
33
  warnPublished, fromCopy } from "./tools.mjs";
34
34
  import { quarterKey } from "./vic-rents-tool.mjs";
35
- import { rentPage, citeFields, withPlace, listedLicence, LISTED } from "./pages.mjs";
35
+ import { rentPage, citeFields, withPlace, listedLicence, LISTED, ALWAYS_CALCULATED, calculatedByUs } from "./pages.mjs";
36
36
  import { checkFetched, MAPS } from "./feed-text.mjs";
37
37
 
38
38
  const HERE = dirname(fileURLToPath(import.meta.url));
39
- const LIVE_DIR = join(HERE, "..", "..", "dwelldelta-data", "market");
39
+ // DWELLDELTA_LIVE_DIR: a test run on the owner's PC names an empty folder, so a file refused in the store cannot redden it.
40
+ const LIVE_DIR = process.env.DWELLDELTA_LIVE_DIR || join(HERE, "..", "..", "dwelldelta-data", "market");
40
41
  export const BUNDLED_DIR = join(HERE, "vendor");
41
42
  export const PUBLISHED_BASE = "https://tools.dwelldelta.com.au/market/";
42
43
  export const STATES = {
@@ -92,9 +93,27 @@ const wellFormed = (f, state) => f && f.state === state && periodKey(f, state) >
92
93
  && Array.isArray(f.areas) && f.areas.length > 0 && Array.isArray(f.councils) && Array.isArray(f.regions)
93
94
  && f.state_total && Array.isArray(f.limits) && f.licence && f.attribution && f.changes_made;
94
95
 
95
- /** One state's feed and where it came from ("env", "live", "published" or "bundled"); { feed: null } if none. */
96
- export async function loadAreaRents(state, { env = process.env, fetchImpl = globalThis.fetch, liveDir = LIVE_DIR,
97
- bundledDir = BUNDLED_DIR, warn = quiet } = {}) {
96
+ /** Where a loaded copy came from, in a warning's words. */
97
+ const ORIGIN_WORDS = { env: "the copy named by DWELLDELTA_STATE_RENTS_DIR", live: "the copy in the owner's store",
98
+ published: "the published copy", bundled: "the bundled copy" };
99
+
100
+ /**
101
+ * One state's feed and where it came from ("env", "live", "published" or "bundled"); { feed: null } if none. A
102
+ * Tasmanian or WA copy that answers without derived: true is still credited to DwellDelta (pages.mjs ALWAYS_CALCULATED),
103
+ * and warn says so in one line, as it says a refused copy (never stdout: on stdio that is the MCP channel).
104
+ */
105
+ export async function loadAreaRents(state, opts = {}) {
106
+ const loaded = await loadOneCopy(state, opts);
107
+ if (loaded.feed && ALWAYS_CALCULATED.has(state) && loaded.feed.derived !== true) {
108
+ (opts.warn ?? quiet)(`the ${STATES[state].name} rents feed: ${ORIGIN_WORDS[loaded.origin] ?? "the copy"} does not ` +
109
+ `say derived: true, but ${STATES[state].name}'s medians are always DwellDelta's calculation from bond records: ` +
110
+ "credited to DwellDelta");
111
+ }
112
+ return loaded;
113
+ }
114
+
115
+ async function loadOneCopy(state, { env = process.env, fetchImpl = globalThis.fetch, liveDir = LIVE_DIR,
116
+ bundledDir = BUNDLED_DIR, warn = quiet } = {}) {
98
117
  const { file } = STATES[state];
99
118
  const what = `the ${STATES[state].name} rents feed`;
100
119
  // A copy that is not this state's feed is no copy: the wrong file under the right name must never answer.
@@ -410,7 +429,8 @@ export function areaRentsResult({ state, area, council, dwelling_type, bedrooms,
410
429
  allRefused: res.structured.all_refused === true,
411
430
  // "Medians calculated by ..." where the answer gives more than one median; one median, or one given and the rest
412
431
  // refused (too few bonds), is "Median" (review of #105: counting places matched said "Medians" for one figure).
413
- calculated: feed.derived === true, several: res.structured.figures.filter((f) => !f.refusal).length > 1 });
432
+ // Tasmania's and WA's are always DwellDelta's, flag or none (pages.mjs ALWAYS_CALCULATED); others' by the flag.
433
+ calculated: calculatedByUs(state, feed), several: res.structured.figures.filter((f) => !f.refusal).length > 1 });
414
434
  if (councils.length) cite.pages = places.filter((p) => p.url).map((p) => ({ place: p.name, url: p.url }));
415
435
  const note = resolved?.note ?? null;
416
436
  return { text: withPlace(res.text, { note, ...cite }, FOOTER),
@@ -479,12 +499,13 @@ export function areaRentsResult({ state, area, council, dwelling_type, bedrooms,
479
499
  return finish({ text, structured: { ...env, state, state_name: info.name, area_kind: kind, quarter: feed.quarter ?? null,
480
500
  compared_with: feed.compared_with,
481
501
  // Tasmania (0.16.0): its month, and the state's breakdown (whole state only).
482
- // licence_note: where the licence was read (Tasmania: as data.gov.au lists it).
502
+ // licence_note: where the licence was read (Tasmania: by DwellDelta's owner, by hand).
483
503
  ...(monthly ? { month: feed.month, month_words: feed.month_words,
484
504
  licence_note: feed.licence_note ?? null,
485
505
  state_breakdown: breakdown ? { by_bedrooms: markRows(breakdown.by_bedrooms),
486
506
  by_dwelling_type: markRows(breakdown.by_dwelling_type) } : null } : {}),
487
- derived: feed.derived === true,
507
+ // derived: the medians are DwellDelta's own calculation, as cite_as says.
508
+ derived: calculatedByUs(state, feed),
488
509
  state_total: whole ? marked(feed.state_total) : null, regions: regions.map(marked),
489
510
  councils: councils.map(marked), areas: areas.map(marked),
490
511
  truncated: dropped.length > 0, limits: feed.limits, changes_made: feed.changes_made,
@@ -42,7 +42,7 @@ export function contributionList(nswSuburbs, places = JSON.parse(readFileSync(PL
42
42
  export const TERMS_URL = "https://tools.dwelldelta.com.au/terms/";
43
43
  export const PRIVACY_URL = "https://tools.dwelldelta.com.au/privacy/";
44
44
  export const TOKEN_MINUTES = 30;
45
- export const DELETE_BY = "lingtao@xcelerent.com";
45
+ export const DELETE_BY = "hello@dwelldelta.com.au";
46
46
 
47
47
  export const NOT_COLLECTING = "Contributions are not being collected yet, so nothing was stored or sent.";
48
48
  export const WHOSE_REFUSAL = "Only the user's own rent can be added: their own tenancy, or a property they own. " +
package/cover-tool.mjs CHANGED
@@ -34,7 +34,8 @@ import { SITE, slug } from "./pages.mjs";
34
34
  import { checkFetched } from "./feed-text.mjs";
35
35
 
36
36
  const HERE = dirname(fileURLToPath(import.meta.url));
37
- const LIVE_DIR = join(HERE, "..", "..", "dwelldelta-data", "market");
37
+ // DWELLDELTA_LIVE_DIR: a test run on the owner's PC names an empty folder, so a file refused in the store cannot redden it.
38
+ const LIVE_DIR = process.env.DWELLDELTA_LIVE_DIR || join(HERE, "..", "..", "dwelldelta-data", "market");
38
39
  const BUNDLED_DIR = join(HERE, "vendor");
39
40
  const PUBLISHED_BASE = "https://tools.dwelldelta.com.au/market/";
40
41
  export const NZ_FILE = "nz-rents.json";
@@ -166,11 +166,13 @@ const cited = { page_url: opt(nstr), cite_as: opt(nstr) };
166
166
 
167
167
  export const OUTPUT_SCHEMAS = {
168
168
  // result: the comparison - the ABS rents index's move from startUsed to latest, and the rent it tracks to. Every
169
- // field of it, and the limits, are the rent check's own (vendor/rent-check.mjs), not a data file's.
169
+ // field of it, and the limits, are the rent check's own (vendor/rent-check.mjs), not a data file's. leaseStart is
170
+ // lease_start as given, the month the lease began, and is there whenever lease_start is; rentSince (new, 2026-11-12) is
171
+ // rent_since as given, the month the current rent began, and is there only when it is. Neither stands for the other.
170
172
  rent_check: obj({
171
173
  ...envelope,
172
174
  result: obj({
173
- city: str, leaseStart: str, startUsed: str, latest: str, truncated: z.boolean(),
175
+ city: str, leaseStart: opt(str), rentSince: opt(str), startUsed: str, latest: str, truncated: z.boolean(),
174
176
  indexPct: z.number(), currentRent: z.number(), trackedRent: z.number(),
175
177
  proposedRent: opt(z.number()), proposedPct: opt(z.number()), gapPoints: opt(z.number()), gapDollars: opt(z.number()),
176
178
  }).nullable(),
@@ -219,7 +221,8 @@ export const OUTPUT_SCHEMAS = {
219
221
  // shown place with a page; cite_as, a line to quote with a figure from the answer.
220
222
  // Two kinds of answer: all dwellings together (state_total, regions, councils, areas), or by dwelling type and
221
223
  // bedrooms (asked, rows) - so the keys of each kind are optional. area_kind: postcode, suburb or locality, from the
222
- // file. derived: the medians are DwellDelta's own calculation from the bond records (WA). A row's figure is the
224
+ // file. derived: the medians are DwellDelta's own calculation from the bond records (WA and Tasmania: always true for
225
+ // both, whether or not the file still says so, pages.mjs ALWAYS_CALCULATED). A row's figure is the
223
226
  // publisher's cell, as the file gives it; null where none is published.
224
227
  area_rents: obj({
225
228
  ...envelope,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dwelldelta-mcp",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Australian rents by area for six states, New Zealand rents by council and region and interim ABS cover for the ACT and NT, asked by place with no state, a rent placed against its local median, NSW median sale prices, an ABS rents index check, and sourced property and lending indicators, for AI agents.",
5
5
  "mcpName": "au.com.dwelldelta/dwelldelta",
6
6
  "license": "MIT",
package/pages.mjs CHANGED
@@ -61,8 +61,8 @@ export function salePage(row) {
61
61
  }
62
62
 
63
63
  /**
64
- * What a cite_as line says, before its source, where the file's medians are DwellDelta's own calculation (the file says
65
- * derived: true - WA's, whose Government publishes one row per bond and no medians): without it, a line quoted alone
64
+ * What a cite_as line says, before its source, where the file's medians are DwellDelta's own calculation (WA's and
65
+ * Tasmania's, whose Governments publish one row per bond and no medians: calculatedByUs below): without it, a line quoted alone
66
66
  * would credit the publisher with DwellDelta's figure (owner, 2026-11-04: "fix the WA cite line"). The area pages'
67
67
  * "Cite as" line (tools/render-area-pages.mjs citeLine) says the same words.
68
68
  */
@@ -72,19 +72,38 @@ export const CALCULATED = "Median calculated by DwellDelta from bond records";
72
72
  export const CALCULATED_SEVERAL = "Medians calculated by DwellDelta from bond records";
73
73
 
74
74
  /**
75
- * A licence read where the data is listed, not on the publisher's own page (Tasmania, from 0.16.0: data.gov.au refuses
76
- * DwellDelta's reader): the cite_as line says so after the licence, as the area pages' Cite as line does
77
- * (render-area-pages.mjs LISTED, held to this by tests/mcp-pages.test.mjs).
75
+ * The states whose rents medians are always DwellDelta's own calculation, whatever the file's flags say: Tasmania's
76
+ * Department of Justice and Western Australia's Department of Mines, Industry Regulation and Safety publish one row per
77
+ * bond and no medians (dwelldelta-local tools/macro/tas_rents.py and wa_rents.py), so every median in tas-rents.json and
78
+ * wa-rents.json is DwellDelta's. The same set as the area pages' ALWAYS_CALCULATED (tools/render-area-pages.mjs, tools
79
+ * #175 and #176); this package is published on its own and cannot import it, so tests/mcp-pages.test.mjs holds the two
80
+ * sets equal. A file of one of these states that lost its derived: true is still credited to DwellDelta (the safe
81
+ * default: a line never credits the Department with DwellDelta's median), and the loader says so in one line to its
82
+ * warn (area-rents-tool.mjs loadAreaRents).
78
83
  */
79
- export const LISTED = { TAS: "as data.gov.au lists it" };
84
+ export const ALWAYS_CALCULATED = new Set(["TAS", "WA"]);
85
+ /**
86
+ * Whether a state's rents medians are DwellDelta's own calculation: a state in ALWAYS_CALCULATED, or a file that says
87
+ * derived: true. What an answer's cite_as says before its source, and its derived field: who calculated the medians.
88
+ */
89
+ export const calculatedByUs = (state, feed) => ALWAYS_CALCULATED.has(state) || feed?.derived === true;
90
+
91
+ /**
92
+ * A licence DwellDelta's reader could not read, so a person read it by hand (Tasmania, from 0.16.0: data.gov.au refuses
93
+ * DwellDelta's reader; until 2026-11-08 the licence was "as data.gov.au lists it", read in a search result, and on
94
+ * 2026-11-08 DwellDelta's owner read it on the dataset's page in a browser): the cite_as line says where and how the
95
+ * licence was read, after the licence, as the area pages' Cite as line does (render-area-pages.mjs LISTED, held to this
96
+ * by tests/mcp-pages.test.mjs). It never claims an automated read.
97
+ */
98
+ export const LISTED = { TAS: "as read on data.gov.au by DwellDelta's owner in a browser" };
80
99
  export const listedLicence = (state, licence) => (licence && LISTED[state] ? `${licence} ${LISTED[state]}` : licence);
81
100
 
82
101
  /**
83
102
  * The fields an answer gains (new in 0.12.0; no earlier field changes): page_url, the one page for the answer (the
84
103
  * place's own when one place is shown, the state's when the state's own figure is), else null; pages, every shown
85
104
  * place that has a page; cite_as, a line to quote with a figure from the answer - null when the answer gives no
86
- * figure to quote (every one refused, allRefused: review of #74). calculated: the file's medians are DwellDelta's
87
- * (CALCULATED is said before the source, or CALCULATED_SEVERAL where the answer gives more than one median, several;
105
+ * figure to quote (every one refused, allRefused: review of #74). calculated: the medians are DwellDelta's
106
+ * (calculatedByUs; CALCULATED is said before the source, or CALCULATED_SEVERAL where the answer gives more than one median, several;
88
107
  * from 0.16.0).
89
108
  */
90
109
  export function citeFields({ state, places, whole, what, period, by, licence, allRefused = false, calculated = false,
@@ -79,13 +79,25 @@ export const SERVER_INSTRUCTIONS = "DwellDelta answers Australian property quest
79
79
  "no state needed; area_rents one known state of NSW, Queensland, WA, SA or Tasmania - its own figure, a council " +
80
80
  "(NSW, QLD), or part of a name (QLD, WA, SA, TAS); vic_rents Victoria's regions and suburb groups; rent_check a given rent. " +
81
81
  PLACE_INSTRUCTIONS;
82
- export const guard = (fn) => async (args) => {
82
+ /**
83
+ * Where an unexpected error tells the caller to report it: hello@dwelldelta.com.au for both servers. The hosted
84
+ * server has given it since 2026-11-10 (owner, T6 of tools #36's follow-ups); the npm package (the stdio server) from
85
+ * 0.17.0, its own release (owner, 2026-11-12), when it stopped giving the owner's own address. The two keys stay so a
86
+ * test can hold each server's text on its own (mcp/test/hosted-contact.test.mjs).
87
+ */
88
+ export const REPORT_TO = Object.freeze({ local: "hello@dwelldelta.com.au", hosted: "hello@dwelldelta.com.au" });
89
+ const guardTo = (address) => (fn) => async (args) => {
83
90
  try {
84
91
  return ok(await fn(args));
85
92
  } catch (err) {
86
- return fail(err instanceof ToolError ? err : new ToolError(err.message, "Report this to lingtao@xcelerent.com."));
93
+ return fail(err instanceof ToolError ? err : new ToolError(err.message, `Report this to ${address}.`));
87
94
  }
88
95
  };
96
+ /** A handler's answer, or its error as an MCP error result: the stdio server's, naming REPORT_TO.local. */
97
+ export const guard = guardTo(REPORT_TO.local);
98
+ const localGuard = guard;
99
+ /** The same, for the hosted server (registerReadOnlyTools with hosted: true), naming REPORT_TO.hosted. */
100
+ export const hostedGuard = guardTo(REPORT_TO.hosted);
89
101
  /**
90
102
  * rent_check's inputs in the shapes agents send them (2026-11-03: the hosted logs held 4 of 4 genuine rent_check
91
103
  * calls refused; the logs keep no arguments, so the cause is inferred - a lower-case city, a rent sent as text, a
@@ -165,9 +177,13 @@ export function readMonth(v) {
165
177
  }
166
178
  return v;
167
179
  }
168
- export const MONTH_REFUSAL = "lease_start is the month the lease began, as \"2024-03\" (YYYY-MM), \"2024-03-01\" " +
180
+ const monthRefusal = (field, what) => `${field} is ${what}, as "2024-03" (YYYY-MM), "2024-03-01" ` +
169
181
  "(YYYY-MM-DD, a real date; its month is used) or \"March 2024\" (a month's name or its first three letters, then " +
170
182
  "the year).";
183
+ export const MONTH_REFUSAL = monthRefusal("lease_start", "the month the lease began");
184
+ // rent_since (2026-11-12): a field of its own, so lease_start keeps the meaning it was released with.
185
+ export const RENT_SINCE_REFUSAL = monthRefusal("rent_since", "the month the current rent began (the last rent rise, " +
186
+ "or the lease start if the rent has not risen)");
171
187
 
172
188
  /** An answer with a first line naming the arguments it did not use, and why (0.12.0, rent_check's two modes). */
173
189
  const ignoring = (res, keys, why) => (keys.length ? { text: `Not used: ${keys.join(", ")} (${why}).\n${res.text}`,
@@ -252,6 +268,8 @@ const BY_TYPE_LATE = Symbol("by-type files not loaded in time");
252
268
  export function registerReadOnlyTools(server, data, { byTypeWaitMs = null, hosted = false } = {}) {
253
269
  const { rents, suburbs, snapshot, vic, areaRents, rentsByType, nswSales } = data;
254
270
  const refused = data.refused ?? {};
271
+ // The hosted server's errors give its own contact address (REPORT_TO); every tool below, property_rents included.
272
+ const guard = hosted ? hostedGuard : localGuard;
255
273
  const needSnapshot = () => {
256
274
  if (!snapshot && refused.snapshot) {
257
275
  throw new ToolError(`The indicators snapshot could not be used: ${refused.snapshot} failed the check of the file.`,
@@ -269,21 +287,20 @@ export function registerReadOnlyTools(server, data, { byTypeWaitMs = null, hoste
269
287
 
270
288
  server.registerTool("rent_check", titled({
271
289
  title: "Australian rent check",
272
- description: "Compares a weekly rent, and any proposed new rent, with how the ABS rents index for the tenant's " +
273
- "Australian capital city has moved since the lease began. city is one of the eight capital cities, whose " +
274
- "index is city-wide, not suburb-level. The answer is information, not advice, and carries the months " +
275
- "compared, the source and the index's limits. Without lease_start, place (a suburb, locality or postcode in " +
276
- "NSW, VIC, QLD, WA, SA or TAS) gives instead where the rent sits against that place's median of new bonds, and " +
277
- "between its quartiles where the publisher gives them.",
290
+ description: "Compares a weekly rent, and any proposed rent, with how the ABS rents index for the tenant's capital " +
291
+ "city has moved since rent_since, else lease_start: city-wide, not suburb-level. Information, not advice, with " +
292
+ "the months compared, the source and the limits. Without either month, place (in NSW, VIC, QLD, WA, SA or TAS) " +
293
+ "places the rent against its median of new bonds, and its quartiles where published.",
278
294
  inputSchema: {
279
295
  // Each is read through z.preprocess (readCity, readMonth, readRent above): tools/list still declares the
280
296
  // canonical form, byte for byte (current_rent's description sits inside, where it keeps its place in the JSON
281
297
  // Schema), and the handler still receives it; the refusals name every form that is read.
282
- city: z.preprocess(readCity(cities), z.enum(cities, { error: cityRefusal(cities) })).optional().describe("Capital city whose ABS rents index the rent is compared with (with lease_start)"),
298
+ city: z.preprocess(readCity(cities), z.enum(cities, { error: cityRefusal(cities) })).optional().describe("Capital city whose ABS rents index the rent is compared with"),
283
299
  lease_start: z.preprocess(readMonth, z.string({ error: MONTH_REFUSAL }).regex(/^\d{4}-(0[1-9]|1[0-2])$/, { error: MONTH_REFUSAL })).optional().describe("Month the lease began, YYYY-MM"),
300
+ rent_since: z.preprocess(readMonth, z.string({ error: RENT_SINCE_REFUSAL }).regex(/^\d{4}-(0[1-9]|1[0-2])$/, { error: RENT_SINCE_REFUSAL })).optional().describe("Month current rent began (last rise, else lease start), YYYY-MM"),
284
301
  current_rent: z.preprocess(readRent, z.number({ error: rentRefusal("current_rent") }).positive({ error: rentRefusal("current_rent") }).describe("Current weekly rent in Australian dollars")),
285
- proposed_rent: z.preprocess(readRent, z.number({ error: rentRefusal("proposed_rent") }).positive({ error: rentRefusal("proposed_rent") })).optional().describe("Proposed new weekly rent in Australian dollars"),
286
- place: z.string().optional().describe("Without lease_start: a suburb, locality or postcode; a state may follow (\"Richmond, VIC\")"),
302
+ proposed_rent: z.preprocess(readRent, z.number({ error: rentRefusal("proposed_rent") }).positive({ error: rentRefusal("proposed_rent") })).optional().describe("Proposed weekly rent in Australian dollars"),
303
+ place: z.string().optional().describe("Without either month: a suburb, locality or postcode; a state may follow (\"Richmond, VIC\")"),
287
304
  dwelling_type: z.string().optional().describe("With place: as area_rents (NSW and QLD only)"),
288
305
  bedrooms: z.string().optional().describe("With place: as area_rents (NSW and QLD only)"),
289
306
  },
@@ -291,15 +308,19 @@ export function registerReadOnlyTools(server, data, { byTypeWaitMs = null, hoste
291
308
  annotations: readOnly,
292
309
  }), guard(async (args) => {
293
310
  // With lease_start: the city-wide index check, as it has been since 0.1.0. Without it: the local mode (0.12.0).
294
- if (args.lease_start != null) {
311
+ // rent_since (2026-11-12) opens the same check; given, it is the month compared from (rentCheckResult).
312
+ if (args.lease_start != null || args.rent_since != null) {
313
+ // The month fields given, in words; with lease_start alone, "lease_start", so its answers are as they were.
314
+ const given = [args.rent_since != null ? "rent_since" : null, args.lease_start != null ? "lease_start" : null]
315
+ .filter(Boolean).join(" and ");
295
316
  if (args.city == null) {
296
- throw new ToolError("rent_check with lease_start needs city: the ABS rents index is by capital city.",
297
- `Give city (${Object.keys(rents.cities).sort().join(", ")}), or leave lease_start out and give place for ` +
317
+ throw new ToolError(`rent_check with ${given} needs city: the ABS rents index is by capital city.`,
318
+ `Give city (${Object.keys(rents.cities).sort().join(", ")}), or leave ${given} out and give place for ` +
298
319
  "the local median of new bonds.");
299
320
  }
300
321
  // An argument of the other mode is said to be unused, never silently dropped.
301
322
  return ignoring(rentCheckResult(args, rents), ["place", "dwelling_type", "bedrooms"].filter((k) => args[k] != null),
302
- "with lease_start, the rent is compared with the city's ABS rents index; leave lease_start out for the place's " +
323
+ `with ${given}, the rent is compared with the city's ABS rents index; leave ${given} out for the place's ` +
303
324
  "median of new bonds");
304
325
  }
305
326
  if (args.place == null || !String(args.place).trim()) {
@@ -368,7 +389,7 @@ export function registerReadOnlyTools(server, data, { byTypeWaitMs = null, hoste
368
389
  "Tenancies Authority), WA by locality (calculated by DwellDelta from the Government of Western Australia's bond " +
369
390
  "records), SA by suburb (SA Housing Trust, Private Rent Report; its page states no licence, the catalogues " +
370
391
  "list CC BY), TAS by postcode (calculated by DwellDelta from Department of Justice bond records, private " +
371
- "housing; licence as data.gov.au lists it); SA and TAS hold one period, so no change on a year. Each file " +
392
+ "housing; licence read on data.gov.au by DwellDelta's owner in a browser); SA and TAS hold one period, so no change on a year. Each file " +
372
393
  "states CC BY 4.0. The figures are new-bond medians, not advertised rents. Each state measures in its own way: " +
373
394
  "the states are not one series, and their figures cannot be added or compared as one. Each answer states its " +
374
395
  "period, its source line " +