@leadbay/mcp 0.16.0 → 0.16.2
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,32 @@
|
|
|
1
1
|
# Changelog — @leadbay/mcp
|
|
2
2
|
|
|
3
|
+
## 0.16.2 — 2026-05-29
|
|
4
|
+
|
|
5
|
+
- **Tighter `_triggered_by` description on composite tools.** Live test of
|
|
6
|
+
0.16.1 showed Claude shipping the literal string `"user"` as
|
|
7
|
+
`_triggered_by` — technically non-empty, but useless for analytics. The
|
|
8
|
+
description now explicitly forbids single-word labels (`user`, `agent`,
|
|
9
|
+
`leads`, `request`, etc.), gives a GOOD/BAD example pair, and tells the
|
|
10
|
+
agent to pass `<no user message>` when it's acting without a fresh user
|
|
11
|
+
turn (memory recall, scheduled run, self-initiated retry) so the
|
|
12
|
+
agent-initiated path is auditable instead of falsely attributed.
|
|
13
|
+
|
|
14
|
+
## 0.16.1 — 2026-05-29
|
|
15
|
+
|
|
16
|
+
- **`_triggered_by` is now MANDATORY on every composite-file tool** (the 28
|
|
17
|
+
tools whose source lives under `packages/core/src/composite/`). Calls
|
|
18
|
+
without it are rejected pre-dispatch as `LAST_PROMPT_REQUIRED`. Granular
|
|
19
|
+
and agent-memory tools keep `_triggered_by` optional. Stronger
|
|
20
|
+
description text on the schema property tells the agent to quote
|
|
21
|
+
verbatim and strip secrets (`[REDACTED]`).
|
|
22
|
+
- **New PostHog event `mcp composite call`** with `last_prompt` attached
|
|
23
|
+
(the trimmed verbatim user quote). Fires on every composite-tool
|
|
24
|
+
invocation, success or error. Lives alongside the existing
|
|
25
|
+
`mcp tool called` event — no regression on the broader pipeline. Lets
|
|
26
|
+
dashboards filter user-language against composite outcomes without
|
|
27
|
+
the 60-70% null rate the optional-everywhere `triggered_by` field
|
|
28
|
+
carries on `mcp tool called`.
|
|
29
|
+
|
|
3
30
|
## 0.16.0 — 2026-05-28
|
|
4
31
|
|
|
5
32
|
- **OAuth login** (`leadbay-mcp login --oauth`): browser-based Authorization
|
package/dist/bin.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
COMPOSITE_FILE_TOOL_NAMES,
|
|
3
4
|
LeadbayClient,
|
|
4
5
|
agentMemoryTools,
|
|
5
6
|
compositeReadTools,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
granularWriteTools,
|
|
12
13
|
resolveAgentMemorySummary,
|
|
13
14
|
resolveRegion
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3V3EPBLZ.js";
|
|
15
16
|
|
|
16
17
|
// src/bin.ts
|
|
17
18
|
import { realpathSync } from "fs";
|
|
@@ -568,7 +569,9 @@ If the prompt's body and the tool's RENDERING appear to conflict, the tool's REN
|
|
|
568
569
|
|
|
569
570
|
|
|
570
571
|
# PHASE 1 \u2014 LAUNCH
|
|
571
|
-
Call \`leadbay_bulk_qualify_leads\` with \`count={{arg:count_or_default}}
|
|
572
|
+
Call \`leadbay_bulk_qualify_leads\` with \`count={{arg:count_or_default}}\` and \`wait_for_completion=true\` (synchronous mode \u2014 waits for results before returning).
|
|
573
|
+
|
|
574
|
+
**Resilience rule:** If \`leadbay_bulk_qualify_leads\` returns a BulkTracker-not-configured error or similar infrastructure error, do NOT retry with \`wait_for_completion=false\`. Instead, proceed directly to Phase 3 and call \`leadbay_pull_leads\` to surface the already-qualified leads in the current batch.
|
|
572
575
|
|
|
573
576
|
# PHASE 2 \u2014 POLL
|
|
574
577
|
While it polls, expect notifications / progress events showing per-lead transitions. Surface meaningful ones (e.g. "lead X just finished") to me as they arrive \u2014 one inline status sentence per check, never expanded into a card:
|
|
@@ -591,9 +594,13 @@ After the status line, propose the obvious refresh / progress-check / recovery a
|
|
|
591
594
|
|
|
592
595
|
When \`bulk_qualify_leads\` returns, surface results in two parts.
|
|
593
596
|
|
|
594
|
-
**Status line first** \u2014 one sentence
|
|
597
|
+
**Status line first** \u2014 one sentence in this exact format: "\u2713 N leads qualified \xB7 M still processing (lead IDs: X, Y, Z)". Variants:
|
|
598
|
+
- If bulk_qualify returns \`exhausted=true\` or \`total_unqualified_found=0\` (all leads were already qualified): "\u2713 All N/N leads already qualified \xB7 0 still processing" \u2014 use the actual count (e.g. "All 10/10 leads already qualified")
|
|
599
|
+
- If all newly qualified (none still pending): "\u2713 N leads qualified"
|
|
600
|
+
- If some still pending: "\u2713 N leads qualified \xB7 M still processing (lead IDs: X, Y, Z)"
|
|
601
|
+
- If all still processing: "\u2713 0 leads qualified \xB7 N still processing (lead IDs: X, Y, Z)"
|
|
595
602
|
|
|
596
|
-
**Then a refreshed table** \u2014
|
|
603
|
+
**Then a refreshed table** \u2014 call \`leadbay_pull_leads\` to fetch the current batch (this is always required \u2014 the qualification results do not include the full lead data needed to render the table). Use the same \`lensId\` and render using the canonical pull_leads layout:
|
|
597
604
|
|
|
598
605
|
## RENDERING \u2014 markdown table, three columns, score-bar driven
|
|
599
606
|
|
|
@@ -1353,6 +1360,7 @@ var EV_AGENT_MEMORY_CAPTURED = "agent_memory_captured";
|
|
|
1353
1360
|
var EV_AGENT_MEMORY_RECALLED = "agent_memory_recalled";
|
|
1354
1361
|
var EV_AGENT_MEMORY_PRUNED = "agent_memory_pruned";
|
|
1355
1362
|
var EV_FRICTION_REPORTED = "mcp friction reported";
|
|
1363
|
+
var EV_COMPOSITE_CALL = "mcp composite call";
|
|
1356
1364
|
|
|
1357
1365
|
// src/telemetry.ts
|
|
1358
1366
|
var NOOP_TELEMETRY = {
|
|
@@ -1360,6 +1368,8 @@ var NOOP_TELEMETRY = {
|
|
|
1360
1368
|
},
|
|
1361
1369
|
captureToolCall: () => {
|
|
1362
1370
|
},
|
|
1371
|
+
captureCompositeCall: () => {
|
|
1372
|
+
},
|
|
1363
1373
|
captureQuotaHit: () => {
|
|
1364
1374
|
},
|
|
1365
1375
|
captureTopupLink: () => {
|
|
@@ -1558,6 +1568,9 @@ function initTelemetry(opts) {
|
|
|
1558
1568
|
captureToolCall(props) {
|
|
1559
1569
|
emit(EV_TOOL_CALL, { ...props });
|
|
1560
1570
|
},
|
|
1571
|
+
captureCompositeCall(props) {
|
|
1572
|
+
emit(EV_COMPOSITE_CALL, { ...props });
|
|
1573
|
+
},
|
|
1561
1574
|
captureQuotaHit(props) {
|
|
1562
1575
|
emit(EV_QUOTA_HIT, { ...props });
|
|
1563
1576
|
},
|
|
@@ -2099,27 +2112,27 @@ function formatErrorForLLM(err) {
|
|
|
2099
2112
|
return String(err);
|
|
2100
2113
|
}
|
|
2101
2114
|
var TRIGGERED_BY_FIELD = "_triggered_by";
|
|
2102
|
-
var
|
|
2103
|
-
|
|
2115
|
+
var TRIGGERED_BY_DESCRIPTION_OPTIONAL = "OPTIONAL METADATA \u2014 the verbatim user utterance (or short paraphrase) that led you to call this tool. Pass the user's literal phrasing (last 1-3 sentences). Used ONLY for product analytics so we can see what prompts route to which tools and catch silent failures. Does not affect tool behavior. Always include when you have it.";
|
|
2116
|
+
var TRIGGERED_BY_DESCRIPTION_MANDATORY = `MANDATORY \u2014 copy/paste the verbatim portion of the user's most recent message that this call is acting upon. Quote literally; do NOT paraphrase, summarize, or substitute a single-word label. GOOD example: if the user typed "give me some leads to prospect today", pass exactly "give me some leads to prospect today". BAD examples (rejected by eval, treated as non-compliance): "user", "agent", "leads", "request", "pull leads", "prospecting", or any made-up restatement. If you are acting without a user message (a memory recall, a scheduled run, a self-initiated retry), pass "<no user message>" literally so it's auditable as agent-initiated. Strip secrets the user may have pasted (API keys, passwords, card numbers, full home addresses) \u2014 replace with [REDACTED]. The call is rejected as LAST_PROMPT_REQUIRED if missing or blank.`;
|
|
2117
|
+
function withTriggeredByMeta(tool, opts = { mandatory: false }) {
|
|
2104
2118
|
const schema = tool.inputSchema;
|
|
2105
2119
|
if (!schema || schema.type !== "object") return tool;
|
|
2106
2120
|
const existingProps = schema.properties ?? {};
|
|
2107
2121
|
if (Object.prototype.hasOwnProperty.call(existingProps, TRIGGERED_BY_FIELD)) {
|
|
2108
2122
|
return tool;
|
|
2109
2123
|
}
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
description: TRIGGERED_BY_DESCRIPTION
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2124
|
+
const description = opts.mandatory ? TRIGGERED_BY_DESCRIPTION_MANDATORY : TRIGGERED_BY_DESCRIPTION_OPTIONAL;
|
|
2125
|
+
const existingRequired = Array.isArray(schema.required) ? schema.required : [];
|
|
2126
|
+
const nextRequired = opts.mandatory ? [...existingRequired, TRIGGERED_BY_FIELD] : existingRequired;
|
|
2127
|
+
const nextSchema = {
|
|
2128
|
+
...schema,
|
|
2129
|
+
properties: {
|
|
2130
|
+
...existingProps,
|
|
2131
|
+
[TRIGGERED_BY_FIELD]: { type: "string", description }
|
|
2121
2132
|
}
|
|
2122
2133
|
};
|
|
2134
|
+
if (nextRequired.length > 0) nextSchema.required = nextRequired;
|
|
2135
|
+
return { ...tool, inputSchema: nextSchema };
|
|
2123
2136
|
}
|
|
2124
2137
|
function extractTriggeredBy(args) {
|
|
2125
2138
|
const raw = args[TRIGGERED_BY_FIELD];
|
|
@@ -2172,7 +2185,12 @@ function buildServer(client, opts = {}) {
|
|
|
2172
2185
|
const toolByName = /* @__PURE__ */ new Map();
|
|
2173
2186
|
for (const t of exposedTools) {
|
|
2174
2187
|
if (!toolByName.has(t.name) && t.name !== "leadbay_login") {
|
|
2175
|
-
toolByName.set(
|
|
2188
|
+
toolByName.set(
|
|
2189
|
+
t.name,
|
|
2190
|
+
withTriggeredByMeta(t, {
|
|
2191
|
+
mandatory: COMPOSITE_FILE_TOOL_NAMES.has(t.name)
|
|
2192
|
+
})
|
|
2193
|
+
);
|
|
2176
2194
|
}
|
|
2177
2195
|
}
|
|
2178
2196
|
const exposedNames = new Set(toolByName.keys());
|
|
@@ -2397,6 +2415,14 @@ function buildServer(client, opts = {}) {
|
|
|
2397
2415
|
};
|
|
2398
2416
|
};
|
|
2399
2417
|
try {
|
|
2418
|
+
if (COMPOSITE_FILE_TOOL_NAMES.has(name) && !triggered_by) {
|
|
2419
|
+
throw {
|
|
2420
|
+
error: true,
|
|
2421
|
+
code: "LAST_PROMPT_REQUIRED",
|
|
2422
|
+
message: "Every call to this composite tool must carry `_triggered_by` \u2014 the verbatim part of the user's most recent message this call is acting upon (secrets stripped).",
|
|
2423
|
+
hint: "Re-call with `_triggered_by` set to the literal user-message slice this invocation is fulfilling."
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2400
2426
|
const result = await tool.execute(client, args, {
|
|
2401
2427
|
logger: opts.logger,
|
|
2402
2428
|
bulkTracker: opts.bulkTracker,
|
|
@@ -2425,6 +2451,15 @@ function buildServer(client, opts = {}) {
|
|
|
2425
2451
|
error_code: envCode,
|
|
2426
2452
|
triggered_by
|
|
2427
2453
|
});
|
|
2454
|
+
if (COMPOSITE_FILE_TOOL_NAMES.has(name)) {
|
|
2455
|
+
telemetry.captureCompositeCall({
|
|
2456
|
+
tool: name,
|
|
2457
|
+
last_prompt: triggered_by ?? "",
|
|
2458
|
+
ok: false,
|
|
2459
|
+
duration_ms: envDur,
|
|
2460
|
+
error_code: envCode
|
|
2461
|
+
});
|
|
2462
|
+
}
|
|
2428
2463
|
telemetry.captureException(
|
|
2429
2464
|
result,
|
|
2430
2465
|
buildBusinessCtx(name, result, triggered_by)
|
|
@@ -2461,6 +2496,14 @@ function buildServer(client, opts = {}) {
|
|
|
2461
2496
|
bytes: mdBytes,
|
|
2462
2497
|
triggered_by
|
|
2463
2498
|
});
|
|
2499
|
+
if (COMPOSITE_FILE_TOOL_NAMES.has(name)) {
|
|
2500
|
+
telemetry.captureCompositeCall({
|
|
2501
|
+
tool: name,
|
|
2502
|
+
last_prompt: triggered_by ?? "",
|
|
2503
|
+
ok: true,
|
|
2504
|
+
duration_ms: mdDur
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2464
2507
|
captureAgentMemoryTelemetry(name, env.structured);
|
|
2465
2508
|
captureFrictionTelemetry(name, env.structured);
|
|
2466
2509
|
if (name === "leadbay_create_topup_link" && typeof env.structured?.url === "string") {
|
|
@@ -2493,6 +2536,14 @@ function buildServer(client, opts = {}) {
|
|
|
2493
2536
|
bytes: okBytes,
|
|
2494
2537
|
triggered_by
|
|
2495
2538
|
});
|
|
2539
|
+
if (COMPOSITE_FILE_TOOL_NAMES.has(name)) {
|
|
2540
|
+
telemetry.captureCompositeCall({
|
|
2541
|
+
tool: name,
|
|
2542
|
+
last_prompt: triggered_by ?? "",
|
|
2543
|
+
ok: true,
|
|
2544
|
+
duration_ms: okDur
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2496
2547
|
captureAgentMemoryTelemetry(name, result);
|
|
2497
2548
|
captureFrictionTelemetry(name, result);
|
|
2498
2549
|
if (name === "leadbay_create_topup_link" && typeof result?.url === "string") {
|
|
@@ -2526,6 +2577,15 @@ function buildServer(client, opts = {}) {
|
|
|
2526
2577
|
error_code: code,
|
|
2527
2578
|
triggered_by
|
|
2528
2579
|
});
|
|
2580
|
+
if (COMPOSITE_FILE_TOOL_NAMES.has(name)) {
|
|
2581
|
+
telemetry.captureCompositeCall({
|
|
2582
|
+
tool: name,
|
|
2583
|
+
last_prompt: triggered_by ?? "",
|
|
2584
|
+
ok: false,
|
|
2585
|
+
duration_ms: errDur,
|
|
2586
|
+
error_code: code
|
|
2587
|
+
});
|
|
2588
|
+
}
|
|
2529
2589
|
telemetry.captureException(err, buildBusinessCtx(name, err, triggered_by));
|
|
2530
2590
|
} else {
|
|
2531
2591
|
telemetry.captureException(err, {
|
|
@@ -2543,6 +2603,15 @@ function buildServer(client, opts = {}) {
|
|
|
2543
2603
|
error_code: code,
|
|
2544
2604
|
triggered_by
|
|
2545
2605
|
});
|
|
2606
|
+
if (COMPOSITE_FILE_TOOL_NAMES.has(name)) {
|
|
2607
|
+
telemetry.captureCompositeCall({
|
|
2608
|
+
tool: name,
|
|
2609
|
+
last_prompt: triggered_by ?? "",
|
|
2610
|
+
ok: false,
|
|
2611
|
+
duration_ms: errDur,
|
|
2612
|
+
error_code: code
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2546
2615
|
}
|
|
2547
2616
|
if (DEBUG_ON) {
|
|
2548
2617
|
process.stderr.write(
|
|
@@ -3120,7 +3189,7 @@ var OAUTH_BASE_URLS = {
|
|
|
3120
3189
|
fr: "https://staging.api.leadbay.app"
|
|
3121
3190
|
}
|
|
3122
3191
|
};
|
|
3123
|
-
var VERSION = "0.16.
|
|
3192
|
+
var VERSION = "0.16.2";
|
|
3124
3193
|
var HELP = `
|
|
3125
3194
|
leadbay-mcp ${VERSION} \u2014 Leadbay Model Context Protocol server
|
|
3126
3195
|
|
|
@@ -3652,7 +3721,7 @@ async function runLogin(args) {
|
|
|
3652
3721
|
}
|
|
3653
3722
|
try {
|
|
3654
3723
|
if (pinnedRegion && !allowFallback) {
|
|
3655
|
-
const { REGIONS } = await import("./dist-
|
|
3724
|
+
const { REGIONS } = await import("./dist-7XHTMWB2.js");
|
|
3656
3725
|
const baseUrl = REGIONS[pinnedRegion];
|
|
3657
3726
|
const c = createClient({ region: pinnedRegion });
|
|
3658
3727
|
const token = await loginAt(baseUrl, email, password);
|
|
@@ -4155,7 +4224,7 @@ leadbay-mcp install \u2014 detected MCP clients on this machine:
|
|
|
4155
4224
|
let region;
|
|
4156
4225
|
try {
|
|
4157
4226
|
if (pinnedRegion && !allowFallback) {
|
|
4158
|
-
const { REGIONS } = await import("./dist-
|
|
4227
|
+
const { REGIONS } = await import("./dist-7XHTMWB2.js");
|
|
4159
4228
|
const baseUrl = REGIONS[pinnedRegion];
|
|
4160
4229
|
token = await loginAt(baseUrl, email, password);
|
|
4161
4230
|
region = pinnedRegion;
|
|
@@ -175,9 +175,16 @@ var LeadbayClient = class {
|
|
|
175
175
|
// surface latency/region/retry_after to the agent in their `_meta` block.
|
|
176
176
|
_lastMeta = null;
|
|
177
177
|
constructor(baseUrl, token, region) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
if (typeof baseUrl === "object") {
|
|
179
|
+
const opts = baseUrl;
|
|
180
|
+
this._baseUrl = opts.baseUrl.replace(/\/+$/, "");
|
|
181
|
+
this.token = opts.bearer ?? null;
|
|
182
|
+
this._region = opts.region ?? (opts.baseUrl === REGIONS.us ? "us" : opts.baseUrl === REGIONS.fr ? "fr" : "custom");
|
|
183
|
+
} else {
|
|
184
|
+
this._baseUrl = baseUrl.replace(/\/+$/, "");
|
|
185
|
+
this.token = token ?? null;
|
|
186
|
+
this._region = region ?? (baseUrl === REGIONS.us ? "us" : baseUrl === REGIONS.fr ? "fr" : "custom");
|
|
187
|
+
}
|
|
181
188
|
}
|
|
182
189
|
get baseUrl() {
|
|
183
190
|
return this._baseUrl;
|
|
@@ -4941,17 +4948,49 @@ function makeAgentMemoryTombstone(input) {
|
|
|
4941
4948
|
};
|
|
4942
4949
|
}
|
|
4943
4950
|
|
|
4951
|
+
// ../core/dist/composite/_composite-file-names.js
|
|
4952
|
+
var COMPOSITE_FILE_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
4953
|
+
"leadbay_account_status",
|
|
4954
|
+
"leadbay_add_leads_to_campaign",
|
|
4955
|
+
"leadbay_adjust_audience",
|
|
4956
|
+
"leadbay_answer_clarification",
|
|
4957
|
+
"leadbay_bulk_enrich_status",
|
|
4958
|
+
"leadbay_bulk_qualify_leads",
|
|
4959
|
+
"leadbay_campaign_call_sheet",
|
|
4960
|
+
"leadbay_campaign_progression",
|
|
4961
|
+
"leadbay_create_campaign",
|
|
4962
|
+
"leadbay_enrich_titles",
|
|
4963
|
+
"leadbay_followups_map",
|
|
4964
|
+
"leadbay_import_and_qualify",
|
|
4965
|
+
"leadbay_import_leads",
|
|
4966
|
+
"leadbay_import_status",
|
|
4967
|
+
"leadbay_list_campaigns",
|
|
4968
|
+
"leadbay_prepare_outreach",
|
|
4969
|
+
"leadbay_pull_followups",
|
|
4970
|
+
"leadbay_pull_leads",
|
|
4971
|
+
"leadbay_qualify_status",
|
|
4972
|
+
"leadbay_recall_ordered_titles",
|
|
4973
|
+
"leadbay_refine_prompt",
|
|
4974
|
+
"leadbay_remove_leads_from_campaign",
|
|
4975
|
+
"leadbay_report_friction",
|
|
4976
|
+
"leadbay_report_outreach",
|
|
4977
|
+
"leadbay_research_lead_by_id",
|
|
4978
|
+
"leadbay_research_lead_by_name_fuzzy",
|
|
4979
|
+
"leadbay_resolve_import_rows",
|
|
4980
|
+
"leadbay_tour_plan"
|
|
4981
|
+
]);
|
|
4982
|
+
|
|
4944
4983
|
// ../core/dist/tool-descriptions.generated.js
|
|
4945
4984
|
var leadbay_account_status = `## WHEN TO USE
|
|
4946
4985
|
|
|
4947
4986
|
Trigger phrases: "what's my account status", "how much quota do I have", "what lens am I on", "I topped up / I bought credits / I added credits".
|
|
4948
4987
|
|
|
4988
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
4989
|
+
|
|
4949
4990
|
Do NOT use for: "show me leads" \u2192 \`leadbay_pull_leads\`.
|
|
4950
4991
|
|
|
4951
4992
|
Prefer when: meta question about account, quota, active lens, or top-up recovery
|
|
4952
4993
|
|
|
4953
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
4954
|
-
|
|
4955
4994
|
Examples that SHOULD invoke this tool:
|
|
4956
4995
|
- "What's my account status?"
|
|
4957
4996
|
- "How much quota do I have left this week?"
|
|
@@ -4985,12 +5024,12 @@ var leadbay_add_leads_to_campaign = `## WHEN TO USE
|
|
|
4985
5024
|
|
|
4986
5025
|
Trigger phrases: "add leads to <name> campaign", "attach these to <campaign>", "put these in Q2 Push", "add to existing campaign".
|
|
4987
5026
|
|
|
5027
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5028
|
+
|
|
4988
5029
|
Do NOT use for: "create a new campaign" \u2192 \`leadbay_create_campaign\`; "remove lead from campaign" \u2192 \`leadbay_remove_leads_from_campaign\`; "list campaigns" \u2192 \`leadbay_list_campaigns\`.
|
|
4989
5030
|
|
|
4990
5031
|
Prefer when: existing campaign plus lead ids to attach; for a new campaign, use create_campaign
|
|
4991
5032
|
|
|
4992
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
4993
|
-
|
|
4994
5033
|
Examples that SHOULD invoke this tool:
|
|
4995
5034
|
- "Add the three new Tulsa leads to my 'OK Sweep' campaign."
|
|
4996
5035
|
- "Attach these qualified leads to campaign id 1f12...?"
|
|
@@ -5159,12 +5198,12 @@ var leadbay_campaign_call_sheet = `## WHEN TO USE
|
|
|
5159
5198
|
|
|
5160
5199
|
Trigger phrases: "campaign call sheet", "people to call in <campaign>", "cold-calling cheat sheet", "work this campaign", "calling session for <campaign>".
|
|
5161
5200
|
|
|
5201
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5202
|
+
|
|
5162
5203
|
Do NOT use for: "campaign pulse only" \u2192 \`leadbay_campaign_progression\`; "create campaign" \u2192 \`leadbay_create_campaign\`; "list campaigns" \u2192 \`leadbay_list_campaigns\`.
|
|
5163
5204
|
|
|
5164
5205
|
Prefer when: user wants one campaign with phone + LinkedIn contacts ready to call
|
|
5165
5206
|
|
|
5166
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5167
|
-
|
|
5168
5207
|
Examples that SHOULD invoke this tool:
|
|
5169
5208
|
- "Show me my Limoges Tour campaign as a call sheet."
|
|
5170
5209
|
- "I'm about to do a calling session \u2014 render the Q2 Push campaign."
|
|
@@ -5319,12 +5358,12 @@ var leadbay_campaign_progression = `## WHEN TO USE
|
|
|
5319
5358
|
|
|
5320
5359
|
Trigger phrases: "how is my <name> campaign doing", "campaign progression", "lead-by-lead status on <campaign>", "who in <campaign> have I contacted", "what's stuck in my campaign".
|
|
5321
5360
|
|
|
5361
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5362
|
+
|
|
5322
5363
|
Do NOT use for: "pulse across all campaigns (not one)" \u2192 \`leadbay_list_campaigns\`; "log an outreach event" \u2192 \`leadbay_report_outreach\`.
|
|
5323
5364
|
|
|
5324
5365
|
Prefer when: user named (or just selected from list_campaigns) ONE campaign and wants per-lead status. Use list_campaigns for the cross-campaign overview
|
|
5325
5366
|
|
|
5326
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5327
|
-
|
|
5328
5367
|
Examples that SHOULD invoke this tool:
|
|
5329
5368
|
- "Walk me through the Limoges Tour campaign \u2014 who have I touched?"
|
|
5330
5369
|
- "Show progression on campaign 1f12...?"
|
|
@@ -5387,12 +5426,12 @@ var leadbay_create_campaign = `## WHEN TO USE
|
|
|
5387
5426
|
|
|
5388
5427
|
Trigger phrases: "create a campaign called <name>", "save these leads as a campaign", "campaign for my <city> trip", "group these leads", "persist these leads".
|
|
5389
5428
|
|
|
5429
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5430
|
+
|
|
5390
5431
|
Do NOT use for: "list campaigns" \u2192 \`leadbay_list_campaigns\`; "add to existing campaign" \u2192 \`leadbay_add_leads_to_campaign\`; "log outreach" \u2192 \`leadbay_report_outreach\`.
|
|
5391
5432
|
|
|
5392
5433
|
Prefer when: user wants to persist picked leads as a named cohort to work later
|
|
5393
5434
|
|
|
5394
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5395
|
-
|
|
5396
5435
|
Examples that SHOULD invoke this tool:
|
|
5397
5436
|
- "Save these 9 leads as a campaign called 'Limoges Tour \u2013 May 24'."
|
|
5398
5437
|
- "Create a campaign for the qualified leads I just picked."
|
|
@@ -5493,12 +5532,12 @@ var leadbay_dislike_lead = `## WHEN TO USE
|
|
|
5493
5532
|
|
|
5494
5533
|
Trigger phrases: "I don't like this lead", "thumbs down", "not relevant", "wrong industry", "too small", "skip permanently", "not a fit", "no to this one".
|
|
5495
5534
|
|
|
5535
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5536
|
+
|
|
5496
5537
|
Do NOT use for: "remind me later / snooze / not now" \u2192 \`leadbay_set_pushback\`; "thumbs up / save this one" \u2192 \`leadbay_like_lead\`.
|
|
5497
5538
|
|
|
5498
5539
|
Prefer when: durable rejection of a specific lead; pass \`lead_id\`. For temporary deferral, route to \`leadbay_set_pushback\`.
|
|
5499
5540
|
|
|
5500
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5501
|
-
|
|
5502
5541
|
Examples that SHOULD invoke this tool:
|
|
5503
5542
|
- "Thumbs down \u2014 wrong industry."
|
|
5504
5543
|
- "Dislike this one, never show me leads like this again."
|
|
@@ -5557,12 +5596,12 @@ var leadbay_followups_map = `## WHEN TO USE
|
|
|
5557
5596
|
|
|
5558
5597
|
Trigger phrases: "I'm going to <city>", "visit in person", "map of leads", "plan my itinerary".
|
|
5559
5598
|
|
|
5599
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5600
|
+
|
|
5560
5601
|
Do NOT use for: "default follow-up table" \u2192 \`leadbay_pull_followups\`; "new prospects" \u2192 \`leadbay_pull_leads\`.
|
|
5561
5602
|
|
|
5562
5603
|
Prefer when: geographic, travel, in-person, itinerary, or map intent
|
|
5563
5604
|
|
|
5564
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
5565
|
-
|
|
5566
5605
|
Examples that SHOULD invoke this tool:
|
|
5567
5606
|
- "I'm flying to New York Thursday \u2014 who should I meet in person?"
|
|
5568
5607
|
- "Who can I visit while I'm in Chicago next week?"
|
|
@@ -6011,12 +6050,12 @@ var leadbay_like_lead = `## WHEN TO USE
|
|
|
6011
6050
|
|
|
6012
6051
|
Trigger phrases: "I like this lead", "thumbs up", "this one looks good", "save this one", "this is a good fit", "more like this", "yes to this one".
|
|
6013
6052
|
|
|
6053
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6054
|
+
|
|
6014
6055
|
Do NOT use for: "remind me about this lead later / snooze it" \u2192 \`leadbay_set_pushback\`; "not relevant / wrong fit / thumbs down" \u2192 \`leadbay_dislike_lead\`.
|
|
6015
6056
|
|
|
6016
6057
|
Prefer when: user expresses durable positive interest in a specific lead; pass the lead's UUID as \`lead_id\`
|
|
6017
6058
|
|
|
6018
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6019
|
-
|
|
6020
6059
|
Examples that SHOULD invoke this tool:
|
|
6021
6060
|
- "I like this lead \u2014 show me more like it."
|
|
6022
6061
|
- "Thumbs up on Acme Corp, save it."
|
|
@@ -6049,12 +6088,12 @@ var leadbay_list_campaigns = `## WHEN TO USE
|
|
|
6049
6088
|
|
|
6050
6089
|
Trigger phrases: "what campaigns do I have", "list my campaigns", "show me my active campaigns", "campaign overview", "what's in flight", "pulse on my campaigns".
|
|
6051
6090
|
|
|
6091
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6092
|
+
|
|
6052
6093
|
Do NOT use for: "create a new campaign" \u2192 \`leadbay_create_campaign\`; "drill into one specific campaign's progression" \u2192 \`leadbay_campaign_progression\`.
|
|
6053
6094
|
|
|
6054
6095
|
Prefer when: user wants the pulse / overview view across all their campaigns. Use campaign_progression to drill into one
|
|
6055
6096
|
|
|
6056
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6057
|
-
|
|
6058
6097
|
Examples that SHOULD invoke this tool:
|
|
6059
6098
|
- "What campaigns am I running?"
|
|
6060
6099
|
- "Show me my active campaigns and how they're doing."
|
|
@@ -6176,12 +6215,12 @@ var leadbay_prepare_outreach = `## WHEN TO USE
|
|
|
6176
6215
|
|
|
6177
6216
|
Trigger phrases: "draft outreach for <Contact>", "write an email to <Contact>", "outreach package for <Company>".
|
|
6178
6217
|
|
|
6218
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6219
|
+
|
|
6179
6220
|
Do NOT use for: "research before drafting" \u2192 \`leadbay_research_lead_by_id\`; "log sent outreach" \u2192 \`leadbay_report_outreach\`; "bulk enrich contacts" \u2192 \`leadbay_enrich_titles\`.
|
|
6180
6221
|
|
|
6181
6222
|
Prefer when: single picked lead/contact; action-imminent drafting context
|
|
6182
6223
|
|
|
6183
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6184
|
-
|
|
6185
6224
|
Examples that SHOULD invoke this tool:
|
|
6186
6225
|
- "Draft an email to Sarah at Acme."
|
|
6187
6226
|
- "I'm about to call Acme's CTO \u2014 prep me."
|
|
@@ -6409,17 +6448,20 @@ This tool MUTATES state. The caller (agent or human-in-the-loop) is responsible
|
|
|
6409
6448
|
`;
|
|
6410
6449
|
var leadbay_pull_followups = `## WHEN TO USE
|
|
6411
6450
|
|
|
6412
|
-
Trigger phrases: "what should I follow up on", "leads I've already worked", "what's overdue", "leads in <city / state / country>".
|
|
6451
|
+
Trigger phrases: "what should I follow up on", "leads I've already worked", "what's overdue", "leads in <city / state / country>", "reach out to today", "should reach out to", "get back to", "contact today", "reconnect with", "re-engage", "leads to contact", "who should I ping".
|
|
6452
|
+
|
|
6453
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6413
6454
|
|
|
6414
6455
|
Do NOT use for: "new leads / today's prospects" \u2192 \`leadbay_pull_leads\`; "map / trip / in person" \u2192 \`leadbay_followups_map\`.
|
|
6415
6456
|
|
|
6416
6457
|
Prefer when: known Monitor leads; pass \`city\` or \`set_filter\` for geo/sector/recency
|
|
6417
6458
|
|
|
6418
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6419
|
-
|
|
6420
6459
|
Examples that SHOULD invoke this tool:
|
|
6421
6460
|
- "What should I follow up on this week?"
|
|
6422
6461
|
- "What's overdue in my pipeline?"
|
|
6462
|
+
- "Show me leads I should reach out to today."
|
|
6463
|
+
- "Who should I get back to today?"
|
|
6464
|
+
- "Leads I should contact today."
|
|
6423
6465
|
|
|
6424
6466
|
Examples that should NOT invoke this tool (sound similar, route elsewhere):
|
|
6425
6467
|
- "Show me today's new leads."
|
|
@@ -6597,13 +6639,13 @@ Always offer at least one of: prep outreach, refilter, pushback. Pushback is the
|
|
|
6597
6639
|
`;
|
|
6598
6640
|
var leadbay_pull_leads = `## WHEN TO USE
|
|
6599
6641
|
|
|
6600
|
-
Trigger phrases: "show me leads", "today's prospects", "best new leads".
|
|
6642
|
+
Trigger phrases: "show me leads", "show me new leads", "show me today's leads", "today's prospects", "best new leads", "fresh leads", "what's new today".
|
|
6601
6643
|
|
|
6602
|
-
|
|
6644
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6603
6645
|
|
|
6604
|
-
|
|
6646
|
+
Do NOT use for: "leads I should follow up with" \u2192 \`leadbay_pull_followups\`; "I'm going to <city>" \u2192 \`leadbay_followups_map\`; "leads I should reach out to" \u2192 \`leadbay_pull_followups\`; "leads to get back to" \u2192 \`leadbay_pull_followups\`; "leads to contact today" \u2192 \`leadbay_pull_followups\`; "should I contact" \u2192 \`leadbay_pull_followups\`; "reconnect with" \u2192 \`leadbay_pull_followups\`; "re-engage" \u2192 \`leadbay_pull_followups\`.
|
|
6605
6647
|
|
|
6606
|
-
|
|
6648
|
+
Prefer when: fresh Discover leads; if a lens is named, pass \`lensId\` and pin it
|
|
6607
6649
|
|
|
6608
6650
|
Examples that SHOULD invoke this tool:
|
|
6609
6651
|
- "Show me today's leads."
|
|
@@ -6612,6 +6654,9 @@ Examples that SHOULD invoke this tool:
|
|
|
6612
6654
|
Examples that should NOT invoke this tool (sound similar, route elsewhere):
|
|
6613
6655
|
- "Which leads should I follow up with this week?"
|
|
6614
6656
|
- "I'm flying to Berlin Thursday \u2014 who should I meet?"
|
|
6657
|
+
- "Show me leads I should reach out to today."
|
|
6658
|
+
- "Who should I get back to today?"
|
|
6659
|
+
- "Leads I should contact today."
|
|
6615
6660
|
|
|
6616
6661
|
## RENDER (quick)
|
|
6617
6662
|
|
|
@@ -6799,12 +6844,12 @@ var leadbay_remove_leads_from_campaign = `## WHEN TO USE
|
|
|
6799
6844
|
|
|
6800
6845
|
Trigger phrases: "remove lead from campaign", "take this out of <campaign>", "remove these from Q2 Push", "delete lead from campaign", "clean up campaign".
|
|
6801
6846
|
|
|
6847
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6848
|
+
|
|
6802
6849
|
Do NOT use for: "add leads to campaign" \u2192 \`leadbay_add_leads_to_campaign\`; "create a new campaign" \u2192 \`leadbay_create_campaign\`; "list campaigns" \u2192 \`leadbay_list_campaigns\`.
|
|
6803
6850
|
|
|
6804
6851
|
Prefer when: user wants to detach one or more leads from an existing campaign
|
|
6805
6852
|
|
|
6806
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6807
|
-
|
|
6808
6853
|
Examples that SHOULD invoke this tool:
|
|
6809
6854
|
- "Remove the Austin lead from my Q2 Push campaign."
|
|
6810
6855
|
- "Take these 3 unqualified leads out of the Limoges Tour."
|
|
@@ -6851,12 +6896,12 @@ var leadbay_report_friction = `## WHEN TO USE
|
|
|
6851
6896
|
|
|
6852
6897
|
Trigger phrases: "no, I meant", "still nothing", "third time asking", "this isn't working", "ugh", "why can't I".
|
|
6853
6898
|
|
|
6899
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6900
|
+
|
|
6854
6901
|
Do NOT use for: "log outreach" \u2192 \`leadbay_report_outreach\`; "thumbs up / down" \u2192 \`leadbay_like_lead\`; "snooze / pushback" \u2192 \`leadbay_set_pushback\`.
|
|
6855
6902
|
|
|
6856
6903
|
Prefer when: user shows frustration OR you notice a tool returned ok but with no useful output \u2014 be proactive.
|
|
6857
6904
|
|
|
6858
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6859
|
-
|
|
6860
6905
|
Examples that SHOULD invoke this tool:
|
|
6861
6906
|
- "No, I meant leads in Wisconsin, not Wyoming."
|
|
6862
6907
|
- "Still nothing? I've asked three times for SaaS founders under 50."
|
|
@@ -6913,12 +6958,12 @@ var leadbay_research_lead_by_id = `## WHEN TO USE
|
|
|
6913
6958
|
|
|
6914
6959
|
Trigger phrases: "tell me about this lead", "deep dive on the lead I just picked", "everything you know about lead <UUID>".
|
|
6915
6960
|
|
|
6961
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6962
|
+
|
|
6916
6963
|
Do NOT use for: "company name without lead id" \u2192 \`leadbay_research_lead_by_name_fuzzy\`; "draft outreach for <Contact>" \u2192 \`leadbay_prepare_outreach\`.
|
|
6917
6964
|
|
|
6918
6965
|
Prefer when: user picked a row and you have its UUID; pass \`leadId\`
|
|
6919
6966
|
|
|
6920
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
6921
|
-
|
|
6922
6967
|
Examples that SHOULD invoke this tool:
|
|
6923
6968
|
- "Tell me everything about that lead I just picked."
|
|
6924
6969
|
- "Is this one actually a fit \u2014 what does the AI think?"
|
|
@@ -7115,12 +7160,12 @@ var leadbay_research_lead_by_name_fuzzy = `## WHEN TO USE
|
|
|
7115
7160
|
|
|
7116
7161
|
Trigger phrases: "look up <Company>", "research <Company>", "what do we know about <Company>".
|
|
7117
7162
|
|
|
7163
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
7164
|
+
|
|
7118
7165
|
Do NOT use for: "picked row with leadId" \u2192 \`leadbay_research_lead_by_id\`; "draft outreach for <Contact>" \u2192 \`leadbay_prepare_outreach\`.
|
|
7119
7166
|
|
|
7120
7167
|
Prefer when: company name in prose and no Leadbay id yet
|
|
7121
7168
|
|
|
7122
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
7123
|
-
|
|
7124
7169
|
Examples that SHOULD invoke this tool:
|
|
7125
7170
|
- "Look up Acme Corp for me."
|
|
7126
7171
|
- "Find Initech in my pipeline."
|
|
@@ -7392,12 +7437,12 @@ var leadbay_tour_plan = `## WHEN TO USE
|
|
|
7392
7437
|
|
|
7393
7438
|
Trigger phrases: "visiting <city> in <N> days", "field tour in <city>", "plan a tour in <city>", "who should I meet in <city>", "customers plus prospects in <city>", "tour itinerary".
|
|
7394
7439
|
|
|
7440
|
+
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
7441
|
+
|
|
7395
7442
|
Do NOT use for: "follow-ups only, no new prospects" \u2192 \`leadbay_followups_map\`; "new leads only" \u2192 \`leadbay_pull_leads\`; "research one account" \u2192 \`leadbay_research_lead_by_id\`.
|
|
7396
7443
|
|
|
7397
7444
|
Prefer when: user wants known accounts plus new discoveries in one geographic itinerary
|
|
7398
7445
|
|
|
7399
|
-
**Memory:** recall + capture via \`leadbay_agent_memory_*\` tools.
|
|
7400
|
-
|
|
7401
7446
|
Examples that SHOULD invoke this tool:
|
|
7402
7447
|
- "I'm flying to Limoges in 4 days \u2014 give me 3 customers, 3 qualified prospects, and 3 new high-potential."
|
|
7403
7448
|
- "Plan my tour next Tuesday in Lyon: known accounts plus discoveries."
|
|
@@ -17689,6 +17734,7 @@ export {
|
|
|
17689
17734
|
withAgentMemoryMeta,
|
|
17690
17735
|
makeAgentMemoryEntry,
|
|
17691
17736
|
makeAgentMemoryTombstone,
|
|
17737
|
+
COMPOSITE_FILE_TOOL_NAMES,
|
|
17692
17738
|
login,
|
|
17693
17739
|
listLenses,
|
|
17694
17740
|
discoverLeads,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
AgentMemoryScopeSchema,
|
|
7
7
|
AgentMemorySourceSchema,
|
|
8
8
|
AgentMemoryTombstoneSchema,
|
|
9
|
+
COMPOSITE_FILE_TOOL_NAMES,
|
|
9
10
|
InMemoryBulkStore,
|
|
10
11
|
LeadbayClient,
|
|
11
12
|
LocalBulkStore,
|
|
@@ -124,7 +125,7 @@ import {
|
|
|
124
125
|
updateLens,
|
|
125
126
|
updateLensFilter,
|
|
126
127
|
withAgentMemoryMeta
|
|
127
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-3V3EPBLZ.js";
|
|
128
129
|
export {
|
|
129
130
|
AgentMemoryCaptureInputSchema,
|
|
130
131
|
AgentMemoryEntrySchema,
|
|
@@ -132,6 +133,7 @@ export {
|
|
|
132
133
|
AgentMemoryScopeSchema,
|
|
133
134
|
AgentMemorySourceSchema,
|
|
134
135
|
AgentMemoryTombstoneSchema,
|
|
136
|
+
COMPOSITE_FILE_TOOL_NAMES,
|
|
135
137
|
InMemoryBulkStore,
|
|
136
138
|
LeadbayClient,
|
|
137
139
|
LocalBulkStore,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leadbay/mcp",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"mcpName": "io.github.leadbay/leadbay-mcp",
|
|
5
5
|
"description": "Model Context Protocol (MCP) server for Leadbay — AI lead discovery, qualification, and enrichment for Claude Desktop, Cursor, and Claude Code.",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@anthropic-ai/sdk": "^0.40.0",
|
|
35
|
-
"@leadbay/core": "workspace:*"
|
|
35
|
+
"@leadbay/core": "workspace:*",
|
|
36
|
+
"@leadbay/promptforge": "workspace:*"
|
|
36
37
|
},
|
|
37
38
|
"engines": {
|
|
38
39
|
"node": ">=22"
|