@cyanheads/sanctions-screening-mcp-server 0.1.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.
Files changed (110) hide show
  1. package/AGENTS.md +452 -0
  2. package/CLAUDE.md +452 -0
  3. package/Dockerfile +126 -0
  4. package/LICENSE +201 -0
  5. package/README.md +354 -0
  6. package/changelog/0.1.x/0.1.0.md +26 -0
  7. package/changelog/template.md +127 -0
  8. package/dist/config/server-config.d.ts +37 -0
  9. package/dist/config/server-config.d.ts.map +1 -0
  10. package/dist/config/server-config.js +87 -0
  11. package/dist/config/server-config.js.map +1 -0
  12. package/dist/index.d.ts +11 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +70 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/mcp-server/prompts/definitions/index.d.ts +12 -0
  17. package/dist/mcp-server/prompts/definitions/index.d.ts.map +1 -0
  18. package/dist/mcp-server/prompts/definitions/index.js +9 -0
  19. package/dist/mcp-server/prompts/definitions/index.js.map +1 -0
  20. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.d.ts +14 -0
  21. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.d.ts.map +1 -0
  22. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.js +42 -0
  23. package/dist/mcp-server/prompts/definitions/vet-counterparty.prompt.js.map +1 -0
  24. package/dist/mcp-server/resources/definitions/designation.resource.d.ts +25 -0
  25. package/dist/mcp-server/resources/definitions/designation.resource.d.ts.map +1 -0
  26. package/dist/mcp-server/resources/definitions/designation.resource.js +57 -0
  27. package/dist/mcp-server/resources/definitions/designation.resource.js.map +1 -0
  28. package/dist/mcp-server/resources/definitions/entity.resource.d.ts +17 -0
  29. package/dist/mcp-server/resources/definitions/entity.resource.d.ts.map +1 -0
  30. package/dist/mcp-server/resources/definitions/entity.resource.js +40 -0
  31. package/dist/mcp-server/resources/definitions/entity.resource.js.map +1 -0
  32. package/dist/mcp-server/resources/definitions/index.d.ts +32 -0
  33. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
  34. package/dist/mcp-server/resources/definitions/index.js +11 -0
  35. package/dist/mcp-server/resources/definitions/index.js.map +1 -0
  36. package/dist/mcp-server/resources/definitions/sources.resource.d.ts +9 -0
  37. package/dist/mcp-server/resources/definitions/sources.resource.d.ts.map +1 -0
  38. package/dist/mcp-server/resources/definitions/sources.resource.js +50 -0
  39. package/dist/mcp-server/resources/definitions/sources.resource.js.map +1 -0
  40. package/dist/mcp-server/tools/definitions/_shared.d.ts +13 -0
  41. package/dist/mcp-server/tools/definitions/_shared.d.ts.map +1 -0
  42. package/dist/mcp-server/tools/definitions/_shared.js +13 -0
  43. package/dist/mcp-server/tools/definitions/_shared.js.map +1 -0
  44. package/dist/mcp-server/tools/definitions/get-designation.tool.d.ts +78 -0
  45. package/dist/mcp-server/tools/definitions/get-designation.tool.d.ts.map +1 -0
  46. package/dist/mcp-server/tools/definitions/get-designation.tool.js +168 -0
  47. package/dist/mcp-server/tools/definitions/get-designation.tool.js.map +1 -0
  48. package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts +55 -0
  49. package/dist/mcp-server/tools/definitions/get-entity.tool.d.ts.map +1 -0
  50. package/dist/mcp-server/tools/definitions/get-entity.tool.js +176 -0
  51. package/dist/mcp-server/tools/definitions/get-entity.tool.js.map +1 -0
  52. package/dist/mcp-server/tools/definitions/index.d.ts +306 -0
  53. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  54. package/dist/mcp-server/tools/definitions/index.js +21 -0
  55. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  56. package/dist/mcp-server/tools/definitions/list-sources.tool.d.ts +23 -0
  57. package/dist/mcp-server/tools/definitions/list-sources.tool.d.ts.map +1 -0
  58. package/dist/mcp-server/tools/definitions/list-sources.tool.js +106 -0
  59. package/dist/mcp-server/tools/definitions/list-sources.tool.js.map +1 -0
  60. package/dist/mcp-server/tools/definitions/resolve-entity.tool.d.ts +51 -0
  61. package/dist/mcp-server/tools/definitions/resolve-entity.tool.d.ts.map +1 -0
  62. package/dist/mcp-server/tools/definitions/resolve-entity.tool.js +148 -0
  63. package/dist/mcp-server/tools/definitions/resolve-entity.tool.js.map +1 -0
  64. package/dist/mcp-server/tools/definitions/screen-name.tool.d.ts +82 -0
  65. package/dist/mcp-server/tools/definitions/screen-name.tool.d.ts.map +1 -0
  66. package/dist/mcp-server/tools/definitions/screen-name.tool.js +172 -0
  67. package/dist/mcp-server/tools/definitions/screen-name.tool.js.map +1 -0
  68. package/dist/mcp-server/tools/definitions/trace-ownership.tool.d.ts +74 -0
  69. package/dist/mcp-server/tools/definitions/trace-ownership.tool.d.ts.map +1 -0
  70. package/dist/mcp-server/tools/definitions/trace-ownership.tool.js +273 -0
  71. package/dist/mcp-server/tools/definitions/trace-ownership.tool.js.map +1 -0
  72. package/dist/services/screening/fixtures.d.ts +17 -0
  73. package/dist/services/screening/fixtures.d.ts.map +1 -0
  74. package/dist/services/screening/fixtures.js +162 -0
  75. package/dist/services/screening/fixtures.js.map +1 -0
  76. package/dist/services/screening/gleif-ingest.d.ts +68 -0
  77. package/dist/services/screening/gleif-ingest.d.ts.map +1 -0
  78. package/dist/services/screening/gleif-ingest.js +251 -0
  79. package/dist/services/screening/gleif-ingest.js.map +1 -0
  80. package/dist/services/screening/sanctions-ingest.d.ts +46 -0
  81. package/dist/services/screening/sanctions-ingest.d.ts.map +1 -0
  82. package/dist/services/screening/sanctions-ingest.js +688 -0
  83. package/dist/services/screening/sanctions-ingest.js.map +1 -0
  84. package/dist/services/screening/schema.d.ts +52 -0
  85. package/dist/services/screening/schema.d.ts.map +1 -0
  86. package/dist/services/screening/schema.js +125 -0
  87. package/dist/services/screening/schema.js.map +1 -0
  88. package/dist/services/screening/screening-service.d.ts +203 -0
  89. package/dist/services/screening/screening-service.d.ts.map +1 -0
  90. package/dist/services/screening/screening-service.js +702 -0
  91. package/dist/services/screening/screening-service.js.map +1 -0
  92. package/dist/services/screening/text-matching.d.ts +53 -0
  93. package/dist/services/screening/text-matching.d.ts.map +1 -0
  94. package/dist/services/screening/text-matching.js +514 -0
  95. package/dist/services/screening/text-matching.js.map +1 -0
  96. package/dist/services/screening/types.d.ts +154 -0
  97. package/dist/services/screening/types.d.ts.map +1 -0
  98. package/dist/services/screening/types.js +24 -0
  99. package/dist/services/screening/types.js.map +1 -0
  100. package/dist/services/screening/xml.d.ts +29 -0
  101. package/dist/services/screening/xml.d.ts.map +1 -0
  102. package/dist/services/screening/xml.js +46 -0
  103. package/dist/services/screening/xml.js.map +1 -0
  104. package/package.json +119 -0
  105. package/scripts/_mirror-context.ts +21 -0
  106. package/scripts/mirror-init.ts +66 -0
  107. package/scripts/mirror-refresh.ts +56 -0
  108. package/scripts/mirror-seed.ts +36 -0
  109. package/scripts/mirror-verify.ts +44 -0
  110. package/server.json +148 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @fileoverview Barrel collecting all resource definitions into
