@letpeoplework/lighthouse-mcp-core 0.5.0 → 0.7.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/dist/index.cjs +78 -74
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +78 -74
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
registerMcpTools: () => registerMcpTools
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
var import_toon = require("@toon-format/toon");
|
|
28
29
|
var import_zod = require("zod");
|
|
29
30
|
var getMcpCorePackageContract = () => ({
|
|
30
31
|
name: "@letpeoplework/lighthouse-mcp-core",
|
|
@@ -59,57 +60,57 @@ var dateRangeProperties = {
|
|
|
59
60
|
};
|
|
60
61
|
var toolDefinitions = [
|
|
61
62
|
{
|
|
62
|
-
name: "
|
|
63
|
+
name: "lighthouse_health_check",
|
|
63
64
|
description: "Check connectivity to Lighthouse and return whether the configured endpoint is reachable.",
|
|
64
65
|
inputSchema: emptyInputSchema
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
|
-
name: "
|
|
68
|
+
name: "lighthouse_version_get",
|
|
68
69
|
description: "Retrieve the Lighthouse server version from the version endpoint.",
|
|
69
70
|
inputSchema: emptyInputSchema
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
|
-
name: "
|
|
73
|
+
name: "lighthouse_worktracking_list",
|
|
73
74
|
description: "List configured work-tracking system connections in Lighthouse.",
|
|
74
75
|
inputSchema: emptyInputSchema
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
|
-
name: "
|
|
78
|
+
name: "lighthouse_worktracking_get",
|
|
78
79
|
description: "Get a single work-tracking system connection by ID.",
|
|
79
80
|
inputSchema: idInputSchema
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
|
-
name: "
|
|
83
|
+
name: "lighthouse_team_list",
|
|
83
84
|
description: "List all teams available in Lighthouse.",
|
|
84
85
|
inputSchema: emptyInputSchema
|
|
85
86
|
},
|
|
86
87
|
{
|
|
87
|
-
name: "
|
|
88
|
+
name: "lighthouse_team_get",
|
|
88
89
|
description: "Get full details for one team by ID.",
|
|
89
90
|
inputSchema: idInputSchema
|
|
90
91
|
},
|
|
91
92
|
{
|
|
92
|
-
name: "
|
|
93
|
+
name: "lighthouse_team_refresh",
|
|
93
94
|
description: "Trigger data refresh for a team by ID.",
|
|
94
95
|
inputSchema: idInputSchema
|
|
95
96
|
},
|
|
96
97
|
{
|
|
97
|
-
name: "
|
|
98
|
+
name: "lighthouse_portfolio_list",
|
|
98
99
|
description: "List all portfolios in Lighthouse.",
|
|
99
100
|
inputSchema: emptyInputSchema
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
|
-
name: "
|
|
103
|
+
name: "lighthouse_portfolio_get",
|
|
103
104
|
description: "Get full details for one portfolio by ID.",
|
|
104
105
|
inputSchema: idInputSchema
|
|
105
106
|
},
|
|
106
107
|
{
|
|
107
|
-
name: "
|
|
108
|
+
name: "lighthouse_portfolio_refresh",
|
|
108
109
|
description: "Trigger data refresh for a portfolio by ID.",
|
|
109
110
|
inputSchema: idInputSchema
|
|
110
111
|
},
|
|
111
112
|
{
|
|
112
|
-
name: "
|
|
113
|
+
name: "lighthouse_team_metrics_throughput",
|
|
113
114
|
description: "Get throughput run-chart data for a team by ID, optionally filtered by start and end dates.",
|
|
114
115
|
inputSchema: {
|
|
115
116
|
type: "object",
|
|
@@ -122,7 +123,7 @@ var toolDefinitions = [
|
|
|
122
123
|
}
|
|
123
124
|
},
|
|
124
125
|
{
|
|
125
|
-
name: "
|
|
126
|
+
name: "lighthouse_team_metrics_cycleTimePercentiles",
|
|
126
127
|
description: "Get cycle-time percentiles for a team by ID, optionally filtered by start and end dates.",
|
|
127
128
|
inputSchema: {
|
|
128
129
|
type: "object",
|
|
@@ -135,7 +136,7 @@ var toolDefinitions = [
|
|
|
135
136
|
}
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
|
-
name: "
|
|
139
|
+
name: "lighthouse_portfolio_metrics_throughput",
|
|
139
140
|
description: "Get throughput run-chart data for a portfolio by ID, optionally filtered by start and end dates.",
|
|
140
141
|
inputSchema: {
|
|
141
142
|
type: "object",
|
|
@@ -148,7 +149,7 @@ var toolDefinitions = [
|
|
|
148
149
|
}
|
|
149
150
|
},
|
|
150
151
|
{
|
|
151
|
-
name: "
|
|
152
|
+
name: "lighthouse_feature_get",
|
|
152
153
|
description: "Get feature details by numeric IDs or external reference IDs.",
|
|
153
154
|
inputSchema: {
|
|
154
155
|
type: "object",
|
|
@@ -172,17 +173,17 @@ var toolDefinitions = [
|
|
|
172
173
|
}
|
|
173
174
|
},
|
|
174
175
|
{
|
|
175
|
-
name: "
|
|
176
|
+
name: "lighthouse_feature_workitems",
|
|
176
177
|
description: "Get work items linked to a feature by ID.",
|
|
177
178
|
inputSchema: idInputSchema
|
|
178
179
|
},
|
|
179
180
|
{
|
|
180
|
-
name: "
|
|
181
|
+
name: "lighthouse_delivery_list",
|
|
181
182
|
description: "List deliveries for a portfolio by portfolio ID.",
|
|
182
183
|
inputSchema: idInputSchema
|
|
183
184
|
},
|
|
184
185
|
{
|
|
185
|
-
name: "
|
|
186
|
+
name: "lighthouse_forecast_manual",
|
|
186
187
|
description: "Run a manual forecast for a team by ID with optional remaining items and target date.",
|
|
187
188
|
inputSchema: {
|
|
188
189
|
type: "object",
|
|
@@ -202,7 +203,7 @@ var toolDefinitions = [
|
|
|
202
203
|
}
|
|
203
204
|
},
|
|
204
205
|
{
|
|
205
|
-
name: "
|
|
206
|
+
name: "lighthouse_forecast_backtest",
|
|
206
207
|
description: "Run a forecast backtest for a team by ID using forecast and historical date ranges.",
|
|
207
208
|
inputSchema: {
|
|
208
209
|
type: "object",
|
|
@@ -236,6 +237,13 @@ var toolDefinitions = [
|
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
239
|
];
|
|
240
|
+
var encodePayload = (value) => {
|
|
241
|
+
try {
|
|
242
|
+
return (0, import_toon.encode)(value);
|
|
243
|
+
} catch {
|
|
244
|
+
return JSON.stringify(value);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
239
247
|
var getSuccessToolResult = (text) => ({
|
|
240
248
|
isError: false,
|
|
241
249
|
content: [
|
|
@@ -280,43 +288,43 @@ var getDateRange = (argumentsPayload) => {
|
|
|
280
288
|
};
|
|
281
289
|
var isoDateStringSchema = import_zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/u, "Expected ISO date in YYYY-MM-DD format.");
|
|
282
290
|
var toolInputSchemas = {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
lighthouse_health_check: import_zod.z.object({}),
|
|
292
|
+
lighthouse_version_get: import_zod.z.object({}),
|
|
293
|
+
lighthouse_worktracking_list: import_zod.z.object({}),
|
|
294
|
+
lighthouse_worktracking_get: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
295
|
+
lighthouse_team_list: import_zod.z.object({}),
|
|
296
|
+
lighthouse_team_get: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
297
|
+
lighthouse_team_refresh: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
298
|
+
lighthouse_portfolio_list: import_zod.z.object({}),
|
|
299
|
+
lighthouse_portfolio_get: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
300
|
+
lighthouse_portfolio_refresh: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
301
|
+
lighthouse_team_metrics_throughput: import_zod.z.object({
|
|
294
302
|
id: import_zod.z.number().int(),
|
|
295
303
|
startDate: isoDateStringSchema.optional(),
|
|
296
304
|
endDate: isoDateStringSchema.optional()
|
|
297
305
|
}),
|
|
298
|
-
|
|
306
|
+
lighthouse_team_metrics_cycleTimePercentiles: import_zod.z.object({
|
|
299
307
|
id: import_zod.z.number().int(),
|
|
300
308
|
startDate: isoDateStringSchema.optional(),
|
|
301
309
|
endDate: isoDateStringSchema.optional()
|
|
302
310
|
}),
|
|
303
|
-
|
|
311
|
+
lighthouse_portfolio_metrics_throughput: import_zod.z.object({
|
|
304
312
|
id: import_zod.z.number().int(),
|
|
305
313
|
startDate: isoDateStringSchema.optional(),
|
|
306
314
|
endDate: isoDateStringSchema.optional()
|
|
307
315
|
}),
|
|
308
|
-
|
|
316
|
+
lighthouse_feature_get: import_zod.z.object({
|
|
309
317
|
ids: import_zod.z.array(import_zod.z.number().int()).optional(),
|
|
310
318
|
refs: import_zod.z.array(import_zod.z.string()).optional()
|
|
311
319
|
}),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
320
|
+
lighthouse_feature_workitems: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
321
|
+
lighthouse_delivery_list: import_zod.z.object({ id: import_zod.z.number().int() }),
|
|
322
|
+
lighthouse_forecast_manual: import_zod.z.object({
|
|
315
323
|
id: import_zod.z.number().int(),
|
|
316
324
|
remainingItems: import_zod.z.number().int().optional(),
|
|
317
325
|
targetDate: isoDateStringSchema.optional()
|
|
318
326
|
}),
|
|
319
|
-
|
|
327
|
+
lighthouse_forecast_backtest: import_zod.z.object({
|
|
320
328
|
id: import_zod.z.number().int(),
|
|
321
329
|
startDate: isoDateStringSchema,
|
|
322
330
|
endDate: isoDateStringSchema,
|
|
@@ -324,12 +332,12 @@ var toolInputSchemas = {
|
|
|
324
332
|
historicalEndDate: isoDateStringSchema
|
|
325
333
|
})
|
|
326
334
|
};
|
|
327
|
-
var isReadOnlyTool = (toolName) => !toolName.endsWith("
|
|
335
|
+
var isReadOnlyTool = (toolName) => !toolName.endsWith("_refresh");
|
|
328
336
|
var createMcpCoreRuntime = (dependencies) => ({
|
|
329
337
|
listTools: () => toolDefinitions,
|
|
330
338
|
callTool: async (name, argumentsPayload) => {
|
|
331
339
|
const client = dependencies.createClient();
|
|
332
|
-
if (name === "
|
|
340
|
+
if (name === "lighthouse_health_check") {
|
|
333
341
|
const health = await client.checkConnectivity();
|
|
334
342
|
if (health.category === "success") {
|
|
335
343
|
return getSuccessToolResult("connectivity: success");
|
|
@@ -339,7 +347,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
339
347
|
`connectivity: ${health.category}${healthReasonSuffix}`
|
|
340
348
|
);
|
|
341
349
|
}
|
|
342
|
-
if (name === "
|
|
350
|
+
if (name === "lighthouse_version_get") {
|
|
343
351
|
const version = await client.getVersion();
|
|
344
352
|
if (version.ok) {
|
|
345
353
|
return getSuccessToolResult(`version: ${version.value}`);
|
|
@@ -348,18 +356,18 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
348
356
|
`version: ${version.error.category} (${version.error.reason})`
|
|
349
357
|
);
|
|
350
358
|
}
|
|
351
|
-
if (name === "
|
|
359
|
+
if (name === "lighthouse_worktracking_list") {
|
|
352
360
|
const connections = await client.listWorkTrackingConnections();
|
|
353
361
|
if (connections.ok) {
|
|
354
362
|
return getSuccessToolResult(
|
|
355
|
-
`worktracking: ${
|
|
363
|
+
`worktracking: ${encodePayload(connections.value)}`
|
|
356
364
|
);
|
|
357
365
|
}
|
|
358
366
|
return getErrorToolResult(
|
|
359
367
|
`worktracking: ${connections.error.category} (${connections.error.reason})`
|
|
360
368
|
);
|
|
361
369
|
}
|
|
362
|
-
if (name === "
|
|
370
|
+
if (name === "lighthouse_worktracking_get") {
|
|
363
371
|
const id = getNumericId(argumentsPayload);
|
|
364
372
|
if (id === null) {
|
|
365
373
|
return getErrorToolResult("worktracking: invalid id");
|
|
@@ -367,36 +375,36 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
367
375
|
const connection = await client.getWorkTrackingConnection(id);
|
|
368
376
|
if (connection.ok) {
|
|
369
377
|
return getSuccessToolResult(
|
|
370
|
-
`worktracking: ${
|
|
378
|
+
`worktracking: ${encodePayload(connection.value)}`
|
|
371
379
|
);
|
|
372
380
|
}
|
|
373
381
|
return getErrorToolResult(
|
|
374
382
|
`worktracking: ${connection.error.category} (${connection.error.reason})`
|
|
375
383
|
);
|
|
376
384
|
}
|
|
377
|
-
if (name === "
|
|
385
|
+
if (name === "lighthouse_team_list") {
|
|
378
386
|
const teams = await client.listTeams();
|
|
379
387
|
if (teams.ok) {
|
|
380
|
-
return getSuccessToolResult(`teams: ${
|
|
388
|
+
return getSuccessToolResult(`teams: ${encodePayload(teams.value)}`);
|
|
381
389
|
}
|
|
382
390
|
return getErrorToolResult(
|
|
383
391
|
`teams: ${teams.error.category} (${teams.error.reason})`
|
|
384
392
|
);
|
|
385
393
|
}
|
|
386
|
-
if (name === "
|
|
394
|
+
if (name === "lighthouse_team_get") {
|
|
387
395
|
const id = getNumericId(argumentsPayload);
|
|
388
396
|
if (id === null) {
|
|
389
397
|
return getErrorToolResult("team: invalid id");
|
|
390
398
|
}
|
|
391
399
|
const team = await client.getTeam(id);
|
|
392
400
|
if (team.ok) {
|
|
393
|
-
return getSuccessToolResult(`team: ${
|
|
401
|
+
return getSuccessToolResult(`team: ${encodePayload(team.value)}`);
|
|
394
402
|
}
|
|
395
403
|
return getErrorToolResult(
|
|
396
404
|
`team: ${team.error.category} (${team.error.reason})`
|
|
397
405
|
);
|
|
398
406
|
}
|
|
399
|
-
if (name === "
|
|
407
|
+
if (name === "lighthouse_team_refresh") {
|
|
400
408
|
const id = getNumericId(argumentsPayload);
|
|
401
409
|
if (id === null) {
|
|
402
410
|
return getErrorToolResult("team: invalid id");
|
|
@@ -409,18 +417,18 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
409
417
|
`team refresh: ${result.error.category} (${result.error.reason})`
|
|
410
418
|
);
|
|
411
419
|
}
|
|
412
|
-
if (name === "
|
|
420
|
+
if (name === "lighthouse_portfolio_list") {
|
|
413
421
|
const portfolios = await client.listPortfolios();
|
|
414
422
|
if (portfolios.ok) {
|
|
415
423
|
return getSuccessToolResult(
|
|
416
|
-
`portfolios: ${
|
|
424
|
+
`portfolios: ${encodePayload(portfolios.value)}`
|
|
417
425
|
);
|
|
418
426
|
}
|
|
419
427
|
return getErrorToolResult(
|
|
420
428
|
`portfolios: ${portfolios.error.category} (${portfolios.error.reason})`
|
|
421
429
|
);
|
|
422
430
|
}
|
|
423
|
-
if (name === "
|
|
431
|
+
if (name === "lighthouse_portfolio_get") {
|
|
424
432
|
const id = getNumericId(argumentsPayload);
|
|
425
433
|
if (id === null) {
|
|
426
434
|
return getErrorToolResult("portfolio: invalid id");
|
|
@@ -428,14 +436,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
428
436
|
const portfolio = await client.getPortfolio(id);
|
|
429
437
|
if (portfolio.ok) {
|
|
430
438
|
return getSuccessToolResult(
|
|
431
|
-
`portfolio: ${
|
|
439
|
+
`portfolio: ${encodePayload(portfolio.value)}`
|
|
432
440
|
);
|
|
433
441
|
}
|
|
434
442
|
return getErrorToolResult(
|
|
435
443
|
`portfolio: ${portfolio.error.category} (${portfolio.error.reason})`
|
|
436
444
|
);
|
|
437
445
|
}
|
|
438
|
-
if (name === "
|
|
446
|
+
if (name === "lighthouse_portfolio_refresh") {
|
|
439
447
|
const id = getNumericId(argumentsPayload);
|
|
440
448
|
if (id === null) {
|
|
441
449
|
return getErrorToolResult("portfolio: invalid id");
|
|
@@ -448,7 +456,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
448
456
|
`portfolio refresh: ${result.error.category} (${result.error.reason})`
|
|
449
457
|
);
|
|
450
458
|
}
|
|
451
|
-
if (name === "
|
|
459
|
+
if (name === "lighthouse_team_metrics_throughput") {
|
|
452
460
|
const id = getNumericId(argumentsPayload);
|
|
453
461
|
if (id === null) {
|
|
454
462
|
return getErrorToolResult("team metrics: invalid id");
|
|
@@ -457,14 +465,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
457
465
|
const result = await client.getTeamThroughput(id, range);
|
|
458
466
|
if (result.ok) {
|
|
459
467
|
return getSuccessToolResult(
|
|
460
|
-
`team throughput: ${
|
|
468
|
+
`team throughput: ${encodePayload(result.value)}`
|
|
461
469
|
);
|
|
462
470
|
}
|
|
463
471
|
return getErrorToolResult(
|
|
464
472
|
`team metrics: ${result.error.category} (${result.error.reason})`
|
|
465
473
|
);
|
|
466
474
|
}
|
|
467
|
-
if (name === "
|
|
475
|
+
if (name === "lighthouse_team_metrics_cycleTimePercentiles") {
|
|
468
476
|
const id = getNumericId(argumentsPayload);
|
|
469
477
|
if (id === null) {
|
|
470
478
|
return getErrorToolResult("team metrics: invalid id");
|
|
@@ -473,14 +481,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
473
481
|
const result = await client.getTeamCycleTimePercentiles(id, range);
|
|
474
482
|
if (result.ok) {
|
|
475
483
|
return getSuccessToolResult(
|
|
476
|
-
`team cycleTimePercentiles: ${
|
|
484
|
+
`team cycleTimePercentiles: ${encodePayload(result.value)}`
|
|
477
485
|
);
|
|
478
486
|
}
|
|
479
487
|
return getErrorToolResult(
|
|
480
488
|
`team metrics: ${result.error.category} (${result.error.reason})`
|
|
481
489
|
);
|
|
482
490
|
}
|
|
483
|
-
if (name === "
|
|
491
|
+
if (name === "lighthouse_portfolio_metrics_throughput") {
|
|
484
492
|
const id = getNumericId(argumentsPayload);
|
|
485
493
|
if (id === null) {
|
|
486
494
|
return getErrorToolResult("portfolio metrics: invalid id");
|
|
@@ -489,14 +497,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
489
497
|
const result = await client.getPortfolioThroughput(id, range);
|
|
490
498
|
if (result.ok) {
|
|
491
499
|
return getSuccessToolResult(
|
|
492
|
-
`portfolio throughput: ${
|
|
500
|
+
`portfolio throughput: ${encodePayload(result.value)}`
|
|
493
501
|
);
|
|
494
502
|
}
|
|
495
503
|
return getErrorToolResult(
|
|
496
504
|
`portfolio metrics: ${result.error.category} (${result.error.reason})`
|
|
497
505
|
);
|
|
498
506
|
}
|
|
499
|
-
if (name === "
|
|
507
|
+
if (name === "lighthouse_feature_get") {
|
|
500
508
|
const payload = isObjectRecord(argumentsPayload) ? argumentsPayload : {};
|
|
501
509
|
const idsValue = payload.ids;
|
|
502
510
|
const refsValue = payload.refs;
|
|
@@ -505,7 +513,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
505
513
|
const result = await client.getFeaturesByIds(ids);
|
|
506
514
|
if (result.ok) {
|
|
507
515
|
return getSuccessToolResult(
|
|
508
|
-
`features: ${
|
|
516
|
+
`features: ${encodePayload(result.value)}`
|
|
509
517
|
);
|
|
510
518
|
}
|
|
511
519
|
return getErrorToolResult(
|
|
@@ -519,7 +527,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
519
527
|
const result = await client.getFeaturesByReferences(refs);
|
|
520
528
|
if (result.ok) {
|
|
521
529
|
return getSuccessToolResult(
|
|
522
|
-
`features: ${
|
|
530
|
+
`features: ${encodePayload(result.value)}`
|
|
523
531
|
);
|
|
524
532
|
}
|
|
525
533
|
return getErrorToolResult(
|
|
@@ -530,7 +538,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
530
538
|
"features: provide ids (array of numbers) or refs (array of strings)"
|
|
531
539
|
);
|
|
532
540
|
}
|
|
533
|
-
if (name === "
|
|
541
|
+
if (name === "lighthouse_feature_workitems") {
|
|
534
542
|
const id = getNumericId(argumentsPayload);
|
|
535
543
|
if (id === null) {
|
|
536
544
|
return getErrorToolResult("feature workitems: invalid id");
|
|
@@ -538,14 +546,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
538
546
|
const result = await client.getFeatureWorkItems(id);
|
|
539
547
|
if (result.ok) {
|
|
540
548
|
return getSuccessToolResult(
|
|
541
|
-
`feature workitems: ${
|
|
549
|
+
`feature workitems: ${encodePayload(result.value)}`
|
|
542
550
|
);
|
|
543
551
|
}
|
|
544
552
|
return getErrorToolResult(
|
|
545
553
|
`feature workitems: ${result.error.category} (${result.error.reason})`
|
|
546
554
|
);
|
|
547
555
|
}
|
|
548
|
-
if (name === "
|
|
556
|
+
if (name === "lighthouse_delivery_list") {
|
|
549
557
|
const id = getNumericId(argumentsPayload);
|
|
550
558
|
if (id === null) {
|
|
551
559
|
return getErrorToolResult(
|
|
@@ -555,14 +563,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
555
563
|
const result = await client.listDeliveries(id);
|
|
556
564
|
if (result.ok) {
|
|
557
565
|
return getSuccessToolResult(
|
|
558
|
-
`deliveries: ${
|
|
566
|
+
`deliveries: ${encodePayload(result.value)}`
|
|
559
567
|
);
|
|
560
568
|
}
|
|
561
569
|
return getErrorToolResult(
|
|
562
570
|
`delivery: ${result.error.category} (${result.error.reason})`
|
|
563
571
|
);
|
|
564
572
|
}
|
|
565
|
-
if (name === "
|
|
573
|
+
if (name === "lighthouse_forecast_manual") {
|
|
566
574
|
const id = getNumericId(argumentsPayload);
|
|
567
575
|
if (id === null) {
|
|
568
576
|
return getErrorToolResult("forecast: invalid id (team id required)");
|
|
@@ -575,15 +583,13 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
575
583
|
targetDate
|
|
576
584
|
});
|
|
577
585
|
if (result.ok) {
|
|
578
|
-
return getSuccessToolResult(
|
|
579
|
-
`forecast: ${JSON.stringify(result.value)}`
|
|
580
|
-
);
|
|
586
|
+
return getSuccessToolResult(`forecast: ${encodePayload(result.value)}`);
|
|
581
587
|
}
|
|
582
588
|
return getErrorToolResult(
|
|
583
589
|
`forecast: ${result.error.category} (${result.error.reason})`
|
|
584
590
|
);
|
|
585
591
|
}
|
|
586
|
-
if (name === "
|
|
592
|
+
if (name === "lighthouse_forecast_backtest") {
|
|
587
593
|
const id = getNumericId(argumentsPayload);
|
|
588
594
|
if (id === null) {
|
|
589
595
|
return getErrorToolResult("backtest: invalid id (team id required)");
|
|
@@ -605,9 +611,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
605
611
|
historicalEndDate
|
|
606
612
|
});
|
|
607
613
|
if (result.ok) {
|
|
608
|
-
return getSuccessToolResult(
|
|
609
|
-
`backtest: ${JSON.stringify(result.value)}`
|
|
610
|
-
);
|
|
614
|
+
return getSuccessToolResult(`backtest: ${encodePayload(result.value)}`);
|
|
611
615
|
}
|
|
612
616
|
return getErrorToolResult(
|
|
613
617
|
`backtest: ${result.error.category} (${result.error.reason})`
|
package/dist/index.d.cts
CHANGED
|
@@ -15,7 +15,7 @@ type McpToolResult = {
|
|
|
15
15
|
readonly content: readonly McpToolContent[];
|
|
16
16
|
};
|
|
17
17
|
type McpToolDefinition = {
|
|
18
|
-
readonly name: "
|
|
18
|
+
readonly name: "lighthouse_health_check" | "lighthouse_version_get" | "lighthouse_worktracking_list" | "lighthouse_worktracking_get" | "lighthouse_team_list" | "lighthouse_team_get" | "lighthouse_team_refresh" | "lighthouse_portfolio_list" | "lighthouse_portfolio_get" | "lighthouse_portfolio_refresh" | "lighthouse_team_metrics_throughput" | "lighthouse_team_metrics_cycleTimePercentiles" | "lighthouse_portfolio_metrics_throughput" | "lighthouse_feature_get" | "lighthouse_feature_workitems" | "lighthouse_delivery_list" | "lighthouse_forecast_manual" | "lighthouse_forecast_backtest";
|
|
19
19
|
readonly description: string;
|
|
20
20
|
readonly inputSchema: {
|
|
21
21
|
readonly type: "object";
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type McpToolResult = {
|
|
|
15
15
|
readonly content: readonly McpToolContent[];
|
|
16
16
|
};
|
|
17
17
|
type McpToolDefinition = {
|
|
18
|
-
readonly name: "
|
|
18
|
+
readonly name: "lighthouse_health_check" | "lighthouse_version_get" | "lighthouse_worktracking_list" | "lighthouse_worktracking_get" | "lighthouse_team_list" | "lighthouse_team_get" | "lighthouse_team_refresh" | "lighthouse_portfolio_list" | "lighthouse_portfolio_get" | "lighthouse_portfolio_refresh" | "lighthouse_team_metrics_throughput" | "lighthouse_team_metrics_cycleTimePercentiles" | "lighthouse_portfolio_metrics_throughput" | "lighthouse_feature_get" | "lighthouse_feature_workitems" | "lighthouse_delivery_list" | "lighthouse_forecast_manual" | "lighthouse_forecast_backtest";
|
|
19
19
|
readonly description: string;
|
|
20
20
|
readonly inputSchema: {
|
|
21
21
|
readonly type: "object";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
+
import { encode } from "@toon-format/toon";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
var getMcpCorePackageContract = () => ({
|
|
4
5
|
name: "@letpeoplework/lighthouse-mcp-core",
|
|
@@ -33,57 +34,57 @@ var dateRangeProperties = {
|
|
|
33
34
|
};
|
|
34
35
|
var toolDefinitions = [
|
|
35
36
|
{
|
|
36
|
-
name: "
|
|
37
|
+
name: "lighthouse_health_check",
|
|
37
38
|
description: "Check connectivity to Lighthouse and return whether the configured endpoint is reachable.",
|
|
38
39
|
inputSchema: emptyInputSchema
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
|
-
name: "
|
|
42
|
+
name: "lighthouse_version_get",
|
|
42
43
|
description: "Retrieve the Lighthouse server version from the version endpoint.",
|
|
43
44
|
inputSchema: emptyInputSchema
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
|
-
name: "
|
|
47
|
+
name: "lighthouse_worktracking_list",
|
|
47
48
|
description: "List configured work-tracking system connections in Lighthouse.",
|
|
48
49
|
inputSchema: emptyInputSchema
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
|
-
name: "
|
|
52
|
+
name: "lighthouse_worktracking_get",
|
|
52
53
|
description: "Get a single work-tracking system connection by ID.",
|
|
53
54
|
inputSchema: idInputSchema
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
|
-
name: "
|
|
57
|
+
name: "lighthouse_team_list",
|
|
57
58
|
description: "List all teams available in Lighthouse.",
|
|
58
59
|
inputSchema: emptyInputSchema
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
|
-
name: "
|
|
62
|
+
name: "lighthouse_team_get",
|
|
62
63
|
description: "Get full details for one team by ID.",
|
|
63
64
|
inputSchema: idInputSchema
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
|
-
name: "
|
|
67
|
+
name: "lighthouse_team_refresh",
|
|
67
68
|
description: "Trigger data refresh for a team by ID.",
|
|
68
69
|
inputSchema: idInputSchema
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
|
-
name: "
|
|
72
|
+
name: "lighthouse_portfolio_list",
|
|
72
73
|
description: "List all portfolios in Lighthouse.",
|
|
73
74
|
inputSchema: emptyInputSchema
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
|
-
name: "
|
|
77
|
+
name: "lighthouse_portfolio_get",
|
|
77
78
|
description: "Get full details for one portfolio by ID.",
|
|
78
79
|
inputSchema: idInputSchema
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
|
-
name: "
|
|
82
|
+
name: "lighthouse_portfolio_refresh",
|
|
82
83
|
description: "Trigger data refresh for a portfolio by ID.",
|
|
83
84
|
inputSchema: idInputSchema
|
|
84
85
|
},
|
|
85
86
|
{
|
|
86
|
-
name: "
|
|
87
|
+
name: "lighthouse_team_metrics_throughput",
|
|
87
88
|
description: "Get throughput run-chart data for a team by ID, optionally filtered by start and end dates.",
|
|
88
89
|
inputSchema: {
|
|
89
90
|
type: "object",
|
|
@@ -96,7 +97,7 @@ var toolDefinitions = [
|
|
|
96
97
|
}
|
|
97
98
|
},
|
|
98
99
|
{
|
|
99
|
-
name: "
|
|
100
|
+
name: "lighthouse_team_metrics_cycleTimePercentiles",
|
|
100
101
|
description: "Get cycle-time percentiles for a team by ID, optionally filtered by start and end dates.",
|
|
101
102
|
inputSchema: {
|
|
102
103
|
type: "object",
|
|
@@ -109,7 +110,7 @@ var toolDefinitions = [
|
|
|
109
110
|
}
|
|
110
111
|
},
|
|
111
112
|
{
|
|
112
|
-
name: "
|
|
113
|
+
name: "lighthouse_portfolio_metrics_throughput",
|
|
113
114
|
description: "Get throughput run-chart data for a portfolio by ID, optionally filtered by start and end dates.",
|
|
114
115
|
inputSchema: {
|
|
115
116
|
type: "object",
|
|
@@ -122,7 +123,7 @@ var toolDefinitions = [
|
|
|
122
123
|
}
|
|
123
124
|
},
|
|
124
125
|
{
|
|
125
|
-
name: "
|
|
126
|
+
name: "lighthouse_feature_get",
|
|
126
127
|
description: "Get feature details by numeric IDs or external reference IDs.",
|
|
127
128
|
inputSchema: {
|
|
128
129
|
type: "object",
|
|
@@ -146,17 +147,17 @@ var toolDefinitions = [
|
|
|
146
147
|
}
|
|
147
148
|
},
|
|
148
149
|
{
|
|
149
|
-
name: "
|
|
150
|
+
name: "lighthouse_feature_workitems",
|
|
150
151
|
description: "Get work items linked to a feature by ID.",
|
|
151
152
|
inputSchema: idInputSchema
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
|
-
name: "
|
|
155
|
+
name: "lighthouse_delivery_list",
|
|
155
156
|
description: "List deliveries for a portfolio by portfolio ID.",
|
|
156
157
|
inputSchema: idInputSchema
|
|
157
158
|
},
|
|
158
159
|
{
|
|
159
|
-
name: "
|
|
160
|
+
name: "lighthouse_forecast_manual",
|
|
160
161
|
description: "Run a manual forecast for a team by ID with optional remaining items and target date.",
|
|
161
162
|
inputSchema: {
|
|
162
163
|
type: "object",
|
|
@@ -176,7 +177,7 @@ var toolDefinitions = [
|
|
|
176
177
|
}
|
|
177
178
|
},
|
|
178
179
|
{
|
|
179
|
-
name: "
|
|
180
|
+
name: "lighthouse_forecast_backtest",
|
|
180
181
|
description: "Run a forecast backtest for a team by ID using forecast and historical date ranges.",
|
|
181
182
|
inputSchema: {
|
|
182
183
|
type: "object",
|
|
@@ -210,6 +211,13 @@ var toolDefinitions = [
|
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
];
|
|
214
|
+
var encodePayload = (value) => {
|
|
215
|
+
try {
|
|
216
|
+
return encode(value);
|
|
217
|
+
} catch {
|
|
218
|
+
return JSON.stringify(value);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
213
221
|
var getSuccessToolResult = (text) => ({
|
|
214
222
|
isError: false,
|
|
215
223
|
content: [
|
|
@@ -254,43 +262,43 @@ var getDateRange = (argumentsPayload) => {
|
|
|
254
262
|
};
|
|
255
263
|
var isoDateStringSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/u, "Expected ISO date in YYYY-MM-DD format.");
|
|
256
264
|
var toolInputSchemas = {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
lighthouse_health_check: z.object({}),
|
|
266
|
+
lighthouse_version_get: z.object({}),
|
|
267
|
+
lighthouse_worktracking_list: z.object({}),
|
|
268
|
+
lighthouse_worktracking_get: z.object({ id: z.number().int() }),
|
|
269
|
+
lighthouse_team_list: z.object({}),
|
|
270
|
+
lighthouse_team_get: z.object({ id: z.number().int() }),
|
|
271
|
+
lighthouse_team_refresh: z.object({ id: z.number().int() }),
|
|
272
|
+
lighthouse_portfolio_list: z.object({}),
|
|
273
|
+
lighthouse_portfolio_get: z.object({ id: z.number().int() }),
|
|
274
|
+
lighthouse_portfolio_refresh: z.object({ id: z.number().int() }),
|
|
275
|
+
lighthouse_team_metrics_throughput: z.object({
|
|
268
276
|
id: z.number().int(),
|
|
269
277
|
startDate: isoDateStringSchema.optional(),
|
|
270
278
|
endDate: isoDateStringSchema.optional()
|
|
271
279
|
}),
|
|
272
|
-
|
|
280
|
+
lighthouse_team_metrics_cycleTimePercentiles: z.object({
|
|
273
281
|
id: z.number().int(),
|
|
274
282
|
startDate: isoDateStringSchema.optional(),
|
|
275
283
|
endDate: isoDateStringSchema.optional()
|
|
276
284
|
}),
|
|
277
|
-
|
|
285
|
+
lighthouse_portfolio_metrics_throughput: z.object({
|
|
278
286
|
id: z.number().int(),
|
|
279
287
|
startDate: isoDateStringSchema.optional(),
|
|
280
288
|
endDate: isoDateStringSchema.optional()
|
|
281
289
|
}),
|
|
282
|
-
|
|
290
|
+
lighthouse_feature_get: z.object({
|
|
283
291
|
ids: z.array(z.number().int()).optional(),
|
|
284
292
|
refs: z.array(z.string()).optional()
|
|
285
293
|
}),
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
294
|
+
lighthouse_feature_workitems: z.object({ id: z.number().int() }),
|
|
295
|
+
lighthouse_delivery_list: z.object({ id: z.number().int() }),
|
|
296
|
+
lighthouse_forecast_manual: z.object({
|
|
289
297
|
id: z.number().int(),
|
|
290
298
|
remainingItems: z.number().int().optional(),
|
|
291
299
|
targetDate: isoDateStringSchema.optional()
|
|
292
300
|
}),
|
|
293
|
-
|
|
301
|
+
lighthouse_forecast_backtest: z.object({
|
|
294
302
|
id: z.number().int(),
|
|
295
303
|
startDate: isoDateStringSchema,
|
|
296
304
|
endDate: isoDateStringSchema,
|
|
@@ -298,12 +306,12 @@ var toolInputSchemas = {
|
|
|
298
306
|
historicalEndDate: isoDateStringSchema
|
|
299
307
|
})
|
|
300
308
|
};
|
|
301
|
-
var isReadOnlyTool = (toolName) => !toolName.endsWith("
|
|
309
|
+
var isReadOnlyTool = (toolName) => !toolName.endsWith("_refresh");
|
|
302
310
|
var createMcpCoreRuntime = (dependencies) => ({
|
|
303
311
|
listTools: () => toolDefinitions,
|
|
304
312
|
callTool: async (name, argumentsPayload) => {
|
|
305
313
|
const client = dependencies.createClient();
|
|
306
|
-
if (name === "
|
|
314
|
+
if (name === "lighthouse_health_check") {
|
|
307
315
|
const health = await client.checkConnectivity();
|
|
308
316
|
if (health.category === "success") {
|
|
309
317
|
return getSuccessToolResult("connectivity: success");
|
|
@@ -313,7 +321,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
313
321
|
`connectivity: ${health.category}${healthReasonSuffix}`
|
|
314
322
|
);
|
|
315
323
|
}
|
|
316
|
-
if (name === "
|
|
324
|
+
if (name === "lighthouse_version_get") {
|
|
317
325
|
const version = await client.getVersion();
|
|
318
326
|
if (version.ok) {
|
|
319
327
|
return getSuccessToolResult(`version: ${version.value}`);
|
|
@@ -322,18 +330,18 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
322
330
|
`version: ${version.error.category} (${version.error.reason})`
|
|
323
331
|
);
|
|
324
332
|
}
|
|
325
|
-
if (name === "
|
|
333
|
+
if (name === "lighthouse_worktracking_list") {
|
|
326
334
|
const connections = await client.listWorkTrackingConnections();
|
|
327
335
|
if (connections.ok) {
|
|
328
336
|
return getSuccessToolResult(
|
|
329
|
-
`worktracking: ${
|
|
337
|
+
`worktracking: ${encodePayload(connections.value)}`
|
|
330
338
|
);
|
|
331
339
|
}
|
|
332
340
|
return getErrorToolResult(
|
|
333
341
|
`worktracking: ${connections.error.category} (${connections.error.reason})`
|
|
334
342
|
);
|
|
335
343
|
}
|
|
336
|
-
if (name === "
|
|
344
|
+
if (name === "lighthouse_worktracking_get") {
|
|
337
345
|
const id = getNumericId(argumentsPayload);
|
|
338
346
|
if (id === null) {
|
|
339
347
|
return getErrorToolResult("worktracking: invalid id");
|
|
@@ -341,36 +349,36 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
341
349
|
const connection = await client.getWorkTrackingConnection(id);
|
|
342
350
|
if (connection.ok) {
|
|
343
351
|
return getSuccessToolResult(
|
|
344
|
-
`worktracking: ${
|
|
352
|
+
`worktracking: ${encodePayload(connection.value)}`
|
|
345
353
|
);
|
|
346
354
|
}
|
|
347
355
|
return getErrorToolResult(
|
|
348
356
|
`worktracking: ${connection.error.category} (${connection.error.reason})`
|
|
349
357
|
);
|
|
350
358
|
}
|
|
351
|
-
if (name === "
|
|
359
|
+
if (name === "lighthouse_team_list") {
|
|
352
360
|
const teams = await client.listTeams();
|
|
353
361
|
if (teams.ok) {
|
|
354
|
-
return getSuccessToolResult(`teams: ${
|
|
362
|
+
return getSuccessToolResult(`teams: ${encodePayload(teams.value)}`);
|
|
355
363
|
}
|
|
356
364
|
return getErrorToolResult(
|
|
357
365
|
`teams: ${teams.error.category} (${teams.error.reason})`
|
|
358
366
|
);
|
|
359
367
|
}
|
|
360
|
-
if (name === "
|
|
368
|
+
if (name === "lighthouse_team_get") {
|
|
361
369
|
const id = getNumericId(argumentsPayload);
|
|
362
370
|
if (id === null) {
|
|
363
371
|
return getErrorToolResult("team: invalid id");
|
|
364
372
|
}
|
|
365
373
|
const team = await client.getTeam(id);
|
|
366
374
|
if (team.ok) {
|
|
367
|
-
return getSuccessToolResult(`team: ${
|
|
375
|
+
return getSuccessToolResult(`team: ${encodePayload(team.value)}`);
|
|
368
376
|
}
|
|
369
377
|
return getErrorToolResult(
|
|
370
378
|
`team: ${team.error.category} (${team.error.reason})`
|
|
371
379
|
);
|
|
372
380
|
}
|
|
373
|
-
if (name === "
|
|
381
|
+
if (name === "lighthouse_team_refresh") {
|
|
374
382
|
const id = getNumericId(argumentsPayload);
|
|
375
383
|
if (id === null) {
|
|
376
384
|
return getErrorToolResult("team: invalid id");
|
|
@@ -383,18 +391,18 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
383
391
|
`team refresh: ${result.error.category} (${result.error.reason})`
|
|
384
392
|
);
|
|
385
393
|
}
|
|
386
|
-
if (name === "
|
|
394
|
+
if (name === "lighthouse_portfolio_list") {
|
|
387
395
|
const portfolios = await client.listPortfolios();
|
|
388
396
|
if (portfolios.ok) {
|
|
389
397
|
return getSuccessToolResult(
|
|
390
|
-
`portfolios: ${
|
|
398
|
+
`portfolios: ${encodePayload(portfolios.value)}`
|
|
391
399
|
);
|
|
392
400
|
}
|
|
393
401
|
return getErrorToolResult(
|
|
394
402
|
`portfolios: ${portfolios.error.category} (${portfolios.error.reason})`
|
|
395
403
|
);
|
|
396
404
|
}
|
|
397
|
-
if (name === "
|
|
405
|
+
if (name === "lighthouse_portfolio_get") {
|
|
398
406
|
const id = getNumericId(argumentsPayload);
|
|
399
407
|
if (id === null) {
|
|
400
408
|
return getErrorToolResult("portfolio: invalid id");
|
|
@@ -402,14 +410,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
402
410
|
const portfolio = await client.getPortfolio(id);
|
|
403
411
|
if (portfolio.ok) {
|
|
404
412
|
return getSuccessToolResult(
|
|
405
|
-
`portfolio: ${
|
|
413
|
+
`portfolio: ${encodePayload(portfolio.value)}`
|
|
406
414
|
);
|
|
407
415
|
}
|
|
408
416
|
return getErrorToolResult(
|
|
409
417
|
`portfolio: ${portfolio.error.category} (${portfolio.error.reason})`
|
|
410
418
|
);
|
|
411
419
|
}
|
|
412
|
-
if (name === "
|
|
420
|
+
if (name === "lighthouse_portfolio_refresh") {
|
|
413
421
|
const id = getNumericId(argumentsPayload);
|
|
414
422
|
if (id === null) {
|
|
415
423
|
return getErrorToolResult("portfolio: invalid id");
|
|
@@ -422,7 +430,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
422
430
|
`portfolio refresh: ${result.error.category} (${result.error.reason})`
|
|
423
431
|
);
|
|
424
432
|
}
|
|
425
|
-
if (name === "
|
|
433
|
+
if (name === "lighthouse_team_metrics_throughput") {
|
|
426
434
|
const id = getNumericId(argumentsPayload);
|
|
427
435
|
if (id === null) {
|
|
428
436
|
return getErrorToolResult("team metrics: invalid id");
|
|
@@ -431,14 +439,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
431
439
|
const result = await client.getTeamThroughput(id, range);
|
|
432
440
|
if (result.ok) {
|
|
433
441
|
return getSuccessToolResult(
|
|
434
|
-
`team throughput: ${
|
|
442
|
+
`team throughput: ${encodePayload(result.value)}`
|
|
435
443
|
);
|
|
436
444
|
}
|
|
437
445
|
return getErrorToolResult(
|
|
438
446
|
`team metrics: ${result.error.category} (${result.error.reason})`
|
|
439
447
|
);
|
|
440
448
|
}
|
|
441
|
-
if (name === "
|
|
449
|
+
if (name === "lighthouse_team_metrics_cycleTimePercentiles") {
|
|
442
450
|
const id = getNumericId(argumentsPayload);
|
|
443
451
|
if (id === null) {
|
|
444
452
|
return getErrorToolResult("team metrics: invalid id");
|
|
@@ -447,14 +455,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
447
455
|
const result = await client.getTeamCycleTimePercentiles(id, range);
|
|
448
456
|
if (result.ok) {
|
|
449
457
|
return getSuccessToolResult(
|
|
450
|
-
`team cycleTimePercentiles: ${
|
|
458
|
+
`team cycleTimePercentiles: ${encodePayload(result.value)}`
|
|
451
459
|
);
|
|
452
460
|
}
|
|
453
461
|
return getErrorToolResult(
|
|
454
462
|
`team metrics: ${result.error.category} (${result.error.reason})`
|
|
455
463
|
);
|
|
456
464
|
}
|
|
457
|
-
if (name === "
|
|
465
|
+
if (name === "lighthouse_portfolio_metrics_throughput") {
|
|
458
466
|
const id = getNumericId(argumentsPayload);
|
|
459
467
|
if (id === null) {
|
|
460
468
|
return getErrorToolResult("portfolio metrics: invalid id");
|
|
@@ -463,14 +471,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
463
471
|
const result = await client.getPortfolioThroughput(id, range);
|
|
464
472
|
if (result.ok) {
|
|
465
473
|
return getSuccessToolResult(
|
|
466
|
-
`portfolio throughput: ${
|
|
474
|
+
`portfolio throughput: ${encodePayload(result.value)}`
|
|
467
475
|
);
|
|
468
476
|
}
|
|
469
477
|
return getErrorToolResult(
|
|
470
478
|
`portfolio metrics: ${result.error.category} (${result.error.reason})`
|
|
471
479
|
);
|
|
472
480
|
}
|
|
473
|
-
if (name === "
|
|
481
|
+
if (name === "lighthouse_feature_get") {
|
|
474
482
|
const payload = isObjectRecord(argumentsPayload) ? argumentsPayload : {};
|
|
475
483
|
const idsValue = payload.ids;
|
|
476
484
|
const refsValue = payload.refs;
|
|
@@ -479,7 +487,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
479
487
|
const result = await client.getFeaturesByIds(ids);
|
|
480
488
|
if (result.ok) {
|
|
481
489
|
return getSuccessToolResult(
|
|
482
|
-
`features: ${
|
|
490
|
+
`features: ${encodePayload(result.value)}`
|
|
483
491
|
);
|
|
484
492
|
}
|
|
485
493
|
return getErrorToolResult(
|
|
@@ -493,7 +501,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
493
501
|
const result = await client.getFeaturesByReferences(refs);
|
|
494
502
|
if (result.ok) {
|
|
495
503
|
return getSuccessToolResult(
|
|
496
|
-
`features: ${
|
|
504
|
+
`features: ${encodePayload(result.value)}`
|
|
497
505
|
);
|
|
498
506
|
}
|
|
499
507
|
return getErrorToolResult(
|
|
@@ -504,7 +512,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
504
512
|
"features: provide ids (array of numbers) or refs (array of strings)"
|
|
505
513
|
);
|
|
506
514
|
}
|
|
507
|
-
if (name === "
|
|
515
|
+
if (name === "lighthouse_feature_workitems") {
|
|
508
516
|
const id = getNumericId(argumentsPayload);
|
|
509
517
|
if (id === null) {
|
|
510
518
|
return getErrorToolResult("feature workitems: invalid id");
|
|
@@ -512,14 +520,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
512
520
|
const result = await client.getFeatureWorkItems(id);
|
|
513
521
|
if (result.ok) {
|
|
514
522
|
return getSuccessToolResult(
|
|
515
|
-
`feature workitems: ${
|
|
523
|
+
`feature workitems: ${encodePayload(result.value)}`
|
|
516
524
|
);
|
|
517
525
|
}
|
|
518
526
|
return getErrorToolResult(
|
|
519
527
|
`feature workitems: ${result.error.category} (${result.error.reason})`
|
|
520
528
|
);
|
|
521
529
|
}
|
|
522
|
-
if (name === "
|
|
530
|
+
if (name === "lighthouse_delivery_list") {
|
|
523
531
|
const id = getNumericId(argumentsPayload);
|
|
524
532
|
if (id === null) {
|
|
525
533
|
return getErrorToolResult(
|
|
@@ -529,14 +537,14 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
529
537
|
const result = await client.listDeliveries(id);
|
|
530
538
|
if (result.ok) {
|
|
531
539
|
return getSuccessToolResult(
|
|
532
|
-
`deliveries: ${
|
|
540
|
+
`deliveries: ${encodePayload(result.value)}`
|
|
533
541
|
);
|
|
534
542
|
}
|
|
535
543
|
return getErrorToolResult(
|
|
536
544
|
`delivery: ${result.error.category} (${result.error.reason})`
|
|
537
545
|
);
|
|
538
546
|
}
|
|
539
|
-
if (name === "
|
|
547
|
+
if (name === "lighthouse_forecast_manual") {
|
|
540
548
|
const id = getNumericId(argumentsPayload);
|
|
541
549
|
if (id === null) {
|
|
542
550
|
return getErrorToolResult("forecast: invalid id (team id required)");
|
|
@@ -549,15 +557,13 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
549
557
|
targetDate
|
|
550
558
|
});
|
|
551
559
|
if (result.ok) {
|
|
552
|
-
return getSuccessToolResult(
|
|
553
|
-
`forecast: ${JSON.stringify(result.value)}`
|
|
554
|
-
);
|
|
560
|
+
return getSuccessToolResult(`forecast: ${encodePayload(result.value)}`);
|
|
555
561
|
}
|
|
556
562
|
return getErrorToolResult(
|
|
557
563
|
`forecast: ${result.error.category} (${result.error.reason})`
|
|
558
564
|
);
|
|
559
565
|
}
|
|
560
|
-
if (name === "
|
|
566
|
+
if (name === "lighthouse_forecast_backtest") {
|
|
561
567
|
const id = getNumericId(argumentsPayload);
|
|
562
568
|
if (id === null) {
|
|
563
569
|
return getErrorToolResult("backtest: invalid id (team id required)");
|
|
@@ -579,9 +585,7 @@ var createMcpCoreRuntime = (dependencies) => ({
|
|
|
579
585
|
historicalEndDate
|
|
580
586
|
});
|
|
581
587
|
if (result.ok) {
|
|
582
|
-
return getSuccessToolResult(
|
|
583
|
-
`backtest: ${JSON.stringify(result.value)}`
|
|
584
|
-
);
|
|
588
|
+
return getSuccessToolResult(`backtest: ${encodePayload(result.value)}`);
|
|
585
589
|
}
|
|
586
590
|
return getErrorToolResult(
|
|
587
591
|
`backtest: ${result.error.category} (${result.error.reason})`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letpeoplework/lighthouse-mcp-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Shared MCP semantics for Lighthouse",
|
|
5
5
|
"repository": "https://github.com/LetPeopleWork/lighthouse-clients",
|
|
6
6
|
"type": "module",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
27
|
+
"@toon-format/toon": "^2.1.0",
|
|
27
28
|
"zod": "^3.24.1",
|
|
28
29
|
"@letpeoplework/lighthouse-client": "0.8.0"
|
|
29
30
|
},
|