@burdenoff/mcp-libs 2026.1110.6 → 2026.1110.8
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/modules/adaptercloud/index.cjs +14 -6
- package/dist/modules/adaptercloud/index.cjs.map +1 -1
- package/dist/modules/adaptercloud/index.js +14 -6
- package/dist/modules/adaptercloud/index.js.map +1 -1
- package/dist/modules/proserviceworld/index.cjs +257 -0
- package/dist/modules/proserviceworld/index.cjs.map +1 -1
- package/dist/modules/proserviceworld/index.js +257 -0
- package/dist/modules/proserviceworld/index.js.map +1 -1
- package/dist/modules/proserviceworld/operations.d.ts +9 -0
- package/dist/modules/proserviceworld/tools/custom-fields.d.ts +3 -0
- package/package.json +1 -1
|
@@ -273,6 +273,70 @@ const HEALTH = `
|
|
|
273
273
|
pswHealth
|
|
274
274
|
}
|
|
275
275
|
`;
|
|
276
|
+
const CUSTOM_FIELD_DEFINITION_FIELDS = `
|
|
277
|
+
id workspaceId entityType key label type options required sortOrder isActive
|
|
278
|
+
createdAt updatedAt
|
|
279
|
+
`;
|
|
280
|
+
const CUSTOM_FIELD_VALUE_FIELDS = `
|
|
281
|
+
id workspaceId definitionId entityId value createdAt updatedAt
|
|
282
|
+
`;
|
|
283
|
+
const LIST_CUSTOM_FIELD_DEFINITIONS = `
|
|
284
|
+
query PswListCustomFieldDefinitions(
|
|
285
|
+
$entityType: PswCustomFieldEntityType
|
|
286
|
+
$includeInactive: Boolean
|
|
287
|
+
$pagination: PaginationInput
|
|
288
|
+
) {
|
|
289
|
+
pswListCustomFieldDefinitions(
|
|
290
|
+
entityType: $entityType
|
|
291
|
+
includeInactive: $includeInactive
|
|
292
|
+
pagination: $pagination
|
|
293
|
+
) {
|
|
294
|
+
items { ${CUSTOM_FIELD_DEFINITION_FIELDS} }
|
|
295
|
+
${PAGE_INFO}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
`;
|
|
299
|
+
const CREATE_CUSTOM_FIELD_DEFINITION = `
|
|
300
|
+
mutation PswCreateCustomFieldDefinition($input: PswCreateCustomFieldDefinitionInput!) {
|
|
301
|
+
pswCreateCustomFieldDefinition(input: $input) {
|
|
302
|
+
${CUSTOM_FIELD_DEFINITION_FIELDS}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
`;
|
|
306
|
+
const UPDATE_CUSTOM_FIELD_DEFINITION = `
|
|
307
|
+
mutation PswUpdateCustomFieldDefinition($id: ID!, $input: PswUpdateCustomFieldDefinitionInput!) {
|
|
308
|
+
pswUpdateCustomFieldDefinition(id: $id, input: $input) {
|
|
309
|
+
${CUSTOM_FIELD_DEFINITION_FIELDS}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
`;
|
|
313
|
+
const DELETE_CUSTOM_FIELD_DEFINITION = `
|
|
314
|
+
mutation PswDeleteCustomFieldDefinition($id: ID!) {
|
|
315
|
+
pswDeleteCustomFieldDefinition(id: $id) {
|
|
316
|
+
${CUSTOM_FIELD_DEFINITION_FIELDS}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
`;
|
|
320
|
+
const LIST_CUSTOM_FIELD_VALUES = `
|
|
321
|
+
query PswListCustomFieldValues($entityType: PswCustomFieldEntityType!, $entityId: ID!) {
|
|
322
|
+
pswListCustomFieldValues(entityType: $entityType, entityId: $entityId) {
|
|
323
|
+
${CUSTOM_FIELD_VALUE_FIELDS}
|
|
324
|
+
definition { ${CUSTOM_FIELD_DEFINITION_FIELDS} }
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
`;
|
|
328
|
+
const SET_CUSTOM_FIELD_VALUE = `
|
|
329
|
+
mutation PswSetCustomFieldValue($input: PswSetCustomFieldValueInput!) {
|
|
330
|
+
pswSetCustomFieldValue(input: $input) {
|
|
331
|
+
${CUSTOM_FIELD_VALUE_FIELDS}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
`;
|
|
335
|
+
const CLEAR_CUSTOM_FIELD_VALUE = `
|
|
336
|
+
mutation PswClearCustomFieldValue($definitionId: ID!, $entityId: ID!) {
|
|
337
|
+
pswClearCustomFieldValue(definitionId: $definitionId, entityId: $entityId)
|
|
338
|
+
}
|
|
339
|
+
`;
|
|
276
340
|
|
|
277
341
|
// src/modules/proserviceworld/tools/shared.ts
|
|
278
342
|
/**
|
|
@@ -480,6 +544,198 @@ function registerClientTools(server, ctx, track) {
|
|
|
480
544
|
});
|
|
481
545
|
}
|
|
482
546
|
|
|
547
|
+
// src/modules/proserviceworld/tools/custom-fields.ts
|
|
548
|
+
/**
|
|
549
|
+
* ProServiceWorld custom-field tools (BOFF-5883).
|
|
550
|
+
*
|
|
551
|
+
* Surface (7): custom_fields_{list,create,update,delete,values_get,set_value,clear_value}.
|
|
552
|
+
* Maps to the real root fields pswListCustomFieldDefinitions /
|
|
553
|
+
* pswCreateCustomFieldDefinition / pswUpdateCustomFieldDefinition /
|
|
554
|
+
* pswDeleteCustomFieldDefinition / pswListCustomFieldValues /
|
|
555
|
+
* pswSetCustomFieldValue / pswClearCustomFieldValue.
|
|
556
|
+
*
|
|
557
|
+
* Definitions are the firm's per-entity-type field schemas (client,
|
|
558
|
+
* engagement, matter); values are the typed JSON payloads set against
|
|
559
|
+
* individual entities and validated against the definition's type by the
|
|
560
|
+
* backend.
|
|
561
|
+
*/
|
|
562
|
+
const CustomFieldEntityTypeEnum = z.enum([
|
|
563
|
+
"CLIENT",
|
|
564
|
+
"ENGAGEMENT",
|
|
565
|
+
"MATTER"
|
|
566
|
+
]);
|
|
567
|
+
const CustomFieldTypeEnum = z.enum([
|
|
568
|
+
"TEXT",
|
|
569
|
+
"NUMBER",
|
|
570
|
+
"DATE",
|
|
571
|
+
"SINGLE_SELECT",
|
|
572
|
+
"MULTI_SELECT",
|
|
573
|
+
"BOOLEAN",
|
|
574
|
+
"URL"
|
|
575
|
+
]);
|
|
576
|
+
function registerCustomFieldTools(server, ctx, track) {
|
|
577
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_list")), {
|
|
578
|
+
title: "List Custom Field Definitions",
|
|
579
|
+
description: "List the firm's custom field definitions, optionally filtered by entity type (CLIENT, ENGAGEMENT, MATTER). Active definitions only unless includeInactive is set.",
|
|
580
|
+
inputSchema: {
|
|
581
|
+
entityType: CustomFieldEntityTypeEnum.optional().describe("Filter by entity type"),
|
|
582
|
+
includeInactive: z.boolean().optional().describe("Also return deactivated definitions"),
|
|
583
|
+
limit: z.number().int().optional().describe("Page size (default 50)"),
|
|
584
|
+
offset: z.number().int().optional().describe("Pagination offset (default 0)")
|
|
585
|
+
}
|
|
586
|
+
}, async ({ entityType, includeInactive, limit, offset }) => {
|
|
587
|
+
try {
|
|
588
|
+
const data = await ctx.gql.workspace.request(LIST_CUSTOM_FIELD_DEFINITIONS, {
|
|
589
|
+
entityType,
|
|
590
|
+
includeInactive,
|
|
591
|
+
pagination: {
|
|
592
|
+
limit: limit ?? 50,
|
|
593
|
+
offset: offset ?? 0
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
return jsonResult(data.pswListCustomFieldDefinitions);
|
|
597
|
+
} catch (error) {
|
|
598
|
+
ctx.logger.error("proserviceworld custom_fields_list failed", { error: String(error) });
|
|
599
|
+
return errorResult(`Failed to list custom field definitions: ${error instanceof Error ? error.message : String(error)}`);
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_create")), {
|
|
603
|
+
title: "Create Custom Field Definition",
|
|
604
|
+
description: "Define a new custom field for an entity type. key is the stable machine name (letters, numbers, underscores). options is required for SINGLE_SELECT / MULTI_SELECT and forbidden for other types.",
|
|
605
|
+
inputSchema: {
|
|
606
|
+
entityType: CustomFieldEntityTypeEnum.describe("Entity type the field applies to"),
|
|
607
|
+
key: z.string().describe("Stable machine name, e.g. tax_region"),
|
|
608
|
+
label: z.string().describe("Display label"),
|
|
609
|
+
type: CustomFieldTypeEnum.describe("Value type"),
|
|
610
|
+
options: z.array(z.string()).optional().describe("Allowed options (select types only)"),
|
|
611
|
+
required: z.boolean().optional().describe("Whether the field is required"),
|
|
612
|
+
sortOrder: z.number().int().optional().describe("Display order")
|
|
613
|
+
}
|
|
614
|
+
}, async ({ entityType, key, label, type, options, required, sortOrder }) => {
|
|
615
|
+
try {
|
|
616
|
+
const data = await ctx.gql.workspace.request(CREATE_CUSTOM_FIELD_DEFINITION, { input: {
|
|
617
|
+
entityType,
|
|
618
|
+
key,
|
|
619
|
+
label,
|
|
620
|
+
type,
|
|
621
|
+
options,
|
|
622
|
+
required,
|
|
623
|
+
sortOrder
|
|
624
|
+
} });
|
|
625
|
+
return jsonResult(data.pswCreateCustomFieldDefinition);
|
|
626
|
+
} catch (error) {
|
|
627
|
+
ctx.logger.error("proserviceworld custom_fields_create failed", { error: String(error) });
|
|
628
|
+
return errorResult(`Failed to create custom field definition: ${error instanceof Error ? error.message : String(error)}`);
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_update")), {
|
|
632
|
+
title: "Update Custom Field Definition",
|
|
633
|
+
description: "Update a custom field definition (label, options, required, sortOrder, isActive). The key, type and entity type are immutable after creation.",
|
|
634
|
+
inputSchema: {
|
|
635
|
+
id: z.string().describe("Definition ID"),
|
|
636
|
+
label: z.string().optional().describe("New display label"),
|
|
637
|
+
options: z.array(z.string()).optional().describe("New allowed options (select types only)"),
|
|
638
|
+
required: z.boolean().optional().describe("Whether the field is required"),
|
|
639
|
+
sortOrder: z.number().int().optional().describe("Display order"),
|
|
640
|
+
isActive: z.boolean().optional().describe("Activate / deactivate the field")
|
|
641
|
+
}
|
|
642
|
+
}, async ({ id, label, options, required, sortOrder, isActive }) => {
|
|
643
|
+
try {
|
|
644
|
+
const data = await ctx.gql.workspace.request(UPDATE_CUSTOM_FIELD_DEFINITION, {
|
|
645
|
+
id,
|
|
646
|
+
input: {
|
|
647
|
+
label,
|
|
648
|
+
options,
|
|
649
|
+
required,
|
|
650
|
+
sortOrder,
|
|
651
|
+
isActive
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
return jsonResult(data.pswUpdateCustomFieldDefinition);
|
|
655
|
+
} catch (error) {
|
|
656
|
+
ctx.logger.error("proserviceworld custom_fields_update failed", { error: String(error) });
|
|
657
|
+
return errorResult(`Failed to update custom field definition: ${error instanceof Error ? error.message : String(error)}`);
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_delete")), {
|
|
661
|
+
title: "Delete Custom Field Definition",
|
|
662
|
+
description: "Soft-delete a custom field definition. Existing values are no longer returned once the definition is deleted.",
|
|
663
|
+
inputSchema: { id: z.string().describe("Definition ID") }
|
|
664
|
+
}, async ({ id }) => {
|
|
665
|
+
try {
|
|
666
|
+
const data = await ctx.gql.workspace.request(DELETE_CUSTOM_FIELD_DEFINITION, { id });
|
|
667
|
+
return jsonResult(data.pswDeleteCustomFieldDefinition);
|
|
668
|
+
} catch (error) {
|
|
669
|
+
ctx.logger.error("proserviceworld custom_fields_delete failed", { error: String(error) });
|
|
670
|
+
return errorResult(`Failed to delete custom field definition: ${error instanceof Error ? error.message : String(error)}`);
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_values_get")), {
|
|
674
|
+
title: "Get Custom Field Values",
|
|
675
|
+
description: "Fetch the custom field values set on one entity (client, engagement or matter), including each value's definition.",
|
|
676
|
+
inputSchema: {
|
|
677
|
+
entityType: CustomFieldEntityTypeEnum.describe("Entity type"),
|
|
678
|
+
entityId: z.string().describe("Entity ID")
|
|
679
|
+
}
|
|
680
|
+
}, async ({ entityType, entityId }) => {
|
|
681
|
+
try {
|
|
682
|
+
const data = await ctx.gql.workspace.request(LIST_CUSTOM_FIELD_VALUES, {
|
|
683
|
+
entityType,
|
|
684
|
+
entityId
|
|
685
|
+
});
|
|
686
|
+
return jsonResult(data.pswListCustomFieldValues);
|
|
687
|
+
} catch (error) {
|
|
688
|
+
ctx.logger.error("proserviceworld custom_fields_values_get failed", { error: String(error) });
|
|
689
|
+
return errorResult(`Failed to get custom field values: ${error instanceof Error ? error.message : String(error)}`);
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_set_value")), {
|
|
693
|
+
title: "Set Custom Field Value",
|
|
694
|
+
description: "Set (or overwrite) a custom field value on an entity. The value is validated against the definition type: text/number/ISO-date/boolean/URL scalars, an option string for SINGLE_SELECT, or a list of option strings for MULTI_SELECT.",
|
|
695
|
+
inputSchema: {
|
|
696
|
+
definitionId: z.string().describe("Custom field definition ID"),
|
|
697
|
+
entityId: z.string().describe("Entity ID (client, engagement or matter)"),
|
|
698
|
+
value: z.union([
|
|
699
|
+
z.string(),
|
|
700
|
+
z.number(),
|
|
701
|
+
z.boolean(),
|
|
702
|
+
z.array(z.string())
|
|
703
|
+
]).describe("Value matching the definition type")
|
|
704
|
+
}
|
|
705
|
+
}, async ({ definitionId, entityId, value }) => {
|
|
706
|
+
try {
|
|
707
|
+
const data = await ctx.gql.workspace.request(SET_CUSTOM_FIELD_VALUE, { input: {
|
|
708
|
+
definitionId,
|
|
709
|
+
entityId,
|
|
710
|
+
value
|
|
711
|
+
} });
|
|
712
|
+
return jsonResult(data.pswSetCustomFieldValue);
|
|
713
|
+
} catch (error) {
|
|
714
|
+
ctx.logger.error("proserviceworld custom_fields_set_value failed", { error: String(error) });
|
|
715
|
+
return errorResult(`Failed to set custom field value: ${error instanceof Error ? error.message : String(error)}`);
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
server.registerTool(track(mcpToolName(ctx.productName, "custom_fields_clear_value")), {
|
|
719
|
+
title: "Clear Custom Field Value",
|
|
720
|
+
description: "Remove a custom field value from an entity.",
|
|
721
|
+
inputSchema: {
|
|
722
|
+
definitionId: z.string().describe("Custom field definition ID"),
|
|
723
|
+
entityId: z.string().describe("Entity ID")
|
|
724
|
+
}
|
|
725
|
+
}, async ({ definitionId, entityId }) => {
|
|
726
|
+
try {
|
|
727
|
+
const data = await ctx.gql.workspace.request(CLEAR_CUSTOM_FIELD_VALUE, {
|
|
728
|
+
definitionId,
|
|
729
|
+
entityId
|
|
730
|
+
});
|
|
731
|
+
return jsonResult({ cleared: data.pswClearCustomFieldValue });
|
|
732
|
+
} catch (error) {
|
|
733
|
+
ctx.logger.error("proserviceworld custom_fields_clear_value failed", { error: String(error) });
|
|
734
|
+
return errorResult(`Failed to clear custom field value: ${error instanceof Error ? error.message : String(error)}`);
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
|
|
483
739
|
// src/modules/proserviceworld/tools/engagements.ts
|
|
484
740
|
/**
|
|
485
741
|
* ProServiceWorld engagement tools — the proposal→delivery lifecycle.
|
|
@@ -1291,6 +1547,7 @@ const proserviceworldModule = {
|
|
|
1291
1547
|
registerPracticeTools(server, ctx, trackTool);
|
|
1292
1548
|
registerHealthTools(server, ctx, trackTool);
|
|
1293
1549
|
registerPrecedentTools(server, ctx, trackTool);
|
|
1550
|
+
registerCustomFieldTools(server, ctx, trackTool);
|
|
1294
1551
|
registerProserviceworldResources(server, ctx, trackResource);
|
|
1295
1552
|
registerProserviceworldPrompts(server, ctx, trackPrompt);
|
|
1296
1553
|
return {
|