@leadbay/mcp 0.35.2 → 0.37.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/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Changelog — @leadbay/mcp
2
2
 
3
+ ## 0.37.0 — 2026-09-08
4
+
5
+ Expose the backend MCP-first delivery endpoints (`POST /1.6/mcp/search`,
6
+ `POST /1.6/mcp/qualify`, `GET /1.6/mcp/jobs/{id}`) as three composites —
7
+ `leadbay_find_new_leads`, `leadbay_qualify_leads`, `leadbay_lead_job_status` —
8
+ plus the `leadbay_new_leads` guided prompt. One ask → net-new qualified
9
+ contactable leads, replacing the pull→select→web_fetch→poll→enrich chain.
10
+
11
+ Free by default (`qualify: false`, no `channels`). Any paid call is withheld
12
+ until `confirm: true` and returns a real backend quote instead; `confirm: false`
13
+ vetoes with no round-trip. A derived `request_id` makes a retried paid batch
14
+ return the same job rather than double-charge, and `max_cost` stops the job with
15
+ `stop_reason: "max_cost"`.
16
+
17
+ The `LEADBAY_MCP_LEAD_DELIVERY` rollout flag introduced with these tools is
18
+ retired: the routes shipped to production in backend v3.22.0 (2026-08-22) and
19
+ were verified live on `api-us` and `api-fr`. The `leadbay_new_leads` prompt is
20
+ still hidden on a read-only server (`LEADBAY_MCP_WRITE=0`), since every phase of
21
+ it calls a write-tier tool.
22
+
23
+ ## 0.36.0 — 2026-09-08
24
+
25
+ The OpenAI submission form flags every tool without an `outputSchema`
26
+ ("Recommended: Add an outputSchema so models can better understand this tool's
27
+ results"). 43 of the 58 tools on `/chatgpt/mcp` already had one. This adds four
28
+ of the remaining 15:
29
+
30
+ - `leadbay_account_history`, `leadbay_team_activity` — rich nested payloads the
31
+ model previously had to infer from prose.
32
+ - `leadbay_getting_started`, `leadbay_artifact_kit` — static manifests; cheap to
33
+ declare, and both are consumed programmatically.
34
+
35
+ Each gets a real entry in `output-schema-conformance.test.ts` CASES, not an
36
+ OPT_OUT: a mocked happy-path round-trip whose structuredContent is asserted
37
+ against the schema. Mutation-checked — renaming `trend` in the team_activity
38
+ schema fails with `$.trend: return contains key not declared in
39
+ outputSchema.properties (drift)`.
40
+
41
+ A local Codex review of this branch found three real defects in the first pass,
42
+ all fixed here:
43
+
44
+ - `account_history` declared `signals` as an object. `research_lead_by_id`,
45
+ whose payload it passes straight through, declares it an **array**. The
46
+ conformance walk checks required keys and undeclared keys, not types, so it
47
+ did not catch this.
48
+ - The `account_history` conformance case under-mocked the fan-out. It never
49
+ mocked `/leads/{id}/contacts?IncludeEnriched=true`, and gave one generic
50
+ `/activities` script for the two reads that happen (research's `count=20`,
51
+ then the tool's own `count=<n>`). The harness consumes a script once, so the
52
+ second read rejected, `.catch()`ed to empty, and the case asserted a degraded
53
+ timeline while staying schema-conformant. Proven: with the old mocks the new
54
+ `account-history-full-fanout.test.ts` fails `expected [] to have a length of
55
+ 1`.
56
+ - `artifact_kit`'s schema omitted `_meta`. `buildServer` injects
57
+ `_meta.update_available` / `_meta.notifications` into successful object
58
+ results before setting `structuredContent`, so it is a real top-level key at
59
+ runtime. The other three declared it.
60
+
61
+ Two deliberate limits:
62
+
63
+ - **`leadbay_list_sectors` is excluded.** It returns a bare array, and
64
+ `server.ts` only emits `structuredContent` for plain objects, so a schema
65
+ there would promise a payload the server never sends. Making it honest means
66
+ changing the return to an object, which breaks existing callers.
67
+ - On `account_history`, the blobs passed through verbatim from
68
+ `research_lead_by_id` (`signals`, `firmographics`, `contacts`, `engagement`)
69
+ are declared as bare objects with no `properties`. The conformance walk only
70
+ recurses into declared object-properties that carry their own `properties`,
71
+ so research can grow a field without breaking this tool.
72
+
73
+ The remaining 10 tools without a schema are write acknowledgements
74
+ (`pin_contact`, `like_lead`, `set_telemetry`, …). A schema for `{ok:true}`
75
+ teaches the model nothing; left alone on purpose.
76
+
3
77
  ## 0.35.2 — 2026-09-08
4
78
 
5
79
  A backend `bad_request` 400 is now `BAD_INPUT` (product#4085).