3
+ * `allResourceDefinitions` for `createApp()`.
4
+ * @module mcp-server/resources/definitions/index
5
+ */
6
+ import { designationResource } from './designation.resource.js';
7
+ import { entityResource } from './entity.resource.js';
8
+ import { sourcesResource } from './sources.resource.js';
9
+ export declare const allResourceDefinitions: (import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
10
+ source: import("zod").ZodEnum<{
11
+ ofac_sdn: "ofac_sdn";
12
+ ofac_consolidated: "ofac_consolidated";
13
+ eu: "eu";
14
+ uk: "uk";
15
+ un: "un";
16
+ }>;
17
+ entryId: import("zod").ZodString;
18
+ }, import("zod/v4/core").$strip>, undefined, readonly [{
19
+ readonly reason: "designation_not_found";
20
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
21
+ readonly when: "No designation exists for the given source + entry ID in the mirror.";
22
+ readonly recovery: "Use sanctions_screen_name to discover valid source/entryId pairs first.";
23
+ }]> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
24
+ lei: import("zod").ZodString;
25
+ }, import("zod/v4/core").$strip>, undefined, readonly [{
26
+ readonly reason: "lei_not_found";
27
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
28
+ readonly when: "No GLEIF entity exists for the given LEI in the mirror.";
29
+ readonly recovery: "Resolve the entity name with sanctions_resolve_entity to obtain a valid LEI first.";
30
+ }]> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, undefined, undefined>)[];
31
+ export { designationResource, entityResource, sourcesResource };
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;6IAAyD,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview Barrel collecting all resource definitions into
3
+ * `allResourceDefinitions` for `createApp()`.
4
+ * @module mcp-server/resources/definitions/index
5
+ */
6
+ import { designationResource } from './designation.resource.js';
7
+ import { entityResource } from './entity.resource.js';
8
+ import { sourcesResource } from './sources.resource.js';
9
+ export const allResourceDefinitions = [designationResource, entityResource, sourcesResource];
10
+ export { designationResource, entityResource, sourcesResource };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,mBAAmB,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @fileoverview `sanctions://sources` — read-only mirror of
3
+ * sanctions_list_sources: loaded lists + GLEIF datasets with counts and refresh
4
+ * timestamps. A small fixed list; no pagination.
5
+ * @module mcp-server/resources/definitions/sources.resource
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ export declare const sourcesResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{}, z.core.$strip>, undefined, undefined>;
9
+ //# sourceMappingURL=sources.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/sources.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAKrD,eAAO,MAAM,eAAe,2GAyC1B,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @fileoverview `sanctions://sources` — read-only mirror of
3
+ * sanctions_list_sources: loaded lists + GLEIF datasets with counts and refresh
4
+ * timestamps. A small fixed list; no pagination.
5
+ * @module mcp-server/resources/definitions/sources.resource
6
+ */
7
+ import { resource, z } from '@cyanheads/mcp-ts-core';
8
+ import { getServerConfig } from '../../../config/server-config.js';
9
+ import { getScreeningService } from '../../../services/screening/screening-service.js';
10
+ import { SOURCE_LABELS } from '../../../services/screening/types.js';
11
+ export const sourcesResource = resource('sanctions://sources', {
12
+ name: 'sanctions-screening-mcp-server: sources',
13
+ title: 'sanctions-screening-mcp-server: sources',
14
+ description: "List the sanctions watchlists and GLEIF datasets currently loaded in the local mirror, each with its record count and the mirror's as-of timestamp — a read-only URI mirror of sanctions_list_sources.",
15
+ mimeType: 'application/json',
16
+ params: z.object({}),
17
+ async handler(_params, _ctx) {
18
+ const svc = getScreeningService();
19
+ const cfg = getServerConfig();
20
+ const [counts, sanctions, lei] = await Promise.all([
21
+ svc.sourceCounts(),
22
+ svc.sanctionsReadiness(),
23
+ svc.leiReadiness(),
24
+ ]);
25
+ return {
26
+ sanctionsReady: sanctions.ready,
27
+ sanctionsAsOf: sanctions.completedAt,
28
+ leiReady: lei.ready,
29
+ leiAsOf: lei.completedAt,
30
+ sources: [
31
+ ...counts.map((s) => ({
32
+ code: s.code,
33
+ label: SOURCE_LABELS[s.code],
34
+ recordCount: s.recordCount,
35
+ })),
36
+ {
37
+ code: 'gleif',
38
+ label: 'GLEIF LEI (Level 1 entities + Level 2 ownership)',
39
+ recordCount: lei.entityCount,
40
+ relationshipCount: lei.relationshipCount,
41
+ },
42
+ ],
43
+ gleifBaseUrl: cfg.gleifGoldenCopyBaseUrl,
44
+ };
45
+ },
46
+ list: () => ({
47
+ resources: [{ uri: 'sanctions://sources', name: 'Loaded sanctions sources' }],
48
+ }),
49
+ });
50
+ //# sourceMappingURL=sources.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/sources.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAmB,MAAM,+BAA+B,CAAC;AAE/E,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,qBAAqB,EAAE;IAC7D,IAAI,EAAE,yCA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CACH,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Shared constants for the sanctions screening tool surface. The
3
+ * decision-support caveat is load-bearing — it appears in every screening tool's
4
+ * output so a consuming model cannot present a fuzzy hit as a verdict.
5
+ * @module mcp-server/tools/definitions/_shared
6
+ */
7
+ /**
8
+ * The decision-support caveat carried in every screening tool's output. States
9
+ * the three load-bearing facts: results are potential matches to verify, a hit
10
+ * is not a finding of fact, and an empty result is not a clearance.
11
+ */
12
+ export declare const SCREENING_CAVEAT = "Screening aid, not a compliance determination. Results are potential matches to verify against the official source \u2014 a hit is not a finding of fact, and an empty result is not a clearance. Real sanctions compliance is a legal process this server feeds, not one it performs.";
13
+ //# sourceMappingURL=_shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2RACwP,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Shared constants for the sanctions screening tool surface. The
3
+ * decision-support caveat is load-bearing — it appears in every screening tool's
4
+ * output so a consuming model cannot present a fuzzy hit as a verdict.
5
+ * @module mcp-server/tools/definitions/_shared
6
+ */
7
+ /**
8
+ * The decision-support caveat carried in every screening tool's output. States
9
+ * the three load-bearing facts: results are potential matches to verify, a hit
10
+ * is not a finding of fact, and an empty result is not a clearance.
11
+ */
12
+ export const SCREENING_CAVEAT = 'Screening aid, not a compliance determination. Results are potential matches to verify against the official source — a hit is not a finding of fact, and an empty result is not a clearance. Real sanctions compliance is a legal process this server feeds, not one it performs.';
13
+ //# sourceMappingURL=_shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,mRAAmR,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @fileoverview `sanctions_get_designation` — the full record for one sanctions
3
+ * entry by source list + entry ID. The drill-in after sanctions_screen_name
4
+ * surfaces a candidate: all aliases, identifiers, addresses, dates/places of
5
+ * birth, nationalities, program, legal basis, and designation date. Still a
6
+ * screening aid — the record is what the source published, not a determination.
7
+ * @module mcp-server/tools/definitions/get-designation.tool
8
+ */
9
+ import { z } from '@cyanheads/mcp-ts-core';
10
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
11
+ export declare const getDesignationTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
12
+ source: z.ZodEnum<{
13
+ ofac_sdn: "ofac_sdn";
14
+ ofac_consolidated: "ofac_consolidated";
15
+ eu: "eu";
16
+ uk: "uk";
17
+ un: "un";
18
+ }>;
19
+ entryId: z.ZodString;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ source: z.ZodEnum<{
22
+ ofac_sdn: "ofac_sdn";
23
+ ofac_consolidated: "ofac_consolidated";
24
+ eu: "eu";
25
+ uk: "uk";
26
+ un: "un";
27
+ }>;
28
+ sourceLabel: z.ZodString;
29
+ sourceEntryId: z.ZodString;
30
+ entityType: z.ZodEnum<{
31
+ unknown: "unknown";
32
+ person: "person";
33
+ organization: "organization";
34
+ vessel: "vessel";
35
+ aircraft: "aircraft";
36
+ }>;
37
+ primaryName: z.ZodString;
38
+ program: z.ZodOptional<z.ZodString>;
39
+ legalBasis: z.ZodOptional<z.ZodString>;
40
+ designationDate: z.ZodOptional<z.ZodString>;
41
+ aliases: z.ZodArray<z.ZodObject<{
42
+ name: z.ZodString;
43
+ nameType: z.ZodEnum<{
44
+ primary: "primary";
45
+ aka: "aka";
46
+ fka: "fka";
47
+ "low-quality-aka": "low-quality-aka";
48
+ }>;
49
+ }, z.core.$strip>>;
50
+ identifiers: z.ZodArray<z.ZodObject<{
51
+ type: z.ZodString;
52
+ value: z.ZodString;
53
+ country: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>>;
55
+ addresses: z.ZodArray<z.ZodObject<{
56
+ full: z.ZodString;
57
+ country: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>>;
59
+ datesOfBirth: z.ZodArray<z.ZodObject<{
60
+ date: z.ZodOptional<z.ZodString>;
61
+ place: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>>;
63
+ nationalities: z.ZodArray<z.ZodString>;
64
+ remarks: z.ZodOptional<z.ZodString>;
65
+ caveat: z.ZodString;
66
+ }, z.core.$strip>, readonly [{
67
+ readonly reason: "designation_not_found";
68
+ readonly code: JsonRpcErrorCode.NotFound;
69
+ readonly when: "No designation exists for the given source + entry ID in the mirror.";
70
+ readonly recovery: "Verify the source and entryId via sanctions_screen_name, which returns the exact sourceEntryId for each hit.";
71
+ }, {
72
+ readonly reason: "mirror_not_ready";
73
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
74
+ readonly when: "The sanctions mirror has never completed an initial sync.";
75
+ readonly retryable: true;
76
+ readonly recovery: "Run the mirror:init lifecycle script to load the sanctions lists, then retry.";
77
+ }], undefined>;
78
+ //# sourceMappingURL=get-designation.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-designation.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-designation.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwK7B,CAAC"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * @fileoverview `sanctions_get_designation` — the full record for one sanctions
3
+ * entry by source list + entry ID. The drill-in after sanctions_screen_name
4
+ * surfaces a candidate: all aliases, identifiers, addresses, dates/places of
5
+ * birth, nationalities, program, legal basis, and designation date. Still a
6
+ * screening aid — the record is what the source published, not a determination.
7
+ * @module mcp-server/tools/definitions/get-designation.tool
8
+ */
9
+ import { tool, z } from '@cyanheads/mcp-ts-core';
10
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
11
+ import { getScreeningService } from '../../../services/screening/screening-service.js';
12
+ import { SOURCE_LABELS } from '../../../services/screening/types.js';
13
+ import { SCREENING_CAVEAT } from './_shared.js';
14
+ export const getDesignationTool = tool('sanctions_get_designation', {
15
+ title: 'sanctions-screening-mcp-server: get designation',
16
+ description: 'Fetch the full record for one sanctions designation by source list + entry ID — the drill-in after sanctions_screen_name surfaces a candidate. Returns all published aliases, identifiers (passport/national-ID/tax), addresses, dates and places of birth, nationalities, sanctioning program, legal basis, and designation date. The record reflects exactly what the source published; missing fields mean the source omitted them. This is a screening aid — the designation record supports a compliance review, it is not itself a determination.',
17
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
18
+ input: z.object({
19
+ source: z
20
+ .enum(['ofac_sdn', 'ofac_consolidated', 'eu', 'uk', 'un'])
21
+ .describe('Which source list the entry belongs to.'),
22
+ entryId: z
23
+ .string()
24
+ .min(1)
25
+ .describe("The source list's own entry ID (the sourceEntryId from sanctions_screen_name)."),
26
+ }),
27
+ output: z.object({
28
+ source: z
29
+ .enum(['ofac_sdn', 'ofac_consolidated', 'eu', 'uk', 'un'])
30
+ .describe('Source list the entry belongs to.'),
31
+ sourceLabel: z.string().describe('Human-readable name of the source list.'),
32
+ sourceEntryId: z.string().describe("The source list's own entry ID."),
33
+ entityType: z
34
+ .enum(['person', 'organization', 'vessel', 'aircraft', 'unknown'])
35
+ .describe('Entity classification as published.'),
36
+ primaryName: z.string().describe('Primary published name.'),
37
+ program: z.string().optional().describe('Sanctioning program / regime, when published.'),
38
+ legalBasis: z.string().optional().describe('Statutory / regulatory basis, when published.'),
39
+ designationDate: z.string().optional().describe('Designation date, when published.'),
40
+ aliases: z
41
+ .array(z
42
+ .object({
43
+ name: z.string().describe('Alias as published.'),
44
+ nameType: z
45
+ .enum(['primary', 'aka', 'fka', 'low-quality-aka'])
46
+ .describe('Alias provenance: a.k.a., f.k.a., or a low-quality a.k.a.'),
47
+ })
48
+ .describe('One published alias.'))
49
+ .describe('All published aliases / name variants.'),
50
+ identifiers: z
51
+ .array(z
52
+ .object({
53
+ type: z.string().describe('Identifier category (e.g. Passport, National ID, Tax ID).'),
54
+ value: z.string().describe('Identifier value as published.'),
55
+ country: z.string().optional().describe('Issuing country/authority, when published.'),
56
+ })
57
+ .describe('One structured identifier.'))
58
+ .describe('Published identifiers (passport, national ID, tax, registration, …).'),
59
+ addresses: z
60
+ .array(z
61
+ .object({
62
+ full: z.string().describe('Single-line rendering of the address.'),
63
+ country: z.string().optional().describe('Country, when published.'),
64
+ })
65
+ .describe('One published address.'))
66
+ .describe('Published addresses.'),
67
+ datesOfBirth: z
68
+ .array(z
69
+ .object({
70
+ date: z.string().optional().describe('Date of birth as published.'),
71
+ place: z.string().optional().describe('Place of birth, when published.'),
72
+ })
73
+ .describe('One date/place of birth.'))
74
+ .describe('Published dates and places of birth (persons).'),
75
+ nationalities: z.array(z.string()).describe('Published nationalities / citizenships.'),
76
+ remarks: z
77
+ .string()
78
+ .optional()
79
+ .describe('Free-form remarks published by the source, when present.'),
80
+ caveat: z
81
+ .string()
82
+ .describe('Decision-support caveat — this is a screening aid, not a compliance determination.'),
83
+ }),
84
+ errors: [
85
+ {
86
+ reason: 'designation_not_found',
87
+ code: JsonRpcErrorCode.NotFound,
88
+ when: 'No designation exists for the given source + entry ID in the mirror.',
89
+ recovery: 'Verify the source and entryId via sanctions_screen_name, which returns the exact sourceEntryId for each hit.',
90
+ },
91
+ {
92
+ reason: 'mirror_not_ready',
93
+ code: JsonRpcErrorCode.ServiceUnavailable,
94
+ when: 'The sanctions mirror has never completed an initial sync.',
95
+ retryable: true,
96
+ recovery: 'Run the mirror:init lifecycle script to load the sanctions lists, then retry.',
97
+ },
98
+ ],
99
+ async handler(input, ctx) {
100
+ const svc = getScreeningService();
101
+ if (!(await svc.sanctionsReady())) {
102
+ throw ctx.fail('mirror_not_ready', 'The local sanctions mirror is not yet populated.', {
103
+ ...ctx.recoveryFor('mirror_not_ready'),
104
+ });
105
+ }
106
+ const d = await svc.getDesignation(input.source, input.entryId);
107
+ if (!d) {
108
+ throw ctx.fail('designation_not_found', `No ${input.source} designation with entry ID "${input.entryId}".`, { ...ctx.recoveryFor('designation_not_found') });
109
+ }
110
+ return {
111
+ source: d.source,
112
+ sourceLabel: SOURCE_LABELS[d.source],
113
+ sourceEntryId: d.sourceEntryId,
114
+ entityType: d.entityType,
115
+ primaryName: d.primaryName,
116
+ ...(d.program ? { program: d.program } : {}),
117
+ ...(d.legalBasis ? { legalBasis: d.legalBasis } : {}),
118
+ ...(d.designationDate ? { designationDate: d.designationDate } : {}),
119
+ aliases: d.payload.aliases,
120
+ identifiers: d.payload.identifiers,
121
+ addresses: d.payload.addresses,
122
+ datesOfBirth: d.payload.datesOfBirth,
123
+ nationalities: d.payload.nationalities,
124
+ ...(d.payload.remarks ? { remarks: d.payload.remarks } : {}),
125
+ caveat: SCREENING_CAVEAT,
126
+ };
127
+ },
128
+ format: (r) => {
129
+ const lines = [`# ${r.primaryName}`, ''];
130
+ lines.push(`**List:** ${r.sourceLabel} (\`${r.source}\`) | **Entry ID:** ${r.sourceEntryId}`);
131
+ lines.push(`**Type:** ${r.entityType}`);
132
+ if (r.program)
133
+ lines.push(`**Program:** ${r.program}`);
134
+ if (r.legalBasis)
135
+ lines.push(`**Legal basis:** ${r.legalBasis}`);
136
+ if (r.designationDate)
137
+ lines.push(`**Designated:** ${r.designationDate}`);
138
+ if (r.aliases.length > 0) {
139
+ lines.push('\n## Aliases');
140
+ for (const a of r.aliases)
141
+ lines.push(`- ${a.name} (${a.nameType})`);
142
+ }
143
+ if (r.identifiers.length > 0) {
144
+ lines.push('\n## Identifiers');
145
+ for (const i of r.identifiers) {
146
+ lines.push(`- **${i.type}:** ${i.value}${i.country ? ` (${i.country})` : ''}`);
147
+ }
148
+ }
149
+ if (r.addresses.length > 0) {
150
+ lines.push('\n## Addresses');
151
+ for (const a of r.addresses)
152
+ lines.push(`- ${a.full}${a.country ? ` — ${a.country}` : ''}`);
153
+ }
154
+ if (r.datesOfBirth.length > 0) {
155
+ lines.push('\n## Dates of birth');
156
+ for (const d of r.datesOfBirth) {
157
+ lines.push(`- ${d.date ?? 'Unknown date'}${d.place ? ` at ${d.place}` : ''}`);
158
+ }
159
+ }
160
+ if (r.nationalities.length > 0)
161
+ lines.push(`\n**Nationalities:** ${r.nationalities.join(', ')}`);
162
+ if (r.remarks)
163
+ lines.push(`\n**Remarks:** ${r.remarks}`);
164
+ lines.push(`\n> ${r.caveat}`);
165
+ return [{ type: 'text', text: lines.join('\n') }];
166
+ },
167
+ });
168
+ //# sourceMappingURL=get-designation.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-designation.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-designation.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAmB,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,2BAA2B,EAAE;IAClE,KAAK,EAAE,iDAAiD;IACxD,WAAW,EACT,yhBAAyhB;IAC3hB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,K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55 @@
1
+ /**
2
+ * @fileoverview `sanctions_get_entity` — the full GLEIF Level 1 record for one
3
+ * LEI, plus any sanctions hits screened against the same legal name. Combines
4
+ * the who-is-who reference data with a cross-reference screen so an agent sees
5
+ * both "who is this entity" and "is its name on a watchlist" in one call.
6
+ * @module mcp-server/tools/definitions/get-entity.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const getEntityTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ lei: z.ZodString;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ lei: z.ZodString;
14
+ legalName: z.ZodString;
15
+ otherNames: z.ZodArray<z.ZodString>;
16
+ jurisdiction: z.ZodOptional<z.ZodString>;
17
+ status: z.ZodOptional<z.ZodString>;
18
+ legalAddress: z.ZodOptional<z.ZodString>;
19
+ headquartersAddress: z.ZodOptional<z.ZodString>;
20
+ registrationAuthorityId: z.ZodOptional<z.ZodString>;
21
+ registrationAuthorityEntityId: z.ZodOptional<z.ZodString>;
22
+ lastUpdate: z.ZodOptional<z.ZodString>;
23
+ sanctionsHits: z.ZodArray<z.ZodObject<{
24
+ source: z.ZodEnum<{
25
+ ofac_sdn: "ofac_sdn";
26
+ ofac_consolidated: "ofac_consolidated";
27
+ eu: "eu";
28
+ uk: "uk";
29
+ un: "un";
30
+ }>;
31
+ sourceLabel: z.ZodString;
32
+ sourceEntryId: z.ZodString;
33
+ primaryName: z.ZodString;
34
+ matchedName: z.ZodString;
35
+ matchType: z.ZodEnum<{
36
+ exact: "exact";
37
+ strong: "strong";
38
+ approximate: "approximate";
39
+ }>;
40
+ score: z.ZodOptional<z.ZodNumber>;
41
+ }, z.core.$strip>>;
42
+ caveat: z.ZodString;
43
+ }, z.core.$strip>, readonly [{
44
+ readonly reason: "lei_not_found";
45
+ readonly code: JsonRpcErrorCode.NotFound;
46
+ readonly when: "No GLEIF entity exists for the given LEI in the mirror.";
47
+ readonly recovery: "Resolve the entity name with sanctions_resolve_entity to obtain a valid LEI first.";
48
+ }, {
49
+ readonly reason: "mirror_not_ready";
50
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
51
+ readonly when: "The GLEIF (LEI) mirror has never completed an initial sync.";
52
+ readonly retryable: true;
53
+ readonly recovery: "Run the mirror:init lifecycle script to load the GLEIF golden copy, then retry.";
54
+ }], undefined>;
55
+ //# sourceMappingURL=get-entity.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-entity.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-entity.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkLxB,CAAC"}