@didit-protocol/mcp-server 3.0.3 → 5.1.33
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/LICENSE +21 -0
- package/README.md +582 -178
- package/dist/audit-log.d.ts +22 -0
- package/dist/audit-log.d.ts.map +1 -0
- package/dist/audit-log.js +77 -0
- package/dist/audit-log.js.map +1 -0
- package/dist/auth/introspection-verifier.d.ts +16 -0
- package/dist/auth/introspection-verifier.d.ts.map +1 -0
- package/dist/auth/introspection-verifier.js +77 -0
- package/dist/auth/introspection-verifier.js.map +1 -0
- package/dist/auth/verifier.d.ts +19 -0
- package/dist/auth/verifier.d.ts.map +1 -0
- package/dist/auth/verifier.js +88 -0
- package/dist/auth/verifier.js.map +1 -0
- package/dist/blank-args.d.ts +10 -0
- package/dist/blank-args.d.ts.map +1 -0
- package/dist/blank-args.js +34 -0
- package/dist/blank-args.js.map +1 -0
- package/dist/chatgpt-app.d.ts +44 -0
- package/dist/chatgpt-app.d.ts.map +1 -0
- package/dist/chatgpt-app.js +52 -0
- package/dist/chatgpt-app.js.map +1 -0
- package/dist/config.d.ts +115 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +251 -15
- package/dist/config.js.map +1 -1
- package/dist/dates.d.ts +2 -0
- package/dist/dates.d.ts.map +1 -0
- package/dist/dates.js +23 -0
- package/dist/dates.js.map +1 -0
- package/dist/feature-config-schema.d.ts +66 -0
- package/dist/feature-config-schema.d.ts.map +1 -0
- package/dist/feature-config-schema.js +192 -0
- package/dist/feature-config-schema.js.map +1 -0
- package/dist/http.d.ts +4 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +230 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +20 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2986 -440
- package/dist/index.js.map +1 -1
- package/dist/internal-tools.d.ts +17 -0
- package/dist/internal-tools.d.ts.map +1 -0
- package/dist/internal-tools.js +26 -0
- package/dist/internal-tools.js.map +1 -0
- package/dist/mcp-modern.d.ts +36 -0
- package/dist/mcp-modern.d.ts.map +1 -0
- package/dist/mcp-modern.js +152 -0
- package/dist/mcp-modern.js.map +1 -0
- package/dist/orgapp.d.ts +34 -0
- package/dist/orgapp.d.ts.map +1 -0
- package/dist/orgapp.js +93 -0
- package/dist/orgapp.js.map +1 -0
- package/dist/permissions.d.ts +24 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +210 -0
- package/dist/permissions.js.map +1 -0
- package/dist/privileged-tools.d.ts +14 -0
- package/dist/privileged-tools.d.ts.map +1 -0
- package/dist/privileged-tools.js +21 -0
- package/dist/privileged-tools.js.map +1 -0
- package/dist/schema/feature-config-schema.json +4446 -0
- package/dist/security.d.ts +168 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +858 -0
- package/dist/security.js.map +1 -0
- package/dist/session-pdf-download.d.ts +8 -0
- package/dist/session-pdf-download.d.ts.map +1 -0
- package/dist/session-pdf-download.js +91 -0
- package/dist/session-pdf-download.js.map +1 -0
- package/dist/tools/analytics.d.ts +13 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +171 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/auth.d.ts +11 -2
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +93 -19
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/billing.d.ts +2 -2
- package/dist/tools/billing.d.ts.map +1 -1
- package/dist/tools/billing.js +38 -12
- package/dist/tools/billing.js.map +1 -1
- package/dist/tools/blocklist.d.ts +2 -1
- package/dist/tools/blocklist.d.ts.map +1 -1
- package/dist/tools/blocklist.js +10 -19
- package/dist/tools/blocklist.js.map +1 -1
- package/dist/tools/businesses.d.ts +7 -0
- package/dist/tools/businesses.d.ts.map +1 -0
- package/dist/tools/businesses.js +57 -0
- package/dist/tools/businesses.js.map +1 -0
- package/dist/tools/cases.d.ts +6 -0
- package/dist/tools/cases.d.ts.map +1 -0
- package/dist/tools/cases.js +63 -0
- package/dist/tools/cases.js.map +1 -0
- package/dist/tools/compliance.d.ts +8 -0
- package/dist/tools/compliance.d.ts.map +1 -0
- package/dist/tools/compliance.js +95 -0
- package/dist/tools/compliance.js.map +1 -0
- package/dist/tools/context.d.ts +2 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +37 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/customization.d.ts +18 -0
- package/dist/tools/customization.d.ts.map +1 -0
- package/dist/tools/customization.js +35 -0
- package/dist/tools/customization.js.map +1 -0
- package/dist/tools/feature-config.d.ts +53 -0
- package/dist/tools/feature-config.d.ts.map +1 -0
- package/dist/tools/feature-config.js +432 -0
- package/dist/tools/feature-config.js.map +1 -0
- package/dist/tools/lists.d.ts +3 -0
- package/dist/tools/lists.d.ts.map +1 -1
- package/dist/tools/lists.js +29 -26
- package/dist/tools/lists.js.map +1 -1
- package/dist/tools/members.d.ts +7 -0
- package/dist/tools/members.d.ts.map +1 -0
- package/dist/tools/members.js +60 -0
- package/dist/tools/members.js.map +1 -0
- package/dist/tools/observability.d.ts +4 -0
- package/dist/tools/observability.d.ts.map +1 -0
- package/dist/tools/observability.js +17 -0
- package/dist/tools/observability.js.map +1 -0
- package/dist/tools/questionnaires.d.ts +61 -3
- package/dist/tools/questionnaires.d.ts.map +1 -1
- package/dist/tools/questionnaires.js +128 -24
- package/dist/tools/questionnaires.js.map +1 -1
- package/dist/tools/reports.d.ts +5 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +89 -0
- package/dist/tools/reports.js.map +1 -0
- package/dist/tools/search.d.ts +30 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +317 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/session-explain-levers.d.ts +17 -0
- package/dist/tools/session-explain-levers.d.ts.map +1 -0
- package/dist/tools/session-explain-levers.js +139 -0
- package/dist/tools/session-explain-levers.js.map +1 -0
- package/dist/tools/session-explain.d.ts +3 -0
- package/dist/tools/session-explain.d.ts.map +1 -0
- package/dist/tools/session-explain.js +180 -0
- package/dist/tools/session-explain.js.map +1 -0
- package/dist/tools/sessions.d.ts +16 -3
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +150 -64
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts +15 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +141 -22
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/standalone.d.ts +9 -6
- package/dist/tools/standalone.d.ts.map +1 -1
- package/dist/tools/standalone.js +47 -102
- package/dist/tools/standalone.js.map +1 -1
- package/dist/tools/transactions.d.ts +14 -0
- package/dist/tools/transactions.d.ts.map +1 -0
- package/dist/tools/transactions.js +93 -0
- package/dist/tools/transactions.js.map +1 -0
- package/dist/tools/users.d.ts +3 -1
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +35 -22
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/webhooks.d.ts +6 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +41 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/tools/workflow-graph.d.ts +65 -0
- package/dist/tools/workflow-graph.d.ts.map +1 -0
- package/dist/tools/workflow-graph.js +686 -0
- package/dist/tools/workflow-graph.js.map +1 -0
- package/package.json +23 -6
package/dist/index.js
CHANGED
|
@@ -34,28 +34,617 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.createServer = createServer;
|
|
37
38
|
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
38
39
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
39
40
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
40
41
|
const auth = __importStar(require("./tools/auth"));
|
|
41
42
|
const sessions = __importStar(require("./tools/sessions"));
|
|
43
|
+
const session_explain_1 = require("./tools/session-explain");
|
|
42
44
|
const settings = __importStar(require("./tools/settings"));
|
|
43
45
|
const billing = __importStar(require("./tools/billing"));
|
|
44
46
|
const users = __importStar(require("./tools/users"));
|
|
47
|
+
const businesses = __importStar(require("./tools/businesses"));
|
|
48
|
+
const transactions = __importStar(require("./tools/transactions"));
|
|
49
|
+
const customization = __importStar(require("./tools/customization"));
|
|
50
|
+
const webhooks = __importStar(require("./tools/webhooks"));
|
|
45
51
|
const questionnaires = __importStar(require("./tools/questionnaires"));
|
|
46
52
|
const lists = __importStar(require("./tools/lists"));
|
|
47
53
|
const standalone = __importStar(require("./tools/standalone"));
|
|
54
|
+
const privileged_tools_1 = require("./privileged-tools");
|
|
55
|
+
const internal_tools_1 = require("./internal-tools");
|
|
56
|
+
const blocklist = __importStar(require("./tools/blocklist"));
|
|
57
|
+
const cases = __importStar(require("./tools/cases"));
|
|
58
|
+
const reports = __importStar(require("./tools/reports"));
|
|
59
|
+
const observability = __importStar(require("./tools/observability"));
|
|
60
|
+
const members = __importStar(require("./tools/members"));
|
|
61
|
+
const context = __importStar(require("./tools/context"));
|
|
62
|
+
const search = __importStar(require("./tools/search"));
|
|
63
|
+
const workflowGraph = __importStar(require("./tools/workflow-graph"));
|
|
64
|
+
const feature_config_schema_1 = require("./feature-config-schema");
|
|
65
|
+
const analytics = __importStar(require("./tools/analytics"));
|
|
66
|
+
const compliance = __importStar(require("./tools/compliance"));
|
|
48
67
|
const config_1 = require("./config");
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
const blank_args_1 = require("./blank-args");
|
|
69
|
+
const chatgpt_app_1 = require("./chatgpt-app");
|
|
70
|
+
const orgapp_1 = require("./orgapp");
|
|
71
|
+
const security_1 = require("./security");
|
|
72
|
+
const audit_log_1 = require("./audit-log");
|
|
73
|
+
const permissions_1 = require("./permissions");
|
|
74
|
+
const SESSION_STATUSES = "Not Started, In Progress, In Review, Approved, Declined, Expired, Abandoned, Kyc Expired, Resubmitted, Awaiting User";
|
|
75
|
+
const LANGUAGE_CODES = [
|
|
76
|
+
"en", "ar", "bg", "bn", "bs", "ca", "cnr", "cs", "da", "de", "el", "es", "et",
|
|
77
|
+
"fa", "fi", "fr", "he", "hi", "hr", "hu", "hy", "id", "it", "ja", "ka", "kk",
|
|
78
|
+
"ko", "ky", "lt", "lv", "mk", "mn", "ms", "nl", "no", "pl", "pt-BR", "pt",
|
|
79
|
+
"ro", "ru", "sk", "sl", "so", "sq", "sr", "sv", "th", "tr", "uk", "uz",
|
|
80
|
+
"vi", "zh-CN", "zh-TW", "zh",
|
|
81
|
+
];
|
|
82
|
+
const DOCUMENT_TYPES = ["P", "DL", "ID", "RP", "SSC", "HIC", "WP", "TC", "VISA", "PSC", "BC", "OTHER"];
|
|
83
|
+
const ENTITY_STATUSES = ["ACTIVE", "FLAGGED", "BLOCKED"];
|
|
84
|
+
const LIST_ENTRY_TYPES = [
|
|
85
|
+
"face", "document", "phone", "email", "ip_address", "device_fingerprint",
|
|
86
|
+
"wallet_address", "bank_account", "user", "business", "country", "key",
|
|
87
|
+
];
|
|
88
|
+
// Real backend FormElementType (questionnaires/config/choices.py) — uppercase.
|
|
89
|
+
const FORM_ELEMENT_TYPES = [
|
|
90
|
+
"SHORT_TEXT", "LONG_TEXT", "PARAGRAPH", "DROPDOWN", "SINGLE_CHOICE", "MULTIPLE_CHOICE",
|
|
91
|
+
"NUMBER", "IMAGE", "FILE_UPLOAD", "TIME", "EMAIL", "ADDRESS", "PHONE", "COUNTRY",
|
|
92
|
+
"DATE_PICKER", "CONSENT", "SECTION_HEADER", "SEPARATOR", "HEADING", "REPEATABLE_GROUP",
|
|
93
|
+
];
|
|
94
|
+
const QUESTIONNAIRE_LANG_PROPS = {
|
|
95
|
+
languages: {
|
|
96
|
+
type: "array",
|
|
97
|
+
items: { type: "string" },
|
|
98
|
+
description: "Locales the questionnaire is offered in. Defaults to [\"en\"]; \"en\" must always be included.",
|
|
99
|
+
},
|
|
100
|
+
default_language: { type: "string", description: "Locale shown by default (must be in `languages`). Defaults to the first language." },
|
|
101
|
+
status: { type: "string", enum: ["draft", "published"], description: "Omit to publish immediately; 'draft' saves without publishing." },
|
|
102
|
+
};
|
|
103
|
+
const FORM_ELEMENTS_PROP = {
|
|
104
|
+
form_elements: {
|
|
105
|
+
type: "array",
|
|
106
|
+
description: "REQUIRED. Array of form-element objects, in the order the user answers them. Each: { element_type (uppercase, one of the allowed types), title (a plain string, or an object of locale→string e.g. {\"en\":\"Your name\"}), is_required (bool), placeholder (hint text), and for choice types a `choices` array }. A per-question hint goes in `placeholder`: `description` is only accepted on HEADING, SECTION_HEADER and PARAGRAPH elements.",
|
|
107
|
+
items: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
element_type: { type: "string", enum: FORM_ELEMENT_TYPES, description: "Element type (UPPERCASE)" },
|
|
111
|
+
title: { type: "object", description: "Locale → label, e.g. {\"en\":\"Question text\"}" },
|
|
112
|
+
is_required: { type: "boolean" },
|
|
113
|
+
choices: { type: "array", items: { type: "object" }, description: "Options for DROPDOWN/SINGLE_CHOICE/MULTIPLE_CHOICE. Each: { value, label?, requires_text_input? }" },
|
|
114
|
+
},
|
|
115
|
+
required: ["element_type"],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
const WORKFLOW_FEATURE_ITEM = {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
feature: { type: "string", enum: feature_config_schema_1.WORKFLOW_FEATURES, description: "Feature to run (uppercase)" },
|
|
123
|
+
config: {
|
|
124
|
+
type: "object",
|
|
125
|
+
description: (0, feature_config_schema_1.renderFeatureItemReference)() +
|
|
126
|
+
"\n\nThe MCP normalizes the allow-lists for you before it saves: documents_allowed / " +
|
|
127
|
+
"poa_documents_allowed accept a plain doc-type array ([\"PASSPORT\"] = passport-only, any " +
|
|
128
|
+
"country), doc NAMES (PASSPORT/ID/DRIVER_LICENSE/RESIDENCE_PERMIT) as well as codes " +
|
|
129
|
+
"(P/ID/DL/RP), scalar flags, and an \"ALL\" country key - all of it becomes the canonical " +
|
|
130
|
+
"{ISO3:{CODE:{enabled:1}}}. poa_languages_allowed likewise accepts a language array " +
|
|
131
|
+
"([\"es\"]) or a map ({\"es\":1}). Omit an allow-list to accept everything.",
|
|
132
|
+
},
|
|
133
|
+
label: { type: "string", description: "Optional internal node label" },
|
|
134
|
+
},
|
|
135
|
+
required: ["feature"],
|
|
136
|
+
};
|
|
137
|
+
// Graph (node/branching) workflows — the real structure the console uses (the flat `features`
|
|
138
|
+
// list above can't express branches, conditions, or Document AI). Enums mirror the backend
|
|
139
|
+
// (workflow_graph_choices.py). A graph is { start_node, nodes: { id: node } }.
|
|
140
|
+
const WORKFLOW_NODE_TYPES = ["feature", "action", "branch", "status", "webhook"];
|
|
141
|
+
const WORKFLOW_OPERATORS = [
|
|
142
|
+
"equals", "not_equals", "greater_than", "greater_than_or_equals", "less_than",
|
|
143
|
+
"less_than_or_equals", "contains", "not_contains", "in", "not_in", "is_empty",
|
|
144
|
+
"is_not_empty", "regex", "fuzzy_match",
|
|
145
|
+
];
|
|
146
|
+
const WORKFLOW_SESSION_STATUSES = ["Approved", "Declined", "In Review", "Determine"];
|
|
147
|
+
const WORKFLOW_GRAPH_SCHEMA = {
|
|
148
|
+
type: "object",
|
|
149
|
+
description:
|
|
150
|
+
// Graph STRUCTURE - node shapes, branch semantics, ordering. This is MCP and
|
|
151
|
+
// backend behaviour, not the feature-config contract, so it stays prose.
|
|
152
|
+
"Node/branching workflow graph: { start_node, nodes }. `start_node` is the id of the entry " +
|
|
153
|
+
"node (must be a feature node). `nodes` maps nodeId → node. Node shapes: " +
|
|
154
|
+
"feature = {node_type:'feature', feature:<UPPERCASE, e.g. OCR|DOCUMENT_AI>, config?:{}, next?:<id>, branches?:[]}; " +
|
|
155
|
+
"branch = {node_type:'branch', branches:[{id, logic:'and'|'or', rules:[{field, operator, value, score?}], goto:<id>}], next?:<id fallback>}; " +
|
|
156
|
+
"status (TERMINAL) = {node_type:'status', session_status:'Approved'|'Declined'|'In Review'|'Determine'}. " +
|
|
157
|
+
"Branches are evaluated in order, first match wins; an empty rules:[] is the else/catch-all (kept last). " +
|
|
158
|
+
"Operators include `fuzzy_match` (string fields only, needs a `score` 0-100). Reference a feature's outcome " +
|
|
159
|
+
"with e.g. kyc.status / document_ai.status / bank.status, and an extracted value with kyc.extra_fields.profession. " +
|
|
160
|
+
"Each rule's `node_id` (the feature node that produces its field) is auto-filled for you — only set it " +
|
|
161
|
+
"(or use the `field@node_id` form) to disambiguate when the graph has several nodes of the same feature. " +
|
|
162
|
+
// Allow-list NORMALIZATION is something this server does on the way out, so it
|
|
163
|
+
// is not in the backend contract and has to be stated here.
|
|
164
|
+
"Allow-list shorthands the MCP normalizes for you before saving: documents_allowed / poa_documents_allowed " +
|
|
165
|
+
"accept a doc-type array ([\"PASSPORT\"] = passport-only, any country), doc NAMES " +
|
|
166
|
+
"(PASSPORT/ID/DRIVER_LICENSE/RESIDENCE_PERMIT) as well as codes (P/ID/DL/RP), scalar flags, and an \"ALL\" " +
|
|
167
|
+
"country key — every form becomes the canonical {ISO3:{CODE:{enabled:1}}}. poa_languages_allowed accepts a " +
|
|
168
|
+
"language array ([\"es\"]) or a map ({\"es\":1}). Omit an allow-list to accept everything. " +
|
|
169
|
+
// The KYC/KYB rule is a graph-level constraint, not a per-key one.
|
|
170
|
+
"KYC vs KYB: a graph is EITHER a person (KYC) workflow OR a business (KYB) workflow — never both, and the choice follows WHO is verified (a company → KYB, a person → KYC). A graph using any KYB feature (KYB_REGISTRY/KYB_DOCUMENTS/KYB_KEY_PEOPLE) may only also use DOCUMENT_AI, AML, QUESTIONNAIRE, PHONE_VERIFICATION, EMAIL_VERIFICATION, IP_ANALYSIS, BANK_VERIFICATION; it must NOT include person/KYC-only features (OCR, LIVENESS, FACE_MATCH, NFC, PROOF_OF_ADDRESS, DATABASE_VALIDATION, AGE_ESTIMATION). Company paperwork (incorporation, ownership, source of funds, business address) belongs in KYB_DOCUMENTS or DOCUMENT_AI on the KYB graph — never rebuild it as a KYC workflow. To verify the people behind a company (UBOs, officers, shareholders), build a SEPARATE KYC workflow and reference it from the KYB_KEY_PEOPLE node config (kyb_ubo_verification_workflow / kyb_officer_verification_workflow / kyb_shareholder_verification_workflow). Mixing the two is rejected by validation. " +
|
|
171
|
+
"Validate with didit_workflow_validate_graph before didit_workflow_set_graph. Get valid fields/operators from didit_workflow_get_field_definitions.\n\n" +
|
|
172
|
+
// Everything a feature node's `config` accepts, generated from the backend
|
|
173
|
+
// serializers. Never hand-written: that is how DATABASE_VALIDATION came to be
|
|
174
|
+
// documented nowhere while DOCUMENT_AI had four paragraphs.
|
|
175
|
+
(0, feature_config_schema_1.renderToolSchemaReference)(),
|
|
176
|
+
properties: {
|
|
177
|
+
start_node: { type: "string", description: "Entry node id (a feature node)." },
|
|
178
|
+
nodes: { type: "object", description: "Map of nodeId → node object (see the node shapes above)." },
|
|
179
|
+
},
|
|
180
|
+
required: ["start_node", "nodes"],
|
|
181
|
+
};
|
|
182
|
+
// Transaction-monitoring (KYT) rule schemas. These mirror the engine-facing
|
|
183
|
+
// fields in service-didit-verification's TransactionRule serializers. The MCP
|
|
184
|
+
// deliberately requires an explicit aggregation window even though the backend
|
|
185
|
+
// defaults an omitted window to 1d: a silent one-day default is unsafe when an
|
|
186
|
+
// agent is authoring a velocity rule for another period.
|
|
187
|
+
const RULE_CONDITION_OPERATORS = [
|
|
188
|
+
"eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains", "not_contains",
|
|
189
|
+
"contains_any", "regex", "fuzzy_match", "exists", "is_not_empty", "is_not_null",
|
|
190
|
+
"not_exists", "is_empty", "is_null",
|
|
191
|
+
];
|
|
192
|
+
const RULE_CONDITION_ITEM = {
|
|
193
|
+
type: "object",
|
|
194
|
+
properties: {
|
|
195
|
+
field: {
|
|
196
|
+
type: "string",
|
|
197
|
+
description: "Field path from the transaction field catalog, e.g. amount, currency, direction, action_type, score, " +
|
|
198
|
+
"transaction_type, subject_country, counterparty_country, subject_vendor_data, subject_device_fingerprint, " +
|
|
199
|
+
"subject_payment_method_type, travel_rule_status, travel_rule_required, tags, " +
|
|
200
|
+
"subject_days_since_previous_transaction, or custom_values.<key> (a key submitted as custom_properties). " +
|
|
201
|
+
"Country codes, travel_rule_status, and payment_method_type are normalized before comparison.",
|
|
202
|
+
},
|
|
203
|
+
operator: {
|
|
204
|
+
type: "string",
|
|
205
|
+
enum: RULE_CONDITION_OPERATORS,
|
|
206
|
+
description: "in/not_in accept a scalar or list; a scalar is treated as a one-item membership set. " +
|
|
207
|
+
"contains/not_contains are case-insensitive substring matches. contains_any requires a list of strings. " +
|
|
208
|
+
"regex safely matches value (the pattern) against the field. fuzzy_match requires score (0-100). " +
|
|
209
|
+
"gt/gte/lt/lte are false when either side is null or not comparable. exists/is_not_empty/is_not_null " +
|
|
210
|
+
"are presence aliases; not_exists/is_empty/is_null are their negation and ignore value.",
|
|
211
|
+
},
|
|
212
|
+
value: {
|
|
213
|
+
description: "Comparison value; its shape depends on operator and value_type. Omit for presence operators.",
|
|
214
|
+
},
|
|
215
|
+
value_type: {
|
|
216
|
+
type: "string",
|
|
217
|
+
enum: ["list", "field", "relative_date"],
|
|
218
|
+
description: "list: value is a List UUID and its entries become the comparison set. field: value is another field path. " +
|
|
219
|
+
"relative_date: value is resolved as a relative date expression. Omit for a literal value.",
|
|
220
|
+
},
|
|
221
|
+
score: {
|
|
222
|
+
type: "number",
|
|
223
|
+
minimum: 0,
|
|
224
|
+
maximum: 100,
|
|
225
|
+
description: "Required match threshold when operator is fuzzy_match.",
|
|
226
|
+
},
|
|
227
|
+
group_index: {
|
|
228
|
+
type: "integer",
|
|
229
|
+
description: "Setting group_index on any condition switches the entire condition list to grouped evaluation.",
|
|
230
|
+
},
|
|
231
|
+
group_logic: {
|
|
232
|
+
type: "string",
|
|
233
|
+
enum: ["AND", "OR"],
|
|
234
|
+
description: "Combines conditions within a group. Default AND.",
|
|
235
|
+
},
|
|
236
|
+
groups_logic: {
|
|
237
|
+
type: "string",
|
|
238
|
+
enum: ["AND", "OR"],
|
|
239
|
+
description: "Combines group outcomes; only the first condition's value is used. Default OR. Grouped evaluation " +
|
|
240
|
+
"overrides evaluation_mode.",
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
required: ["field", "operator"],
|
|
244
|
+
};
|
|
245
|
+
const RULE_AGGREGATION_ITEM = {
|
|
246
|
+
type: "object",
|
|
247
|
+
description: "One historical velocity check. Every aggregation entry on a rule must match (AND), regardless of " +
|
|
248
|
+
"evaluation_mode. The window is required by the MCP so it cannot silently fall back to the backend's 1d default.",
|
|
249
|
+
properties: {
|
|
250
|
+
metric: {
|
|
251
|
+
type: "string",
|
|
252
|
+
enum: ["count", "sum", "max", "min", "avg", "distinct_count", "unique_count"],
|
|
253
|
+
description: "unique_count is an alias of distinct_count.",
|
|
254
|
+
},
|
|
255
|
+
field: {
|
|
256
|
+
type: "string",
|
|
257
|
+
description: "Numeric or identity field to aggregate. Defaults to amount; ignored for count.",
|
|
258
|
+
},
|
|
259
|
+
operator: {
|
|
260
|
+
type: "string",
|
|
261
|
+
enum: ["eq", "ne", "gt", "gte", "lt", "lte"],
|
|
262
|
+
description: "Comparison of the computed metric against value.",
|
|
263
|
+
},
|
|
264
|
+
value: { type: "number", description: "Threshold the computed metric is compared against." },
|
|
265
|
+
window: {
|
|
266
|
+
type: "string",
|
|
267
|
+
pattern: "^\\d+[mhd]$",
|
|
268
|
+
description: "REQUIRED. Velocity window: '<N>m' (minutes, not months), '<N>h' (hours), or '<N>d' (days).",
|
|
269
|
+
},
|
|
270
|
+
filters: {
|
|
271
|
+
type: "object",
|
|
272
|
+
description: "Restricts the same-app historical transactions counted inside the window. A value of '__current__' " +
|
|
273
|
+
"resolves to that field's value on the transaction being evaluated, e.g. " +
|
|
274
|
+
"{subject_vendor_data:'__current__'} counts the same subject only. An array means membership.",
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
required: ["metric", "operator", "value", "window"],
|
|
278
|
+
};
|
|
279
|
+
const RULE_SCOPE_SCHEMA = {
|
|
280
|
+
type: "object",
|
|
281
|
+
description: "Restricts which transactions are considered. Empty or omitted lists mean no restriction. Transaction type " +
|
|
282
|
+
"aliases such as travelRule are normalized by the engine.",
|
|
283
|
+
properties: {
|
|
284
|
+
transaction_types: {
|
|
285
|
+
type: "array",
|
|
286
|
+
items: { type: "string" },
|
|
287
|
+
description: "Examples: finance, kyc, travel_rule, user_event, audit_trail_event, gambling_bet, " +
|
|
288
|
+
"gambling_limit_change, gambling_bonus_change.",
|
|
289
|
+
},
|
|
290
|
+
directions: { type: "array", items: { type: "string", enum: ["INBOUND", "OUTBOUND"] } },
|
|
291
|
+
action_types: {
|
|
292
|
+
type: "array",
|
|
293
|
+
items: { type: "string" },
|
|
294
|
+
description: "Application-specific action types, e.g. withdrawal or deposit.",
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
const RULE_ACTION_ITEM = {
|
|
299
|
+
type: "object",
|
|
300
|
+
description: "One action. All actions on a match run together; TEST-mode rules record the match but skip every action. " +
|
|
301
|
+
"Shapes: add_score {type,value:<integer>}; change_status {type,value:'IN_REVIEW'|'DECLINED'|" +
|
|
302
|
+
"'AWAITING_USER'|'APPROVED',workflow_id?}, where AWAITING_USER requires workflow_id; add_tags " +
|
|
303
|
+
"{type,tag_uuid? or tag_name?,tag_color?}; add_note {type,note}; add_to_list {type,list_id}; open_case " +
|
|
304
|
+
"{type,blueprint?,grouping?,attach_matched_transaction?}. Only the first open_case action is applied.",
|
|
305
|
+
properties: {
|
|
306
|
+
type: {
|
|
307
|
+
type: "string",
|
|
308
|
+
enum: ["add_score", "change_status", "add_tags", "add_note", "add_to_list", "open_case"],
|
|
309
|
+
},
|
|
310
|
+
value: { description: "add_score delta, or change_status target (alias: status)." },
|
|
311
|
+
workflow_id: {
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "change_status only; required when value is AWAITING_USER.",
|
|
314
|
+
},
|
|
315
|
+
tag_uuid: { type: "string", description: "add_tags only." },
|
|
316
|
+
tag_name: { type: "string", description: "add_tags only; the backend uppercases it." },
|
|
317
|
+
tag_color: { type: "string", description: "add_tags only, e.g. #FF0000." },
|
|
318
|
+
note: { type: "string", description: "add_note only (alias: value)." },
|
|
319
|
+
list_id: { type: "string", description: "add_to_list only; UUID of the target List." },
|
|
320
|
+
blueprint: { type: "string", description: "open_case only; case blueprint UUID." },
|
|
321
|
+
grouping: {
|
|
322
|
+
type: "string",
|
|
323
|
+
enum: ["by_applicant", "by_rule_and_applicant"],
|
|
324
|
+
description: "open_case only.",
|
|
325
|
+
},
|
|
326
|
+
attach_matched_transaction: { type: "boolean", description: "open_case only." },
|
|
327
|
+
},
|
|
328
|
+
required: ["type"],
|
|
329
|
+
};
|
|
330
|
+
const RULE_CONDITIONS_PROP = {
|
|
331
|
+
conditions: {
|
|
332
|
+
type: "array",
|
|
333
|
+
items: RULE_CONDITION_ITEM,
|
|
334
|
+
description: "Conditions persisted on the rule, combined by evaluation_mode unless grouped.",
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
const RULE_AGGREGATION_PROP = {
|
|
338
|
+
aggregation: {
|
|
339
|
+
type: "array",
|
|
340
|
+
items: RULE_AGGREGATION_ITEM,
|
|
341
|
+
description: "Velocity checks persisted on the rule. Include them on create/update; putting them only in backtest does not save them.",
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
const RULE_ACTIONS_PROP = {
|
|
345
|
+
actions: {
|
|
346
|
+
type: "array",
|
|
347
|
+
items: RULE_ACTION_ITEM,
|
|
348
|
+
description: "Actions persisted on the rule. Include every action the user requested on create/update; backtest never saves actions.",
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
const RULE_EVALUATION_MODE_PROP = {
|
|
352
|
+
evaluation_mode: {
|
|
353
|
+
type: "string",
|
|
354
|
+
enum: ["ALL", "ANY"],
|
|
355
|
+
description: "How flat conditions combine when no condition has group_index. Default ALL. This is not TEST/ACTIVE mode.",
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
const RULE_SCOPE_PROP = { scope: RULE_SCOPE_SCHEMA };
|
|
359
|
+
// Relative time-window shortcut for analytics + search tools — saves the model computing
|
|
360
|
+
// ISO dates. `last_n_days: 15` ⇒ date_from = today−15, date_to = today (explicit dates win).
|
|
361
|
+
const LAST_N_DAYS_PROP = {
|
|
362
|
+
last_n_days: {
|
|
363
|
+
type: "number",
|
|
364
|
+
description: "Relative window: include only the last N days (sets date_from/date_to). Alternative to passing date_from/date_to.",
|
|
365
|
+
},
|
|
366
|
+
};
|
|
367
|
+
// Tool names are domain-first (`didit_<domain>_<action>`) so that Claude's flat
|
|
368
|
+
// "Other tools" connector list sorts every domain's tools into one contiguous block
|
|
369
|
+
// (there is no public API for named sub-groups within a single connector — the
|
|
370
|
+
// alphabetical name sort is the only lever). The group label below is derived from the
|
|
371
|
+
// name prefix and emitted per tool as _meta["anthropic/toolGroup"] (app-facing metadata
|
|
372
|
+
// the model never sees) — harmless today, future-proof if the UI ever renders it.
|
|
373
|
+
const TOOL_GROUP_BY_PREFIX = [
|
|
374
|
+
...(privileged_tools_1.PRIVILEGED_GROUP_PREFIX ? [privileged_tools_1.PRIVILEGED_GROUP_PREFIX] : []),
|
|
375
|
+
["account_", "Account Setup"],
|
|
376
|
+
["context_", "Account & Org"],
|
|
377
|
+
["org_", "Account & Org"],
|
|
378
|
+
["session_", "Sessions"],
|
|
379
|
+
["workflow_", "Workflows & Questionnaires"],
|
|
380
|
+
["questionnaire_", "Workflows & Questionnaires"],
|
|
381
|
+
["lists_", "Lists & Blocklist"],
|
|
382
|
+
["blocklist_", "Lists & Blocklist"],
|
|
383
|
+
["allowlist_", "Lists & Blocklist"],
|
|
384
|
+
["vendor_", "Vendor Users & Businesses"],
|
|
385
|
+
["transaction_", "Transactions (AML)"],
|
|
386
|
+
["case_", "Cases"],
|
|
387
|
+
["webhook_", "Webhooks & Alerts"],
|
|
388
|
+
["alert_", "Webhooks & Alerts"],
|
|
389
|
+
["report_", "Reports & Audit"],
|
|
390
|
+
["audit_", "Reports & Audit"],
|
|
391
|
+
["analytics", "Reports & Audit"],
|
|
392
|
+
["branding_", "Branding"],
|
|
393
|
+
...internal_tools_1.INTERNAL_GROUP_PREFIXES,
|
|
394
|
+
["verify_", "Verification APIs"],
|
|
395
|
+
];
|
|
396
|
+
function toolGroupOf(name) {
|
|
397
|
+
const rest = name.replace(/^didit_/, "");
|
|
398
|
+
for (const [prefix, group] of TOOL_GROUP_BY_PREFIX) {
|
|
399
|
+
if (rest.startsWith(prefix))
|
|
400
|
+
return group;
|
|
401
|
+
}
|
|
402
|
+
return "Other";
|
|
403
|
+
}
|
|
404
|
+
// Tools that don't operate on an org/app scope — never auto-resolve a default for them.
|
|
405
|
+
const SCOPE_AGNOSTIC_TOOLS = new Set([
|
|
406
|
+
"didit_account_register",
|
|
407
|
+
"didit_account_verify_email",
|
|
408
|
+
"didit_account_resend_otp",
|
|
409
|
+
"didit_account_login",
|
|
410
|
+
"didit_account_verify_2fa",
|
|
411
|
+
"didit_org_list",
|
|
412
|
+
"didit_context_get",
|
|
413
|
+
// Public pricing catalog: no org/app scope to resolve.
|
|
414
|
+
"didit_workflow_get_kyb_registry_catalog",
|
|
415
|
+
]);
|
|
416
|
+
// Account bootstrap tools accept passwords/OTP codes and are only for unauthenticated
|
|
417
|
+
// stdio setup. Hosted (remote) servers exclude them for EVERY caller - a remote connector
|
|
418
|
+
// authenticates with OAuth, so account credentials must never travel through the
|
|
419
|
+
// conversation (Anthropic MCP directory requirement, 2026-07).
|
|
420
|
+
const ACCOUNT_BOOTSTRAP_TOOLS = new Set([
|
|
421
|
+
"didit_account_register",
|
|
422
|
+
"didit_account_verify_email",
|
|
423
|
+
"didit_account_resend_otp",
|
|
424
|
+
"didit_account_login",
|
|
425
|
+
"didit_account_verify_2fa",
|
|
426
|
+
]);
|
|
427
|
+
// These tools remain available in local/stdio contexts, but should not be part
|
|
428
|
+
// of the authenticated ChatGPT app catalog because public app review disallows
|
|
429
|
+
// digital-credit checkout flows and live credential/secret exposure.
|
|
430
|
+
const HOSTED_APP_EXCLUDED_TOOLS = new Set([
|
|
431
|
+
...ACCOUNT_BOOTSTRAP_TOOLS,
|
|
432
|
+
"didit_org_reveal_application_api_key",
|
|
433
|
+
"didit_org_top_up",
|
|
434
|
+
]);
|
|
435
|
+
// When a tool needs an org/app and the caller passed none (and the token carries none),
|
|
436
|
+
// auto-resolve the single org / single app so single-tenant users never have to pass or
|
|
437
|
+
// discover ids. Mutates the live request-context store (same object the resolvers read).
|
|
438
|
+
// Multi-org/app users fall through to the normal resolver error (which points to didit_context).
|
|
439
|
+
async function ensureScopeDefaults(name) {
|
|
440
|
+
if (SCOPE_AGNOSTIC_TOOLS.has(name) || (0, privileged_tools_1.isPrivilegedToolName)(name))
|
|
441
|
+
return;
|
|
442
|
+
const store = config_1.requestContext.getStore();
|
|
443
|
+
if (!store?.accessToken)
|
|
444
|
+
return; // no Bearer (env-default scope) — resolver will surface the error
|
|
445
|
+
if (store.organizationId && store.applicationId)
|
|
446
|
+
return;
|
|
447
|
+
try {
|
|
448
|
+
const map = await (0, orgapp_1.getOrgAppMap)();
|
|
449
|
+
if (!store.organizationId && map.length === 1)
|
|
450
|
+
store.organizationId = map[0].orgId;
|
|
451
|
+
if (!store.applicationId) {
|
|
452
|
+
// Candidates = the applications of the org already pinned in context, or - when no org
|
|
453
|
+
// is pinned - every application the caller owns. ONE candidate is unambiguous even when
|
|
454
|
+
// it is spread over several organizations: an org that holds no application cannot make
|
|
455
|
+
// the choice ambiguous, and didit_context_get already advertises exactly that app as
|
|
456
|
+
// `default_application_id`. Requiring a single ORG here (the earlier rule) is what
|
|
457
|
+
// made didit_lists_list / didit_webhook_list answer "application_id is required" to a
|
|
458
|
+
// caller whose context call had just named the default application.
|
|
459
|
+
const scoped = store.organizationId
|
|
460
|
+
? map.filter((o) => o.orgId === store.organizationId)
|
|
461
|
+
: map;
|
|
462
|
+
// An org whose applications failed to list is UNKNOWN, not empty - it could hold the
|
|
463
|
+
// second candidate, so never call the count unambiguous while one is blind.
|
|
464
|
+
const blind = scoped.some((o) => o.appsError);
|
|
465
|
+
const candidates = scoped.flatMap((o) => o.apps.map((a) => ({ orgId: o.orgId, appId: a.appId })));
|
|
466
|
+
if (!blind && candidates.length === 1) {
|
|
467
|
+
store.applicationId = candidates[0].appId;
|
|
468
|
+
// The console path needs BOTH ids, and they must be the same pair: adopt the org that
|
|
469
|
+
// actually owns the resolved app rather than leaving the org for the resolver to fail on.
|
|
470
|
+
store.organizationId = candidates[0].orgId;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
catch {
|
|
475
|
+
/* discovery failed — let the normal resolver surface the actionable error */
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
// Per-app list tools that have a cross-org/app aggregate sibling. A multi-tenant caller who
|
|
479
|
+
// invokes one of these without a resolvable scope would otherwise hit "organization_id is
|
|
480
|
+
// required". Instead we transparently span every app (identical to the matching *_search tool:
|
|
481
|
+
// newest-first, each row attributed to its org/app), so a general "list my sessions" by a
|
|
482
|
+
// multi-app user succeeds on the FIRST call rather than erroring then recovering.
|
|
483
|
+
const AGGREGATE_FALLBACK = {
|
|
484
|
+
didit_session_list: search.searchSessions,
|
|
485
|
+
didit_transaction_list: search.searchTransactions,
|
|
486
|
+
didit_case_list: search.searchCases,
|
|
487
|
+
didit_vendor_user_list: search.searchVendorUsers,
|
|
488
|
+
didit_vendor_business_list: search.searchVendorBusinesses,
|
|
489
|
+
didit_workflow_list: search.searchWorkflows,
|
|
490
|
+
};
|
|
491
|
+
// The aggregate to run in place of a per-app list when scope is unresolved; undefined when the
|
|
492
|
+
// caller is fully scoped (org+app present) and the real single-app list should run.
|
|
493
|
+
function aggregateFallbackFor(name) {
|
|
494
|
+
const fn = AGGREGATE_FALLBACK[name];
|
|
495
|
+
if (!fn)
|
|
496
|
+
return undefined;
|
|
497
|
+
const store = config_1.requestContext.getStore();
|
|
498
|
+
if (store?.organizationId && store?.applicationId)
|
|
499
|
+
return undefined;
|
|
500
|
+
return fn;
|
|
501
|
+
}
|
|
502
|
+
// MCP tool annotations. Claude's connector "Tool permissions" UI groups tools into
|
|
503
|
+
// "Read-only" / "Write" / "Destructive" categories from readOnlyHint + destructiveHint —
|
|
504
|
+
// WITHOUT them every tool collapses into one undifferentiated "Other tools" bucket (which
|
|
505
|
+
// is exactly what GitHub/Linear/Sentry avoid by annotating their tools). Derived from the
|
|
506
|
+
// domain-first name (whole-token match, so the "lists"/"blocklist" domains don't read as
|
|
507
|
+
// the "list" verb) — maintenance-free as tools are added.
|
|
508
|
+
const READ_VERB_TOKENS = new Set([
|
|
509
|
+
"list", "get", "search", "statistics", "analytics", "export", "pdf", "validate", "backtest",
|
|
510
|
+
]);
|
|
511
|
+
const DESTRUCTIVE_VERB_TOKENS = new Set(["delete", "remove", "uninstall"]);
|
|
512
|
+
function toolTitle(name) {
|
|
513
|
+
return name
|
|
514
|
+
.replace(/^didit_/, "")
|
|
515
|
+
.split("_")
|
|
516
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
517
|
+
.join(" ");
|
|
518
|
+
}
|
|
519
|
+
// Tools that are destructive/high-impact by SEMANTICS, not by a delete/remove verb in the
|
|
520
|
+
// name: revealing a live secret, moving money, consequential decisions, and overwrites.
|
|
521
|
+
const EXPLICIT_DESTRUCTIVE_TOOLS = new Set([
|
|
522
|
+
"didit_org_reveal_application_api_key",
|
|
523
|
+
"didit_org_top_up",
|
|
524
|
+
"didit_case_manage",
|
|
525
|
+
"didit_session_update_status",
|
|
526
|
+
"didit_questionnaire_update",
|
|
527
|
+
"didit_webhook_update",
|
|
528
|
+
"didit_workflow_update",
|
|
529
|
+
"didit_workflow_edit_graph",
|
|
530
|
+
"didit_workflow_set_graph",
|
|
531
|
+
"didit_workflow_publish",
|
|
532
|
+
...internal_tools_1.INTERNAL_DESTRUCTIVE_TOOLS,
|
|
533
|
+
]);
|
|
534
|
+
// Tools that can reach outside the current Didit workspace/account boundary by
|
|
535
|
+
// sending email/SMS, creating third-party checkout, registering webhook delivery
|
|
536
|
+
// endpoints, or sharing verification data with a partner.
|
|
537
|
+
const EXPLICIT_OPEN_WORLD_TOOLS = new Set([
|
|
538
|
+
"didit_account_register",
|
|
539
|
+
"didit_account_resend_otp",
|
|
540
|
+
"didit_org_invite_member",
|
|
541
|
+
"didit_org_top_up",
|
|
542
|
+
"didit_session_share",
|
|
543
|
+
"didit_session_update_status",
|
|
544
|
+
...internal_tools_1.INTERNAL_OPEN_WORLD_TOOLS,
|
|
545
|
+
"didit_verify_email_send",
|
|
546
|
+
"didit_verify_phone_send",
|
|
547
|
+
"didit_webhook_create",
|
|
548
|
+
"didit_webhook_update",
|
|
549
|
+
]);
|
|
550
|
+
// These tools have names that include read-like tokens, but their handlers
|
|
551
|
+
// create server-side artifacts/jobs rather than strictly retrieving data.
|
|
552
|
+
const EXPLICIT_WRITE_TOOLS = new Set([
|
|
553
|
+
"didit_report_export",
|
|
554
|
+
"didit_session_generate_pdf",
|
|
555
|
+
"didit_session_webhook_resend",
|
|
556
|
+
]);
|
|
557
|
+
// The inverse: tools whose names carry no read-like token but whose handlers never
|
|
558
|
+
// change server state (requirements/workflow-check are deterministic reads over the
|
|
559
|
+
// stored profile + knowledge base; interview/next is pure computation; generate_workflow
|
|
560
|
+
// computes and returns a graph WITHOUT persisting anything — the backend view only
|
|
561
|
+
// requires read:workflows, and applying the graph goes through the didit_workflow_* writes).
|
|
562
|
+
const EXPLICIT_READ_TOOLS = new Set([
|
|
563
|
+
...internal_tools_1.INTERNAL_READ_TOOLS,
|
|
564
|
+
// build_graph computes a graph from a plain feature spec, persisting nothing.
|
|
565
|
+
"didit_workflow_build_graph",
|
|
566
|
+
// The per-session webhook delivery log (its only verb-like token is "webhooks").
|
|
567
|
+
"didit_session_webhooks",
|
|
568
|
+
// Folds a session's decision payload and its workflow graph into the outcome trace.
|
|
569
|
+
"didit_session_explain_decision",
|
|
570
|
+
]);
|
|
571
|
+
function annotationsFor(name) {
|
|
572
|
+
const tokens = name.replace(/^didit_/, "").split("_");
|
|
573
|
+
const title = toolTitle(name);
|
|
574
|
+
const openWorldHint = EXPLICIT_OPEN_WORLD_TOOLS.has(name);
|
|
575
|
+
if (EXPLICIT_DESTRUCTIVE_TOOLS.has(name) || tokens.some((t) => DESTRUCTIVE_VERB_TOKENS.has(t))) {
|
|
576
|
+
return { title, readOnlyHint: false, openWorldHint, destructiveHint: true };
|
|
577
|
+
}
|
|
578
|
+
if (EXPLICIT_WRITE_TOOLS.has(name)) {
|
|
579
|
+
return { title, readOnlyHint: false, openWorldHint, destructiveHint: false };
|
|
580
|
+
}
|
|
581
|
+
if (EXPLICIT_READ_TOOLS.has(name)) {
|
|
582
|
+
return { title, readOnlyHint: true, openWorldHint, destructiveHint: false };
|
|
583
|
+
}
|
|
584
|
+
// Verification APIs (didit_verify_*) are billable POST actions — keep them as writes even
|
|
585
|
+
// when the action token reads like a query (kyb_search / face_search).
|
|
586
|
+
const isBillableAction = name.startsWith("didit_verify_");
|
|
587
|
+
if (!isBillableAction && tokens.some((t) => READ_VERB_TOKENS.has(t))) {
|
|
588
|
+
return { title, readOnlyHint: true, openWorldHint, destructiveHint: false };
|
|
589
|
+
}
|
|
590
|
+
return { title, readOnlyHint: false, openWorldHint, destructiveHint: false };
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Build a fully-wired MCP server (tool list + dispatch). A factory rather than a
|
|
594
|
+
* singleton because the stateless Streamable-HTTP transport needs a fresh server
|
|
595
|
+
* instance per request, while stdio uses exactly one. Both share this definition.
|
|
596
|
+
*
|
|
597
|
+
* `hosted: true` marks a remote (Streamable-HTTP / OAuth) server. Hosted servers never
|
|
598
|
+
* expose the account-bootstrap tools (credentials must not travel through a remote
|
|
599
|
+
* conversation) and never honor the DIDIT_IS_STAFF env override (a deployment-wide env
|
|
600
|
+
* var would grant the staff surface to every remote caller; only per-token introspection
|
|
601
|
+
* can mark a hosted caller privileged). The stdio server keeps both conveniences.
|
|
602
|
+
*
|
|
603
|
+
* `profile` selects the catalog served (see chatgpt-app.ts): `full` (default) or `chatgpt`,
|
|
604
|
+
* the reduced allow-list the hosted server exposes at /mcp/chatgpt for the ChatGPT app store.
|
|
605
|
+
*/
|
|
606
|
+
function createServer(options = {}) {
|
|
607
|
+
const hosted = options.hosted === true;
|
|
608
|
+
const profile = options.profile ?? "full";
|
|
609
|
+
// `access_token` on the auth-service discovery tools is a stdio full-profile convenience: it lets
|
|
610
|
+
// someone running the local server hand over the Bearer that didit_account_login returned.
|
|
611
|
+
// A hosted server authenticates with OAuth and reads the caller's Bearer from
|
|
612
|
+
// requestContext, so the property is never needed there - and advertising it would solicit
|
|
613
|
+
// an authentication secret through tool arguments, which the OpenAI Apps guidelines
|
|
614
|
+
// prohibit outright ("do not collect, solicit, or process ... access credentials and
|
|
615
|
+
// authentication secrets"; app review finding policy-review-47fabf436877, 2026-09).
|
|
616
|
+
// Hosted catalogs omit both the property and the sentence that tells the model to fill it,
|
|
617
|
+
// on EVERY profile - the full catalog at /mcp is a public directory listing too. The stdio
|
|
618
|
+
// ChatGPT profile mirrors this omission for local catalog review.
|
|
619
|
+
const stdioOnlyAccessToken = (description) => hosted || profile === "chatgpt" ? {} : { access_token: { type: "string", description } };
|
|
620
|
+
const stdioTokenHint = hosted || profile === "chatgpt" ? "" : " In stdio mode pass access_token from login/verify_email.";
|
|
621
|
+
// Call-time mirror: hosted and ChatGPT calls never process a token handed in as
|
|
622
|
+
// an argument, even if a client crafted one from a memorised stdio schema. Ignoring (rather
|
|
623
|
+
// than refusing) keeps every existing hosted caller working - the header Bearer that already
|
|
624
|
+
// authenticated the request is the identity used either way.
|
|
625
|
+
const stdioAccessTokenArg = (a) => hosted || profile === "chatgpt" ? undefined : a?.access_token;
|
|
626
|
+
// Only a profile that serves MCP Apps UI (chatgpt-app.ts) advertises `resources`; every
|
|
627
|
+
// other profile keeps exactly the capabilities it always had.
|
|
628
|
+
const servesWidgets = (0, chatgpt_app_1.profileServesWidgets)(profile);
|
|
629
|
+
const server = new index_js_1.Server({ name: "didit", version: config_1.SERVER_VERSION }, { capabilities: servesWidgets ? { tools: {}, resources: {} } : { tools: {} } });
|
|
630
|
+
if (servesWidgets) {
|
|
631
|
+
// The UI templates (`ui://` resources) the tools reference. Static, identical for every
|
|
632
|
+
// caller, and behind the same Bearer gate as the rest of the endpoint (http.ts).
|
|
633
|
+
server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => ({ resources: (0, chatgpt_app_1.listWidgetResources)() }));
|
|
634
|
+
server.setRequestHandler(types_js_1.ListResourceTemplatesRequestSchema, async () => ({ resourceTemplates: [] }));
|
|
635
|
+
server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => (0, chatgpt_app_1.readWidgetResource)(request.params.uri));
|
|
636
|
+
}
|
|
637
|
+
// ---------------------------------------------------------------------------
|
|
638
|
+
// Tool definitions
|
|
639
|
+
// ---------------------------------------------------------------------------
|
|
640
|
+
// Built per call of tools/list (the catalog is filtered per caller below) and
|
|
641
|
+
// once for the dispatcher, which reads each tool's `required` list to tell a
|
|
642
|
+
// blank optional argument from a blank required one (blank-args.ts).
|
|
643
|
+
const toolDefinitions = () => [
|
|
55
644
|
// ── Auth ────────────────────────────────────────────────────────────
|
|
56
645
|
{
|
|
57
|
-
name: "
|
|
58
|
-
description: "Register a new Didit account. A 6-character verification code is sent to the email. Follow up with
|
|
646
|
+
name: "didit_account_register",
|
|
647
|
+
description: "Register a new Didit account. A 6-character verification code is sent to the email. Follow up with didit_account_verify_email.",
|
|
59
648
|
inputSchema: {
|
|
60
649
|
type: "object",
|
|
61
650
|
properties: {
|
|
@@ -66,7 +655,7 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
66
655
|
},
|
|
67
656
|
},
|
|
68
657
|
{
|
|
69
|
-
name: "
|
|
658
|
+
name: "didit_account_verify_email",
|
|
70
659
|
description: "Verify email with the 6-character code. Returns access_token, refresh_token, organization, application (with client_id and api_key).",
|
|
71
660
|
inputSchema: {
|
|
72
661
|
type: "object",
|
|
@@ -78,8 +667,20 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
78
667
|
},
|
|
79
668
|
},
|
|
80
669
|
{
|
|
81
|
-
name: "
|
|
82
|
-
description: "
|
|
670
|
+
name: "didit_account_resend_otp",
|
|
671
|
+
description: "Resend the 6-character email verification code for a pending registration. Codes expire after 10 minutes.",
|
|
672
|
+
inputSchema: {
|
|
673
|
+
type: "object",
|
|
674
|
+
properties: {
|
|
675
|
+
email: { type: "string", description: "Email address the code was originally sent to" },
|
|
676
|
+
},
|
|
677
|
+
required: ["email"],
|
|
678
|
+
},
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
name: "didit_account_login",
|
|
682
|
+
description: "Login to existing Didit account. Returns access_token and refresh_token. If the account has two-factor " +
|
|
683
|
+
"authentication it returns 2fa_required and a temp_token instead: finish with didit_account_verify_2fa.",
|
|
83
684
|
inputSchema: {
|
|
84
685
|
type: "object",
|
|
85
686
|
properties: {
|
|
@@ -90,397 +691,1470 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
90
691
|
},
|
|
91
692
|
},
|
|
92
693
|
{
|
|
93
|
-
name: "
|
|
94
|
-
description: "
|
|
694
|
+
name: "didit_account_verify_2fa",
|
|
695
|
+
description: "Finish logging in to an account with two-factor authentication, using the temp_token from didit_account_login " +
|
|
696
|
+
"and the current 6-digit authenticator code (or an unused backup code). Returns access_token and refresh_token.",
|
|
697
|
+
inputSchema: {
|
|
698
|
+
type: "object",
|
|
699
|
+
properties: {
|
|
700
|
+
temp_token: { type: "string", description: "temp_token returned by didit_account_login (valid for 5 minutes)" },
|
|
701
|
+
code: { type: "string", description: "6-digit code from the authenticator app, or an unused backup code" },
|
|
702
|
+
},
|
|
703
|
+
required: ["temp_token", "code"],
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
name: "didit_org_list",
|
|
708
|
+
description: "List the organizations you belong to (each has an id to pass as organization_id to other tools). In hosted OAuth mode no arguments are needed." +
|
|
709
|
+
stdioTokenHint,
|
|
710
|
+
inputSchema: {
|
|
711
|
+
type: "object",
|
|
712
|
+
properties: {
|
|
713
|
+
...stdioOnlyAccessToken("Only for stdio mode — Bearer access token from login/verify_email. Omit in hosted OAuth mode."),
|
|
714
|
+
},
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
name: "didit_org_list_applications",
|
|
719
|
+
description: "List the applications in an organization (each has an id to pass as application_id). In hosted OAuth mode pass only organization_id.",
|
|
720
|
+
inputSchema: {
|
|
721
|
+
type: "object",
|
|
722
|
+
properties: {
|
|
723
|
+
organization_id: { type: "string", description: "Organization UUID (from didit_org_list)" },
|
|
724
|
+
...stdioOnlyAccessToken("Only for stdio mode. Omit in hosted OAuth mode."),
|
|
725
|
+
},
|
|
726
|
+
required: ["organization_id"],
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
name: "didit_org_get_application",
|
|
731
|
+
description: "Get application details (client_id etc.). The api_key is REDACTED — a masked preview + api_key_set flag are returned, never the raw secret.",
|
|
732
|
+
inputSchema: {
|
|
733
|
+
type: "object",
|
|
734
|
+
properties: {
|
|
735
|
+
organization_id: { type: "string" },
|
|
736
|
+
application_id: { type: "string" },
|
|
737
|
+
...stdioOnlyAccessToken("Only for stdio mode. Omit in hosted OAuth mode."),
|
|
738
|
+
},
|
|
739
|
+
required: ["organization_id", "application_id"],
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: "didit_org_reveal_application_api_key",
|
|
744
|
+
description: "Return the RAW, un-redacted api_key for an application. This exposes a LIVE SECRET — only call when a human explicitly needs the key to integrate; never log or persist it. Requires confirm:true AND an explicit organization_id + application_id (no defaults).",
|
|
745
|
+
inputSchema: {
|
|
746
|
+
type: "object",
|
|
747
|
+
properties: {
|
|
748
|
+
organization_id: { type: "string", description: "REQUIRED. No env/context default for this raw-secret tool." },
|
|
749
|
+
application_id: { type: "string", description: "REQUIRED. No env/context default for this raw-secret tool." },
|
|
750
|
+
confirm: { type: "boolean", description: "REQUIRED. Must be true to expose the raw key. Only set after explicit user confirmation of this exact action." },
|
|
751
|
+
...stdioOnlyAccessToken("Only for stdio mode."),
|
|
752
|
+
},
|
|
753
|
+
required: ["organization_id", "application_id", "confirm"],
|
|
754
|
+
},
|
|
755
|
+
},
|
|
756
|
+
// ── Context + cross-org/app aggregate search ────────────────────────
|
|
757
|
+
{
|
|
758
|
+
name: "didit_context_get",
|
|
759
|
+
description: "Return ALL organizations you can access with their applications nested, plus the default org/app when unambiguous — in ONE call (replaces didit_org_list + per-org didit_org_list_applications). Call this first to discover ids.",
|
|
760
|
+
inputSchema: { type: "object", properties: {} },
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
name: "didit_session_search",
|
|
764
|
+
description: `Search verification sessions ACROSS ALL your apps and organizations in a single call — the efficient way to answer "the last 5 in-review sessions across my apps". Aggregates server-side and returns newest matches first, each tagged with its organization/application. Omit organization_id/application_id to span everything; pass them to narrow scope. status accepts: ${SESSION_STATUSES}.`,
|
|
765
|
+
inputSchema: {
|
|
766
|
+
type: "object",
|
|
767
|
+
properties: {
|
|
768
|
+
status: { type: "string", description: `Filter by session status (${SESSION_STATUSES}). Several statuses separated by commas match any of them, e.g. "Not Started,In Progress".` },
|
|
769
|
+
session_kind: { type: "string", enum: ["user", "business", "all"], description: "KYC (user), KYB (business), or all" },
|
|
770
|
+
workflow_id: { type: "string", description: "Filter by workflow UUID" },
|
|
771
|
+
search: { type: "string", description: "Free-text search" },
|
|
772
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
773
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
774
|
+
...LAST_N_DAYS_PROP,
|
|
775
|
+
limit: { type: "number", description: "Max results after merging across apps (default 20, max 200)" },
|
|
776
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
name: "didit_transaction_search",
|
|
782
|
+
description: "Search transaction-monitoring (AML) transactions ACROSS ALL your apps and organizations in one call. Omit organization_id/application_id to span everything; pass them to narrow. Returns newest first, each tagged with its org/app.",
|
|
783
|
+
inputSchema: {
|
|
784
|
+
type: "object",
|
|
785
|
+
properties: {
|
|
786
|
+
status: { type: "string", description: "Filter by transaction status" },
|
|
787
|
+
search: { type: "string", description: "Free-text search" },
|
|
788
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
789
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
790
|
+
...LAST_N_DAYS_PROP,
|
|
791
|
+
limit: { type: "number", description: "Max results after merging (default 20, max 200)" },
|
|
792
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
name: "didit_case_search",
|
|
798
|
+
description: "Search case-management cases ACROSS ALL your apps and organizations in one call. Omit organization_id/application_id to span everything; pass them to narrow. Returns newest first, each tagged with its org/app.",
|
|
799
|
+
inputSchema: {
|
|
800
|
+
type: "object",
|
|
801
|
+
properties: {
|
|
802
|
+
status: { type: "string", description: "Filter by case status" },
|
|
803
|
+
search: { type: "string", description: "Free-text search" },
|
|
804
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
805
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
806
|
+
...LAST_N_DAYS_PROP,
|
|
807
|
+
limit: { type: "number", description: "Max results after merging (default 20, max 200)" },
|
|
808
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
809
|
+
},
|
|
810
|
+
},
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: "didit_vendor_user_search",
|
|
814
|
+
description: "Find vendor users (your end customers) ACROSS ALL your apps and organizations in one call — e.g. locate a customer by vendor_data/email/name without knowing which app they're in. Omit organization_id/application_id to span everything; pass them to narrow. Each hit is tagged with its org/app.",
|
|
815
|
+
inputSchema: {
|
|
816
|
+
type: "object",
|
|
817
|
+
properties: {
|
|
818
|
+
search: { type: "string", description: "Free-text search (name, email, vendor_data)" },
|
|
819
|
+
vendor_data: { type: "string", description: "Filter by your customer identifier" },
|
|
820
|
+
status: { type: "string", description: "Filter by vendor-user status" },
|
|
821
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
822
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
823
|
+
...LAST_N_DAYS_PROP,
|
|
824
|
+
limit: { type: "number", description: "Max results after merging (default 20, max 200)" },
|
|
825
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
826
|
+
},
|
|
827
|
+
},
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
name: "didit_vendor_business_search",
|
|
831
|
+
description: "Find vendor businesses (KYB companies) ACROSS ALL your apps and organizations in one call. Omit organization_id/application_id to span everything; pass them to narrow. Each hit is tagged with its org/app.",
|
|
832
|
+
inputSchema: {
|
|
833
|
+
type: "object",
|
|
834
|
+
properties: {
|
|
835
|
+
search: { type: "string", description: "Free-text search (company name, registration number, vendor_data)" },
|
|
836
|
+
vendor_data: { type: "string", description: "Filter by your business identifier" },
|
|
837
|
+
status: { type: "string", description: "Filter by vendor-business status" },
|
|
838
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
839
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
840
|
+
...LAST_N_DAYS_PROP,
|
|
841
|
+
limit: { type: "number", description: "Max results after merging (default 20, max 200)" },
|
|
842
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
843
|
+
},
|
|
844
|
+
},
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
name: "didit_analytics",
|
|
848
|
+
description: "Aggregate verification analytics ACROSS ALL your apps and organizations in one call - the efficient way to answer questions like \"how many people tried phone verification but dropped off in the last 15 days?\". Returns summed status counts (request_breakdown), a feature_funnel (how many sessions REACHED each step: OCR, LIVENESS, FACE_MATCH, AML, POA, PHONE, EMAIL, ...), warning_stats by risk code, the previous period's request_breakdown, per-workflow session totals and a recomputed conversion_rate, for a date window. Omit organization_id/application_id to span everything; pass them to narrow.",
|
|
849
|
+
inputSchema: {
|
|
850
|
+
type: "object",
|
|
851
|
+
properties: {
|
|
852
|
+
date_from: { type: "string", description: "ISO date lower bound (YYYY-MM-DD)" },
|
|
853
|
+
date_to: { type: "string", description: "ISO date upper bound (YYYY-MM-DD)" },
|
|
854
|
+
...LAST_N_DAYS_PROP,
|
|
855
|
+
include_timeseries: { type: "boolean", description: "Also return per-day time series (heavier). Default false." },
|
|
856
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
...(0, internal_tools_1.internalToolDefs)("network"),
|
|
861
|
+
// ── Sessions ────────────────────────────────────────────────────────
|
|
862
|
+
{
|
|
863
|
+
name: "didit_session_create",
|
|
864
|
+
description: "Create a verification session. Requires workflow_id (created in the Console Workflows page) — the workflow defines which steps run and whether the session is KYC or KYB. Returns session_id, url, and session_token.",
|
|
865
|
+
inputSchema: {
|
|
866
|
+
type: "object",
|
|
867
|
+
properties: {
|
|
868
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
869
|
+
workflow_id: { type: "string", description: "REQUIRED. UUID of the workflow that defines the verification steps. Selects KYC vs KYB implicitly." },
|
|
870
|
+
vendor_data: { type: "string", description: "Your unique identifier for the user (e.g. user ID). Used to group sessions into a user/business." },
|
|
871
|
+
callback: { type: "string", description: "URL to redirect the user to after verification" },
|
|
872
|
+
callback_method: { type: "string", enum: ["initiator", "completer", "both"], description: "Which device/flow the callback applies to" },
|
|
873
|
+
language: { type: "string", enum: LANGUAGE_CODES, description: "Pre-set the verification UI language (ISO code)" },
|
|
874
|
+
sandbox_scenario: { type: "string", description: "SANDBOX ONLY (an application whose mode is 'sandbox' — see didit_context_get): predefine the outcome instead of running real providers, so the session is never billed. Slugs are 'approve', 'decline_*' (e.g. decline_aml_hit, decline_document_expired, decline_kyb_registry_mismatch) and 'review_*' (e.g. review_aml_possible_match). Ignored by a live application, where every session IS billed." },
|
|
875
|
+
metadata: { type: "object", description: "Arbitrary JSON stored on the session and echoed in webhooks" },
|
|
876
|
+
contact_details: { type: "object", description: "Pre-fill contact info (e.g. email, phone) for the session" },
|
|
877
|
+
expected_details: { type: "object", description: "Expected values to validate against (e.g. expected country, IP)" },
|
|
878
|
+
portrait_image: { type: "string", description: "Base64 or URL reference portrait for Biometric Authentication / Face-Match-first workflows. Optional when the vendor_data user already has a stored face (approved liveness face, ePassport photo, document portrait, or enrolled profile face) - the stored face is reused automatically; 400 if neither is available" },
|
|
879
|
+
},
|
|
880
|
+
required: ["workflow_id"],
|
|
881
|
+
},
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
name: "didit_session_list",
|
|
885
|
+
description: `List verification sessions for ONE app. If you have multiple apps (or pass no scope) this automatically spans every app, newest first — but didit_session_search is the canonical cross-app tool and what to reach for to answer "my last N sessions". status accepts session-level values: ${SESSION_STATUSES}.`,
|
|
886
|
+
inputSchema: {
|
|
887
|
+
type: "object",
|
|
888
|
+
properties: {
|
|
889
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
890
|
+
status: { type: "string", description: `Filter by session status (${SESSION_STATUSES}). Several statuses separated by commas match any of them, e.g. "Not Started,In Progress".` },
|
|
891
|
+
session_kind: { type: "string", enum: ["user", "business", "all"], description: "KYC (user), KYB (business), or all" },
|
|
892
|
+
vendor_data: { type: "string", description: "Filter by vendor_data" },
|
|
893
|
+
workflow_id: { type: "string", description: "Filter by workflow UUID" },
|
|
894
|
+
search: { type: "string", description: "Free-text search" },
|
|
895
|
+
date_from: { type: "string", description: "ISO date lower bound" },
|
|
896
|
+
date_to: { type: "string", description: "ISO date upper bound" },
|
|
897
|
+
limit: { type: "string", description: "Page size (LimitOffset pagination)" },
|
|
898
|
+
offset: { type: "string", description: "Pagination offset" },
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
name: "didit_session_get_decision",
|
|
904
|
+
description: "Get the full verification decision and all extracted data for a session.",
|
|
905
|
+
inputSchema: {
|
|
906
|
+
type: "object",
|
|
907
|
+
properties: {
|
|
908
|
+
session_id: { type: "string", description: "Session UUID" },
|
|
909
|
+
},
|
|
910
|
+
required: ["session_id"],
|
|
911
|
+
},
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
name: "didit_session_update_status",
|
|
915
|
+
description: "Overwrite a session's decision by approving, declining, or requesting resubmission; optionally send a notification email that cannot be recalled. Before calling, obtain explicit user confirmation of the session, new decision, and any email recipient. For resubmission, pass new_status='Resubmitted' and nodes_to_resubmit; already-approved steps are kept.",
|
|
916
|
+
inputSchema: {
|
|
917
|
+
type: "object",
|
|
918
|
+
properties: {
|
|
919
|
+
session_id: { type: "string" },
|
|
920
|
+
new_status: { type: "string", enum: ["Approved", "Declined", "Resubmitted"], description: "New decision status" },
|
|
921
|
+
comment: { type: "string", description: "Reviewer note stored on the audit trail" },
|
|
922
|
+
nodes_to_resubmit: { type: "array", items: { type: "string" }, description: "Node IDs the user must redo (only for Resubmitted)" },
|
|
923
|
+
send_email: { type: "boolean", description: "Send a notification email that cannot be recalled. Set true only after explicit user confirmation of the notification and recipient." },
|
|
924
|
+
email_address: { type: "string", description: "Override the notification recipient; confirm this address with the user before sending." },
|
|
925
|
+
email_language: { type: "string", description: "Language for the notification email" },
|
|
926
|
+
},
|
|
927
|
+
required: ["session_id", "new_status"],
|
|
928
|
+
},
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
name: "didit_session_update_data",
|
|
932
|
+
description: "Correct the KYC data extracted from the ID document on a session (reviewer override). Only send the fields you want to change.",
|
|
933
|
+
inputSchema: {
|
|
934
|
+
type: "object",
|
|
935
|
+
properties: {
|
|
936
|
+
session_id: { type: "string" },
|
|
937
|
+
document_type: { type: "string", enum: DOCUMENT_TYPES },
|
|
938
|
+
document_subtype: { type: "string" },
|
|
939
|
+
document_number: { type: "string" },
|
|
940
|
+
personal_number: { type: "string" },
|
|
941
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD" },
|
|
942
|
+
date_of_issue: { type: "string", description: "YYYY-MM-DD" },
|
|
943
|
+
expiration_date: { type: "string", description: "YYYY-MM-DD" },
|
|
944
|
+
issuing_state: { type: "string", description: "ISO 3166-1 alpha-3 issuing country" },
|
|
945
|
+
first_name: { type: "string" },
|
|
946
|
+
last_name: { type: "string" },
|
|
947
|
+
gender: { type: "string", enum: ["M", "F", "U"] },
|
|
948
|
+
address: { type: "string" },
|
|
949
|
+
place_of_birth: { type: "string" },
|
|
950
|
+
nationality: { type: "string" },
|
|
951
|
+
marital_status: { type: "string", enum: ["SINGLE", "MARRIED", "DIVORCED", "WIDOWED", "UNKNOWN"] },
|
|
952
|
+
extra_fields: { type: "object", description: "Document-specific extra fields" },
|
|
953
|
+
parsed_address: { type: "object", description: "Structured address override" },
|
|
954
|
+
},
|
|
955
|
+
required: ["session_id"],
|
|
956
|
+
},
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: "didit_session_update_poa_data",
|
|
960
|
+
description: "Correct the Proof of Address data extracted from the POA document on a session (reviewer override). Only send the fields you want to change.",
|
|
961
|
+
inputSchema: {
|
|
962
|
+
type: "object",
|
|
963
|
+
properties: {
|
|
964
|
+
session_id: { type: "string" },
|
|
965
|
+
issuing_state: { type: "string", description: "ISO 3166-1 alpha-3 issuing country" },
|
|
966
|
+
document_type: { type: "string", enum: ["UTILITY_BILL", "BANK_STATEMENT", "GOVERNMENT_ISSUED_DOCUMENT", "OTHER_POA_DOCUMENT", "UNKNOWN"] },
|
|
967
|
+
document_language: { type: "string" },
|
|
968
|
+
issuer: { type: "string" },
|
|
969
|
+
issue_date: { type: "string", description: "YYYY-MM-DD" },
|
|
970
|
+
poa_address: { type: "string" },
|
|
971
|
+
name_on_document: { type: "string" },
|
|
972
|
+
extra_fields: { type: "object" },
|
|
973
|
+
poa_parsed_address: { type: "object", description: "Structured address override" },
|
|
974
|
+
},
|
|
975
|
+
required: ["session_id"],
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: "didit_session_delete",
|
|
980
|
+
description: "Permanently and irreversibly delete a single verification session (KYC or KYB) - its verification data and stored media. Blocklist entries, issued share tokens, already-queued webhook deliveries, consumed credits, and the parent user/business are not affected. Requires confirm:true - only pass it after the user has explicitly confirmed this exact deletion.",
|
|
981
|
+
inputSchema: {
|
|
982
|
+
type: "object",
|
|
983
|
+
properties: {
|
|
984
|
+
session_id: { type: "string" },
|
|
985
|
+
confirm: { type: "boolean", description: "REQUIRED. Must be true - deletion is permanent and irreversible. Only set after explicit user confirmation of this exact action." },
|
|
986
|
+
},
|
|
987
|
+
required: ["session_id", "confirm"],
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
name: "didit_session_batch_delete",
|
|
992
|
+
description: "Permanently and irreversibly delete multiple KYC sessions by session number, or EVERY KYC session in the application with delete_all:true (KYB sessions are never touched; delete those individually). Requires confirm:true - only pass it after the user has explicitly confirmed this exact deletion.",
|
|
95
993
|
inputSchema: {
|
|
96
994
|
type: "object",
|
|
97
995
|
properties: {
|
|
98
|
-
|
|
996
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
997
|
+
session_numbers: {
|
|
998
|
+
type: "array",
|
|
999
|
+
items: { type: "number" },
|
|
1000
|
+
description: "Array of session numbers to delete",
|
|
1001
|
+
},
|
|
1002
|
+
delete_all: { type: "boolean", description: "Set true to delete ALL sessions (ignores session_numbers)" },
|
|
1003
|
+
confirm: { type: "boolean", description: "REQUIRED. Must be true - deletion is permanent and irreversible. Only set after explicit user confirmation of this exact action." },
|
|
1004
|
+
},
|
|
1005
|
+
required: ["confirm"],
|
|
1006
|
+
},
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
name: "didit_session_generate_pdf",
|
|
1010
|
+
description: "Return download_url, expires_at and expires_in (300 seconds) for the original Didit session PDF. Fetch the URL to save the PDF; no Authorization header is needed. Treat the URL as sensitive. Requires configured MCP HTTP PDF downloads.",
|
|
1011
|
+
inputSchema: {
|
|
1012
|
+
type: "object",
|
|
1013
|
+
properties: {
|
|
1014
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1015
|
+
session_id: { type: "string" },
|
|
1016
|
+
},
|
|
1017
|
+
required: ["session_id"],
|
|
1018
|
+
},
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: "didit_session_list_reviews",
|
|
1022
|
+
description: "List the review history and activity log for a session.",
|
|
1023
|
+
inputSchema: {
|
|
1024
|
+
type: "object",
|
|
1025
|
+
properties: {
|
|
1026
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1027
|
+
session_id: { type: "string" },
|
|
1028
|
+
},
|
|
1029
|
+
required: ["session_id"],
|
|
1030
|
+
},
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
name: "didit_session_add_review",
|
|
1034
|
+
description: "Add a review note to a session's audit trail, optionally changing its status.",
|
|
1035
|
+
inputSchema: {
|
|
1036
|
+
type: "object",
|
|
1037
|
+
properties: {
|
|
1038
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1039
|
+
session_id: { type: "string" },
|
|
1040
|
+
comment: { type: "string", description: "Review comment or note" },
|
|
1041
|
+
new_status: {
|
|
1042
|
+
type: "string",
|
|
1043
|
+
enum: ["Not Started", "In Progress", "Approved", "Declined", "In Review", "Expired", "Abandoned", "Kyc Expired", "Resubmitted", "Awaiting User"],
|
|
1044
|
+
description: "Optional new session status to record with the note",
|
|
1045
|
+
},
|
|
1046
|
+
},
|
|
1047
|
+
required: ["session_id"],
|
|
1048
|
+
},
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
name: "didit_session_share",
|
|
1052
|
+
description: "Share a verified session with a trusted partner for reusable KYC (B2B session sharing).",
|
|
1053
|
+
inputSchema: {
|
|
1054
|
+
type: "object",
|
|
1055
|
+
properties: {
|
|
1056
|
+
session_id: { type: "string" },
|
|
1057
|
+
partner_client_id: { type: "string", description: "The partner application's client_id" },
|
|
1058
|
+
},
|
|
1059
|
+
required: ["session_id", "partner_client_id"],
|
|
1060
|
+
},
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
name: "didit_session_explain_decision",
|
|
1064
|
+
description: "WHY a verification session ended Approved / Declined / In Review, as a deterministic trace read from the record: the feature that decided it (strictest wins), each warning that had an effect with its raw value, every triggered status rule (field, operator, configured vs actual value), the human override if a reviewer changed the automatic verdict, and for each cause the workflow config key that governs it (`lever`, with its CURRENT value read from the workflow graph; only keys that exist in the feature-config contract; null means it is not a workflow setting). `workflow.graph_read:false` means the graph could not be read, so no current values. Use this for every 'why was it declined / in review / approved', 'it should have been X' and 'how do I make these go to X' question INSTEAD of reading the whole decision — it never returns images, extracted fields or PII. `informational` lists warnings that changed nothing. `unexplained:true` means a decided session (Declined / In Review) whose record shows no effective cause (e.g. minimized age-assurance logs): say so, never invent one. `lifecycle_status:true` (Expired, Abandoned, Not Started, In Progress, Resub Requested…) means nothing decided it — the status is the whole explanation.",
|
|
1065
|
+
inputSchema: {
|
|
1066
|
+
type: "object",
|
|
1067
|
+
properties: {
|
|
1068
|
+
session_id: { type: "string", description: "REQUIRED. The session uuid (from the page's session-id param, didit_session_search or the user)" },
|
|
1069
|
+
},
|
|
1070
|
+
required: ["session_id"],
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
name: "didit_session_webhooks",
|
|
1075
|
+
description: "Delivery log of the webhooks Didit sent for ONE session (last 30 days): destination URL, HTTP response status, timing, signing headers (X-Signature/X-Timestamp) and a capped copy of the payload. The way to check an integration end to end: create a session on a SANDBOX application with sandbox_scenario 'approve' (unbilled, fires status.updated immediately), then call this with wait_seconds so the call waits for the delivery instead of you polling. A 2xx response_status means the customer's endpoint received it; 401/403 usually means their signature check (must be HMAC-SHA256 hex of the RAW body); an empty list after the wait means the endpoint never got the event (not public, or the destination is disabled).",
|
|
1076
|
+
inputSchema: {
|
|
1077
|
+
type: "object",
|
|
1078
|
+
properties: {
|
|
1079
|
+
session_id: { type: "string", description: "REQUIRED. The session whose deliveries to read" },
|
|
1080
|
+
wait_seconds: { type: "integer", minimum: 0, maximum: 60, description: "Keep polling up to this many seconds until at least one delivery exists (0 = read once). Use 30-45 right after creating a sandbox session." },
|
|
99
1081
|
},
|
|
100
|
-
required: ["
|
|
1082
|
+
required: ["session_id"],
|
|
1083
|
+
},
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
name: "didit_session_webhook_resend",
|
|
1087
|
+
description: "Resend one recorded webhook delivery of a session to the configured endpoint (the session page's own Resend). Use after the customer fixed their endpoint so they do not need a new session; returns the new delivery with its response_status.",
|
|
1088
|
+
inputSchema: {
|
|
1089
|
+
type: "object",
|
|
1090
|
+
properties: {
|
|
1091
|
+
session_id: { type: "string", description: "REQUIRED" },
|
|
1092
|
+
webhook_id: { type: "string", description: "REQUIRED. The delivery's uuid from didit_session_webhooks" },
|
|
1093
|
+
},
|
|
1094
|
+
required: ["session_id", "webhook_id"],
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
name: "didit_session_import_shared",
|
|
1099
|
+
description: "Import a shared verification session from a partner (Reusable KYC).",
|
|
1100
|
+
inputSchema: {
|
|
1101
|
+
type: "object",
|
|
1102
|
+
properties: {
|
|
1103
|
+
share_token: { type: "string", description: "Token received from the sharing partner" },
|
|
1104
|
+
},
|
|
1105
|
+
required: ["share_token"],
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1108
|
+
// ── Session Imports (bulk migration) ────────────────────────────────
|
|
1109
|
+
{
|
|
1110
|
+
name: "didit_session_create_import",
|
|
1111
|
+
description: "Create a bulk import job from a hosted CSV/NDJSON file (e.g. migrating historical verifications into Didit). Pass source_file_url. All imports use Didit's canonical schema. To label a record's source, include the optional per-row `provider` column in the file itself (defaults to generic) — there is no provider request field.",
|
|
1112
|
+
inputSchema: {
|
|
1113
|
+
type: "object",
|
|
1114
|
+
properties: {
|
|
1115
|
+
source_file_url: { type: "string", description: "REQUIRED. Publicly fetchable URL of the CSV/NDJSON file to import." },
|
|
1116
|
+
import_type: { type: "string", enum: ["user_verification", "business_verification", "status_rules", "transactions"], description: "What the rows represent (default user_verification)" },
|
|
1117
|
+
source_format: { type: "string", enum: ["csv", "ndjson"], description: "File format (default csv)" },
|
|
1118
|
+
workflow_id: { type: "string", description: "Workflow to associate imported sessions with" },
|
|
1119
|
+
},
|
|
1120
|
+
required: ["source_file_url"],
|
|
1121
|
+
},
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
name: "didit_session_get_import_template",
|
|
1125
|
+
description: "Download the canonical import template (column headers and format) used by didit_session_create_import.",
|
|
1126
|
+
inputSchema: { type: "object", properties: {} },
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
name: "didit_session_get_import",
|
|
1130
|
+
description: "Get the status and summary of a bulk import job.",
|
|
1131
|
+
inputSchema: {
|
|
1132
|
+
type: "object",
|
|
1133
|
+
properties: {
|
|
1134
|
+
import_id: { type: "string", description: "Import job ID returned by didit_session_create_import" },
|
|
1135
|
+
},
|
|
1136
|
+
required: ["import_id"],
|
|
1137
|
+
},
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
name: "didit_session_get_import_errors",
|
|
1141
|
+
description: "List per-row errors for a bulk import job (rows that failed validation or processing).",
|
|
1142
|
+
inputSchema: {
|
|
1143
|
+
type: "object",
|
|
1144
|
+
properties: {
|
|
1145
|
+
import_id: { type: "string", description: "Import job ID" },
|
|
1146
|
+
},
|
|
1147
|
+
required: ["import_id"],
|
|
1148
|
+
},
|
|
1149
|
+
},
|
|
1150
|
+
// ── Workflows (Verification Settings) ───────────────────────────────
|
|
1151
|
+
{
|
|
1152
|
+
name: "didit_workflow_list",
|
|
1153
|
+
description: "List verification workflows. With multiple apps (or no scope) it auto-spans every app, each row tagged with its org/app. To find one workflow by id/label across all apps, prefer didit_workflow_search. The `features` on a row do NOT tell you whether a workflow checks age: age assurance done from the DOCUMENT (age restrictions on the OCR step) shows no feature of its own. For any question about which workflows do age assurance, pass `include_age_assurance:true` — it annotates each row with `does_age_assurance`/`methods` server-side, which is the only reliable way to find them.",
|
|
1154
|
+
inputSchema: {
|
|
1155
|
+
type: "object",
|
|
1156
|
+
properties: {
|
|
1157
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1158
|
+
include_age_assurance: {
|
|
1159
|
+
type: "boolean",
|
|
1160
|
+
description: "Annotate each non-archived row with whether it does age assurance, and how. Required to find workflows that check age from the document.",
|
|
1161
|
+
},
|
|
1162
|
+
},
|
|
1163
|
+
},
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
name: "didit_workflow_create",
|
|
1167
|
+
description: "Create a SIMPLE (linear) verification workflow from an ordered list of features. Send `features` in execution order (uppercase values; put dependency features first, e.g. OCR before FACE_MATCH/NFC/DATABASE_VALIDATION). The MCP assembles them into a real workflow graph and publishes it; pass status:'draft' to keep it unpublished. A bad feature order fails validation and leaves a fixable draft. A workflow verifies EITHER a person (KYC) or a business (KYB), never both, and the type follows WHO is verified: KYB workflows use the KYB_* features (company paperwork belongs in KYB_DOCUMENTS or DOCUMENT_AI) and must not mix in person-only features (OCR/LIVENESS/FACE_MATCH/NFC/PROOF_OF_ADDRESS/DATABASE_VALIDATION/AGE_ESTIMATION); to verify the people behind a company, create a separate KYC workflow and link it from the KYB_KEY_PEOPLE node. For BRANCHING or conditional logic, use the graph tools instead: didit_workflow_get_field_definitions, then didit_workflow_validate_graph, then didit_workflow_set_graph.",
|
|
1168
|
+
inputSchema: {
|
|
1169
|
+
type: "object",
|
|
1170
|
+
properties: {
|
|
1171
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1172
|
+
workflow_label: { type: "string", description: "Display name (max 50 chars)" },
|
|
1173
|
+
features: {
|
|
1174
|
+
type: "array",
|
|
1175
|
+
minItems: 1,
|
|
1176
|
+
items: WORKFLOW_FEATURE_ITEM,
|
|
1177
|
+
description: "Verification features in execution order. Each: { feature, config?, label? }. Example: [{\"feature\":\"OCR\"},{\"feature\":\"LIVENESS\",\"config\":{\"face_liveness_method\":\"PASSIVE\"}},{\"feature\":\"FACE_MATCH\"}]",
|
|
1178
|
+
},
|
|
1179
|
+
is_default: { type: "boolean", description: "Set as default workflow for new sessions" },
|
|
1180
|
+
status: { type: "string", enum: ["draft", "published"], description: "Omit to publish immediately; 'draft' saves without publishing" },
|
|
1181
|
+
is_white_label_enabled: { type: "boolean" },
|
|
1182
|
+
is_desktop_allowed: { type: "boolean" },
|
|
1183
|
+
max_retry_attempts: { type: "number" },
|
|
1184
|
+
retry_window_days: { type: "number" },
|
|
1185
|
+
session_expiration_time: { type: "number" },
|
|
1186
|
+
},
|
|
1187
|
+
required: ["features"],
|
|
1188
|
+
},
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
name: "didit_workflow_get",
|
|
1192
|
+
description: "Get the full configuration of a specific workflow, including `response_attributes` " +
|
|
1193
|
+
"(returned data / data minimization): which data points the client receives per feature.",
|
|
1194
|
+
inputSchema: {
|
|
1195
|
+
type: "object",
|
|
1196
|
+
properties: {
|
|
1197
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1198
|
+
workflow_id: { type: "string", description: "Workflow UUID" },
|
|
1199
|
+
},
|
|
1200
|
+
required: ["workflow_id"],
|
|
1201
|
+
},
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
name: "didit_workflow_update",
|
|
1205
|
+
description: "Update a workflow's top-level SETTINGS only (workflow_label, is_default, retry/expiration, white-label, etc.). Omitted status preserves the current draft/published state; publication changes only when status is explicitly passed. It does NOT change which features run: to add/remove/reorder features, add a conditional branch, or add a Document-AI step, edit the graph with didit_workflow_edit_graph (small ops, preserves the big allow-lists) or didit_workflow_set_graph (full replace) — those are the only ways feature changes actually persist.",
|
|
1206
|
+
inputSchema: {
|
|
1207
|
+
type: "object",
|
|
1208
|
+
properties: {
|
|
1209
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1210
|
+
workflow_id: { type: "string", description: "Workflow UUID" },
|
|
1211
|
+
workflow_label: { type: "string" },
|
|
1212
|
+
is_default: { type: "boolean" },
|
|
1213
|
+
status: { type: "string", enum: ["draft", "published"] },
|
|
1214
|
+
is_white_label_enabled: { type: "boolean" },
|
|
1215
|
+
is_desktop_allowed: { type: "boolean" },
|
|
1216
|
+
max_retry_attempts: { type: "number" },
|
|
1217
|
+
retry_window_days: { type: "number" },
|
|
1218
|
+
session_expiration_time: { type: "number" },
|
|
1219
|
+
},
|
|
1220
|
+
required: ["workflow_id"],
|
|
1221
|
+
},
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
name: "didit_workflow_delete",
|
|
1225
|
+
description: "Delete a draft verification workflow. If the API forbids deletion (including an only or published version), archive it instead. Existing sessions using it are not affected.",
|
|
1226
|
+
inputSchema: {
|
|
1227
|
+
type: "object",
|
|
1228
|
+
properties: {
|
|
1229
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1230
|
+
workflow_id: { type: "string", description: "Workflow UUID" },
|
|
1231
|
+
},
|
|
1232
|
+
required: ["workflow_id"],
|
|
1233
|
+
},
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
name: "didit_workflow_search",
|
|
1237
|
+
description: "Find verification workflows ACROSS ALL your apps/orgs in one call. Pass `workflow_id` to locate a specific workflow by its version uuid OR stable workflow_id (returns which org/app it lives in), or `search` to match by label. Use this instead of guessing the application when you only have a workflow id. `search` matches the LABEL ONLY: a CAPABILITY (age assurance, AML screening, …) is not searchable by name — for age assurance use didit_workflow_list with `include_age_assurance:true`, which reports what each workflow actually does.",
|
|
1238
|
+
inputSchema: {
|
|
1239
|
+
type: "object",
|
|
1240
|
+
properties: {
|
|
1241
|
+
workflow_id: { type: "string", description: "Match a specific workflow by version uuid or stable workflow_id" },
|
|
1242
|
+
search: { type: "string", description: "Case-insensitive substring match on the workflow label" },
|
|
1243
|
+
limit: { type: "number", description: "Max results after merging (default 50, max 200)" },
|
|
1244
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1245
|
+
},
|
|
1246
|
+
},
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
name: "didit_workflow_get_graph",
|
|
1250
|
+
description: "Get the node/graph for a workflow (the structure: nodes, branches, conditions, Document-AI steps) + `status`/`version`/`is_editable`. Large feature configs (documents_allowed, poa_documents_allowed, phone countries) are SUMMARIZED by default so the response never overflows — set `include_config:true` for the raw config. Includes `returned_data` (response_attributes): the ONLY source of truth for what data the client/relying party receives in the API response and webhooks — never infer that from which features run. Also includes `age_assurance`: whether the workflow checks age, and by which method (document age restrictions and/or AGE_ESTIMATION) — decide that from this block, never from the workflow's name. Pass just `workflow_id`; the owning org/app is resolved automatically. To MODIFY the graph, prefer didit_workflow_edit_graph (small ops, no need to resend big configs).",
|
|
1251
|
+
inputSchema: {
|
|
1252
|
+
type: "object",
|
|
1253
|
+
properties: {
|
|
1254
|
+
workflow_id: { type: "string", description: "Workflow version uuid or stable workflow_id" },
|
|
1255
|
+
include_config: { type: "boolean", description: "Return full feature configs verbatim (default false → summarized). Can be very large." },
|
|
1256
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1257
|
+
},
|
|
1258
|
+
required: ["workflow_id"],
|
|
1259
|
+
},
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
name: "didit_workflow_get_field_definitions",
|
|
1263
|
+
description: "List every field you can branch on plus the operators valid for each (e.g. kyc.status, kyc.extra_fields.profession with `fuzzy_match`, document_ai.<key>, aml.risk_score). Call this before building branch rules so the field/operator pairs are valid.",
|
|
1264
|
+
inputSchema: {
|
|
1265
|
+
type: "object",
|
|
1266
|
+
properties: {
|
|
1267
|
+
workflow_id: { type: "string", description: "Any workflow in the target application (used to resolve the app). Its uuid or stable workflow_id from didit_workflow_search/list — NOT a label, slug or node id. An exact label is resolved when it matches exactly one workflow; otherwise the candidates are listed for you to pick." },
|
|
1268
|
+
feature: { type: "string", enum: feature_config_schema_1.WORKFLOW_FEATURES, description: "Return only fields for this feature to keep the response small" },
|
|
1269
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1270
|
+
},
|
|
1271
|
+
required: ["workflow_id"],
|
|
1272
|
+
},
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
name: "didit_workflow_get_feature_config_schema",
|
|
1276
|
+
description: "The exact `config` object each workflow feature accepts - every key, its type, bounds, " +
|
|
1277
|
+
"default, accepted values and meaning. Generated from the backend serializers that validate " +
|
|
1278
|
+
"a save (contract " + feature_config_schema_1.FEATURE_CONFIG_CHECKSUM + "), so it is never out of date with the API. " +
|
|
1279
|
+
"Call it before configuring a feature you have not configured before, and whenever a config " +
|
|
1280
|
+
"key you set came back missing: a key outside this contract is dropped silently. Pass " +
|
|
1281
|
+
"`feature` for one feature (" + feature_config_schema_1.WORKFLOW_FEATURES.join(", ") + "), or omit it for all of them.",
|
|
1282
|
+
inputSchema: {
|
|
1283
|
+
type: "object",
|
|
1284
|
+
properties: {
|
|
1285
|
+
feature: {
|
|
1286
|
+
type: "string",
|
|
1287
|
+
enum: feature_config_schema_1.WORKFLOW_FEATURES,
|
|
1288
|
+
description: "Restrict the answer to one feature. Omit for the whole contract.",
|
|
1289
|
+
},
|
|
1290
|
+
},
|
|
1291
|
+
},
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
name: "didit_workflow_get_id_verification_methods_catalog",
|
|
1295
|
+
description: "The ID Verification methods catalog: per country, whether non-doc lookup (the user types their " +
|
|
1296
|
+
"national ID number and we check the official government database) is offered, which " +
|
|
1297
|
+
"digital-identity wallets (MitID, BankID, itsme, ...) are offered, their availability " +
|
|
1298
|
+
"(`available` can be enabled, `coming_soon` cannot), the plain-language request and response " +
|
|
1299
|
+
"fields, and catalog prices. Read this BEFORE setting `methods` on an OCR node: a method or " +
|
|
1300
|
+
"wallet that is not available for the country is rejected on save. Wallets are an accept-list " +
|
|
1301
|
+
"(no ordering). Every non-document price except the document price is a placeholder until " +
|
|
1302
|
+
"the pricing catalog is published. Pass `country` (ISO3) to get one country's view.",
|
|
1303
|
+
inputSchema: {
|
|
1304
|
+
type: "object",
|
|
1305
|
+
properties: {
|
|
1306
|
+
workflow_id: { type: "string", description: "Any workflow in the target application (used to resolve the app)" },
|
|
1307
|
+
country: { type: "string", description: "ISO 3166-1 alpha-3 code to narrow the catalog to one country (e.g. ZAF, DNK)" },
|
|
1308
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1309
|
+
},
|
|
1310
|
+
required: ["workflow_id"],
|
|
1311
|
+
},
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
name: "didit_workflow_get_kyb_registry_catalog",
|
|
1315
|
+
description: "The KYB registry catalog: per country (ISO-2, unlike `methods`/`documents_allowed` which are " +
|
|
1316
|
+
"ISO-3), which company-data tiers the registries offer - `basic` (Lite: company profile), " +
|
|
1317
|
+
"`shareholders`, `ubo` (beneficial owners) - with their retail price per company selected, and " +
|
|
1318
|
+
"whether continuous registry monitoring is sold there (per company per year). Read this BEFORE " +
|
|
1319
|
+
"writing `kyb_registry_countries_config` with a tier other than `basic`, or switching " +
|
|
1320
|
+
"`kyb_registry_monitoring_enabled` on: a tier the country does not offer is rejected on save, and " +
|
|
1321
|
+
"monitoring only applies to countries at an ownership tier where it is available. A company the " +
|
|
1322
|
+
"applicant types in by hand is billed a flat fee instead. Without `countries` you get a summary " +
|
|
1323
|
+
"(counts, the countries with no registry, the Lite-only ones); pass `countries` for the exact " +
|
|
1324
|
+
"per-country table. Prices here are the catalog's retail prices, not placeholders.",
|
|
1325
|
+
inputSchema: {
|
|
1326
|
+
type: "object",
|
|
1327
|
+
properties: {
|
|
1328
|
+
countries: {
|
|
1329
|
+
type: "array",
|
|
1330
|
+
items: { type: "string" },
|
|
1331
|
+
description: "ISO 3166-1 alpha-2 codes to narrow the catalog to (e.g. [\"ES\", \"DE\"]). Omit for the summary.",
|
|
1332
|
+
},
|
|
1333
|
+
},
|
|
1334
|
+
},
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
name: "didit_workflow_get_branch_fields",
|
|
1338
|
+
description: "Given a candidate graph and a branch node, return the fields actually available at that point (only features that completed on every path reaching the branch, plus dynamically-derived Document-AI/questionnaire fields).",
|
|
1339
|
+
inputSchema: {
|
|
1340
|
+
type: "object",
|
|
1341
|
+
properties: {
|
|
1342
|
+
workflow_id: { type: "string", description: "Workflow version uuid or stable workflow_id" },
|
|
1343
|
+
graph: {
|
|
1344
|
+
...WORKFLOW_GRAPH_SCHEMA,
|
|
1345
|
+
description: "REQUIRED. The candidate graph to evaluate: the `graph` object returned by didit_workflow_get_graph / ui_workflow_get_graph (start_node + nodes), optionally with your unsaved edits applied.",
|
|
1346
|
+
},
|
|
1347
|
+
branch_node_id: { type: "string", description: "REQUIRED. The id of a branch node in that graph (a key of graph.nodes whose node_type is 'branch') — availability is evaluated at that point." },
|
|
1348
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1349
|
+
},
|
|
1350
|
+
required: ["workflow_id", "graph", "branch_node_id"],
|
|
1351
|
+
},
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
name: "didit_workflow_validate_graph",
|
|
1355
|
+
description: "Dry-run validate a graph WITHOUT saving. Returns per-node errors (bad field/operator, missing dependency, branching on a field before its feature runs, etc.). Always validate before didit_workflow_set_graph.",
|
|
1356
|
+
inputSchema: {
|
|
1357
|
+
type: "object",
|
|
1358
|
+
properties: {
|
|
1359
|
+
workflow_id: {
|
|
1360
|
+
type: "string",
|
|
1361
|
+
description: "Workflow version uuid or stable workflow_id. OPTIONAL: omit to validate a graph for a workflow " +
|
|
1362
|
+
"that does not exist yet (an unsaved canvas); pass workflow_type instead when KYC/KYB matters.",
|
|
1363
|
+
},
|
|
1364
|
+
workflow_type: { type: "string", enum: ["kyc", "kyb"], description: "Segregation check for a not-yet-created workflow." },
|
|
1365
|
+
graph: WORKFLOW_GRAPH_SCHEMA,
|
|
1366
|
+
include_config: { type: "boolean", description: "Return the validated graph's full feature configs (default false summarizes large values)" },
|
|
1367
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1368
|
+
},
|
|
1369
|
+
required: ["graph"],
|
|
1370
|
+
},
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
name: "didit_workflow_edit_graph",
|
|
1374
|
+
description: "MODIFY an existing workflow's graph with small OPERATIONS - the right tool for editing a live workflow. You send only the deltas; the MCP fetches the full current graph SERVER-SIDE, applies your ops in order, validates, auto-creates a DRAFT (the live version is never touched), and saves. This means huge feature configs (documents_allowed, poa_documents_allowed, phone countries) are preserved exactly and you NEVER resend them. Validation failures return `applied:false` with the errors (nothing saved). The six op shapes are documented on the `operations` parameter; a typical edit upserts new nodes with set_node and rewires their neighbors with set_next. To branch after a feature node, point its `next` at a new branch node whose `branches` carry the rules (from didit_workflow_get_field_definitions) and whose goto targets are new status or feature nodes.",
|
|
1375
|
+
inputSchema: {
|
|
1376
|
+
type: "object",
|
|
1377
|
+
properties: {
|
|
1378
|
+
workflow_id: { type: "string", description: "Workflow version uuid or stable workflow_id" },
|
|
1379
|
+
operations: {
|
|
1380
|
+
type: "array",
|
|
1381
|
+
minItems: 1,
|
|
1382
|
+
description: "Ordered edits applied to the full server-side graph. Each: one of — {op:'set_node', node_id, node:{…}} upsert a node; {op:'remove_node', node_id}; {op:'set_next', node_id, next:'<id|null>'} rewire a node's unconditional next; {op:'set_branches', node_id, branches:[…]} set conditional branches; {op:'merge_node_config', node_id, config:{…}} shallow-merge config keys (preserves the big allow-lists); {op:'set_start', start_node}.",
|
|
1383
|
+
items: { type: "object", properties: { op: { type: "string", enum: ["set_node", "remove_node", "set_next", "set_branches", "merge_node_config", "set_start"] }, node_id: { type: "string" }, node: { type: "object" }, next: { type: ["string", "null"] }, branches: { type: "array", items: { type: "object" } }, config: { type: "object" }, start_node: { type: "string" } }, required: ["op"] },
|
|
1384
|
+
},
|
|
1385
|
+
publish: { type: "boolean", description: "Publish after saving (default false → leaves a reviewable DRAFT)" },
|
|
1386
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1387
|
+
},
|
|
1388
|
+
required: ["workflow_id", "operations"],
|
|
1389
|
+
},
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
name: "didit_workflow_set_graph",
|
|
1393
|
+
description: "Replace a workflow's ENTIRE node/graph. Use this only to build a NEW/small workflow from scratch — to modify an EXISTING workflow prefer didit_workflow_edit_graph (you'd otherwise have to resend every node incl. multi-100KB allow-lists). If the workflow is published, a DRAFT is auto-created and the graph applied there (a live version is NEVER mutated); reviewable DRAFT unless `publish:true`. Validate first. Example graph: OCR → branch[ kyc.status==Declined → status(Declined); kyc.extra_fields.profession fuzzy_match 'Software Engineer' score 80 → DOCUMENT_AI(proof of funds) → status(Determine) ; else → status(Determine) ].",
|
|
1394
|
+
inputSchema: {
|
|
1395
|
+
type: "object",
|
|
1396
|
+
properties: {
|
|
1397
|
+
workflow_id: { type: "string", description: "Workflow version uuid or stable workflow_id" },
|
|
1398
|
+
graph: WORKFLOW_GRAPH_SCHEMA,
|
|
1399
|
+
publish: { type: "boolean", description: "Publish the draft after saving (default false → leaves a reviewable DRAFT)" },
|
|
1400
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1401
|
+
},
|
|
1402
|
+
required: ["workflow_id", "graph"],
|
|
1403
|
+
},
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
name: "didit_workflow_create_draft",
|
|
1407
|
+
description: "Create an editable DRAFT version from a published workflow (graph/config edits require a DRAFT). Returns the new draft's uuid.",
|
|
1408
|
+
inputSchema: {
|
|
1409
|
+
type: "object",
|
|
1410
|
+
properties: {
|
|
1411
|
+
workflow_id: { type: "string", description: "Workflow version uuid or stable workflow_id" },
|
|
1412
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1413
|
+
},
|
|
1414
|
+
required: ["workflow_id"],
|
|
1415
|
+
},
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
name: "didit_workflow_publish",
|
|
1419
|
+
description: "Publish the workflow version that holds the pending changes — makes it live for NEW sessions. Existing sessions are unaffected. Pass the `version_uuid` that set_graph/edit_graph returned: a published version can never hold an edit, so a stable workflow_id resolves to the version that is ALREADY live. Publishing a live version with no draft is refused instead of reported as done.",
|
|
1420
|
+
inputSchema: {
|
|
1421
|
+
type: "object",
|
|
1422
|
+
properties: {
|
|
1423
|
+
workflow_id: { type: "string", description: "The DRAFT version uuid to publish — the `version_uuid` returned by didit_workflow_set_graph / didit_workflow_edit_graph. A stable workflow_id also resolves, and then the draft holding the changes is published rather than the version already live." },
|
|
1424
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1425
|
+
},
|
|
1426
|
+
required: ["workflow_id"],
|
|
1427
|
+
},
|
|
1428
|
+
},
|
|
1429
|
+
// ── Questionnaires ──────────────────────────────────────────────────
|
|
1430
|
+
{
|
|
1431
|
+
name: "didit_questionnaire_list",
|
|
1432
|
+
description: "List all custom questionnaires for your application.",
|
|
1433
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
name: "didit_questionnaire_create",
|
|
1437
|
+
description: "Create a custom questionnaire from an ordered list of questions. Send `title` + `form_elements` (an array of form-element objects, each with an UPPERCASE element_type) — NOT `questions`. The MCP assembles them into the questionnaire graph the backend stores (node ids and their ordering are derived here), so send the questions in the order the user should answer them and never build a graph yourself. Pass status:'draft' to keep it unpublished. A choice list longer than ~100 options does NOT fit in one call (the call is emitted token by token and gets cut off mid-JSON): create with status:'draft' carrying only the first ~100 choices, then add the rest with didit_questionnaire_append_choices in batches (its publish flag publishes with the final batch — a published questionnaire cannot be edited further).",
|
|
1438
|
+
inputSchema: {
|
|
1439
|
+
type: "object",
|
|
1440
|
+
properties: {
|
|
1441
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1442
|
+
title: { type: "string", description: "Questionnaire title" },
|
|
1443
|
+
description: { type: "string", description: "Description shown to the user" },
|
|
1444
|
+
...FORM_ELEMENTS_PROP,
|
|
1445
|
+
...QUESTIONNAIRE_LANG_PROPS,
|
|
1446
|
+
},
|
|
1447
|
+
required: ["title", "form_elements"],
|
|
1448
|
+
},
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
name: "didit_questionnaire_append_choices",
|
|
1452
|
+
description: "Append a batch of answer options to ONE question of an existing DRAFT questionnaire (create it with status:'draft' — a published questionnaire cannot be edited). Use it for long choice lists: create with the first ~100 choices, then append the rest here in batches of ~100 until the source list is exhausted, passing publish:true on the FINAL batch to publish. Choices the question already has (same value) are skipped, so retrying a batch never duplicates. Returns a compact summary whose total_choices is the stored count — verify against it instead of re-fetching the questionnaire.",
|
|
1453
|
+
inputSchema: {
|
|
1454
|
+
type: "object",
|
|
1455
|
+
properties: {
|
|
1456
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1457
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
1458
|
+
node_id: {
|
|
1459
|
+
type: "string",
|
|
1460
|
+
description: "Graph node id of the question (e.g. 'q1', positional from the create call). Optional when exactly one question has choices.",
|
|
1461
|
+
},
|
|
1462
|
+
choices: {
|
|
1463
|
+
type: "array",
|
|
1464
|
+
items: { type: "object" },
|
|
1465
|
+
description: "Batch of choices to append, ~100 per call maximum. Each: { value, label?, requires_text_input? }",
|
|
1466
|
+
},
|
|
1467
|
+
publish: {
|
|
1468
|
+
type: "boolean",
|
|
1469
|
+
description: "Pass true on the LAST batch to publish the questionnaire; intermediate batches keep it a draft.",
|
|
1470
|
+
},
|
|
1471
|
+
},
|
|
1472
|
+
required: ["questionnaire_id", "choices"],
|
|
1473
|
+
},
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
name: "didit_questionnaire_get",
|
|
1477
|
+
description: "Get questionnaire questions and options. Translations are summarized to one locale by default to keep the response consumable; pass include_translations:true for every locale.",
|
|
1478
|
+
inputSchema: {
|
|
1479
|
+
type: "object",
|
|
1480
|
+
properties: {
|
|
1481
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1482
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
1483
|
+
include_translations: { type: "boolean", description: "Return every locale translation (default false returns English or the first available locale)" },
|
|
1484
|
+
},
|
|
1485
|
+
required: ["questionnaire_id"],
|
|
1486
|
+
},
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
name: "didit_questionnaire_update",
|
|
1490
|
+
description: "Overwrite a questionnaire's supplied settings. Sending form_elements REPLACES the entire question list, removing omitted questions; pass every question to keep, in order, with UPPERCASE element_type. Before calling, show the questionnaire and proposed changes and obtain explicit user confirmation, including the full replacement when form_elements is supplied.",
|
|
1491
|
+
inputSchema: {
|
|
1492
|
+
type: "object",
|
|
1493
|
+
properties: {
|
|
1494
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1495
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
1496
|
+
title: { type: "string" },
|
|
1497
|
+
description: { type: "string" },
|
|
1498
|
+
...FORM_ELEMENTS_PROP,
|
|
1499
|
+
...QUESTIONNAIRE_LANG_PROPS,
|
|
1500
|
+
},
|
|
1501
|
+
required: ["questionnaire_id"],
|
|
1502
|
+
},
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
name: "didit_questionnaire_delete",
|
|
1506
|
+
description: "Delete a questionnaire.",
|
|
1507
|
+
inputSchema: {
|
|
1508
|
+
type: "object",
|
|
1509
|
+
properties: {
|
|
1510
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1511
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
1512
|
+
},
|
|
1513
|
+
required: ["questionnaire_id"],
|
|
1514
|
+
},
|
|
1515
|
+
},
|
|
1516
|
+
// ── Users (verified individuals / KYC) ──────────────────────────────
|
|
1517
|
+
{
|
|
1518
|
+
name: "didit_vendor_user_list",
|
|
1519
|
+
description: "List verified users (grouped by vendor_data) for ONE app; with multiple apps (or no scope) it auto-spans all your apps. For a cross-app customer lookup prefer didit_vendor_user_search. Supports limit/offset pagination.",
|
|
1520
|
+
inputSchema: {
|
|
1521
|
+
type: "object",
|
|
1522
|
+
properties: {
|
|
1523
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1524
|
+
limit: { type: "string" },
|
|
1525
|
+
offset: { type: "string" },
|
|
1526
|
+
},
|
|
1527
|
+
},
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
name: "didit_vendor_user_create",
|
|
1531
|
+
description: "Create a user record manually (e.g. to pre-register a vendor_data identity or attach allowlisted emails/phones).",
|
|
1532
|
+
inputSchema: {
|
|
1533
|
+
type: "object",
|
|
1534
|
+
properties: {
|
|
1535
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1536
|
+
vendor_data: { type: "string", description: "REQUIRED. Your unique identifier for the user" },
|
|
1537
|
+
full_name: { type: "string" },
|
|
1538
|
+
display_name: { type: "string" },
|
|
1539
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD" },
|
|
1540
|
+
status: { type: "string", enum: ENTITY_STATUSES },
|
|
1541
|
+
metadata: { type: "object" },
|
|
1542
|
+
approved_emails: { type: "array", items: { type: "string" } },
|
|
1543
|
+
approved_phones: { type: "array", items: { type: "string" } },
|
|
1544
|
+
issuing_states: { type: "array", items: { type: "string" } },
|
|
1545
|
+
},
|
|
1546
|
+
required: ["vendor_data"],
|
|
1547
|
+
},
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
name: "didit_vendor_user_get",
|
|
1551
|
+
description: "Get details of a specific user by their vendor_data identifier.",
|
|
1552
|
+
inputSchema: {
|
|
1553
|
+
type: "object",
|
|
1554
|
+
properties: {
|
|
1555
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1556
|
+
vendor_data: { type: "string", description: "The vendor_data value that identifies the user" },
|
|
1557
|
+
},
|
|
1558
|
+
required: ["vendor_data"],
|
|
1559
|
+
},
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
name: "didit_vendor_user_update",
|
|
1563
|
+
description: "Update a user's profile fields. Only send the fields you want to change. To change ONLY the monitoring status, prefer didit_vendor_user_update_status.",
|
|
1564
|
+
inputSchema: {
|
|
1565
|
+
type: "object",
|
|
1566
|
+
properties: {
|
|
1567
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1568
|
+
vendor_data: { type: "string", description: "The vendor_data value that identifies the user" },
|
|
1569
|
+
full_name: { type: "string" },
|
|
1570
|
+
display_name: { type: "string" },
|
|
1571
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD" },
|
|
1572
|
+
status: { type: "string", enum: ENTITY_STATUSES, description: "Monitoring status" },
|
|
1573
|
+
metadata: { type: "object" },
|
|
1574
|
+
approved_emails: { type: "array", items: { type: "string" } },
|
|
1575
|
+
approved_phones: { type: "array", items: { type: "string" } },
|
|
1576
|
+
issuing_states: { type: "array", items: { type: "string" } },
|
|
1577
|
+
},
|
|
1578
|
+
required: ["vendor_data"],
|
|
1579
|
+
},
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
name: "didit_vendor_user_update_status",
|
|
1583
|
+
description: "Set a user's monitoring status (ACTIVE, FLAGGED, or BLOCKED).",
|
|
1584
|
+
inputSchema: {
|
|
1585
|
+
type: "object",
|
|
1586
|
+
properties: {
|
|
1587
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1588
|
+
vendor_data: { type: "string", description: "The vendor_data value that identifies the user" },
|
|
1589
|
+
status: { type: "string", enum: ENTITY_STATUSES, description: "New status" },
|
|
1590
|
+
},
|
|
1591
|
+
required: ["vendor_data", "status"],
|
|
1592
|
+
},
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
name: "didit_vendor_user_delete",
|
|
1596
|
+
description: "Batch delete users by vendor_data list, or delete all users.",
|
|
1597
|
+
inputSchema: {
|
|
1598
|
+
type: "object",
|
|
1599
|
+
properties: {
|
|
1600
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1601
|
+
vendor_data_list: {
|
|
1602
|
+
type: "array",
|
|
1603
|
+
items: { type: "string" },
|
|
1604
|
+
description: "Array of vendor_data values to delete",
|
|
1605
|
+
},
|
|
1606
|
+
delete_all: { type: "boolean", description: "Set true to delete ALL users" },
|
|
1607
|
+
confirm: {
|
|
1608
|
+
type: "boolean",
|
|
1609
|
+
description: "REQUIRED when delete_all is true - permanently removes EVERY vendor user. Only set after explicit user confirmation of this exact action.",
|
|
1610
|
+
},
|
|
1611
|
+
},
|
|
1612
|
+
},
|
|
1613
|
+
},
|
|
1614
|
+
// ── Businesses (KYB) ────────────────────────────────────────────────
|
|
1615
|
+
{
|
|
1616
|
+
name: "didit_vendor_business_list",
|
|
1617
|
+
description: "List verified businesses (KYB, grouped by vendor_data) for ONE app; with multiple apps (or no scope) it auto-spans all your apps. For a cross-app lookup prefer didit_vendor_business_search. Supports limit/offset pagination.",
|
|
1618
|
+
inputSchema: {
|
|
1619
|
+
type: "object",
|
|
1620
|
+
properties: {
|
|
1621
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1622
|
+
limit: { type: "string" },
|
|
1623
|
+
offset: { type: "string" },
|
|
1624
|
+
},
|
|
1625
|
+
},
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
name: "didit_vendor_business_create",
|
|
1629
|
+
description: "Create a business record manually (KYB).",
|
|
1630
|
+
inputSchema: {
|
|
1631
|
+
type: "object",
|
|
1632
|
+
properties: {
|
|
1633
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1634
|
+
vendor_data: { type: "string", description: "Your unique identifier for the business" },
|
|
1635
|
+
display_name: { type: "string" },
|
|
1636
|
+
legal_name: { type: "string" },
|
|
1637
|
+
registration_number: { type: "string" },
|
|
1638
|
+
country_code: { type: "string", description: "ISO 3166-1 alpha-2 country code" },
|
|
1639
|
+
status: { type: "string", enum: ENTITY_STATUSES },
|
|
1640
|
+
metadata: { type: "object" },
|
|
1641
|
+
},
|
|
1642
|
+
},
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
name: "didit_vendor_business_get",
|
|
1646
|
+
description: "Get details of a specific business by its vendor_data identifier.",
|
|
1647
|
+
inputSchema: {
|
|
1648
|
+
type: "object",
|
|
1649
|
+
properties: {
|
|
1650
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1651
|
+
vendor_data: { type: "string", description: "The vendor_data value that identifies the business" },
|
|
1652
|
+
},
|
|
1653
|
+
required: ["vendor_data"],
|
|
101
1654
|
},
|
|
102
1655
|
},
|
|
103
1656
|
{
|
|
104
|
-
name: "
|
|
105
|
-
description: "
|
|
1657
|
+
name: "didit_vendor_business_update",
|
|
1658
|
+
description: "Update a business's profile fields. Only send the fields you want to change.",
|
|
106
1659
|
inputSchema: {
|
|
107
1660
|
type: "object",
|
|
108
1661
|
properties: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1662
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1663
|
+
vendor_data: { type: "string" },
|
|
1664
|
+
display_name: { type: "string" },
|
|
1665
|
+
legal_name: { type: "string" },
|
|
1666
|
+
registration_number: { type: "string" },
|
|
1667
|
+
country_code: { type: "string", description: "ISO 3166-1 alpha-2 country code" },
|
|
1668
|
+
status: { type: "string", enum: ENTITY_STATUSES },
|
|
1669
|
+
metadata: { type: "object" },
|
|
112
1670
|
},
|
|
113
|
-
required: ["
|
|
1671
|
+
required: ["vendor_data"],
|
|
114
1672
|
},
|
|
115
1673
|
},
|
|
116
|
-
// ── Sessions ────────────────────────────────────────────────────────
|
|
117
1674
|
{
|
|
118
|
-
name: "
|
|
119
|
-
description: "
|
|
1675
|
+
name: "didit_vendor_business_update_status",
|
|
1676
|
+
description: "Set a business's monitoring status (ACTIVE, FLAGGED, or BLOCKED).",
|
|
120
1677
|
inputSchema: {
|
|
121
1678
|
type: "object",
|
|
122
1679
|
properties: {
|
|
123
|
-
|
|
124
|
-
vendor_data: { type: "string"
|
|
125
|
-
|
|
1680
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1681
|
+
vendor_data: { type: "string" },
|
|
1682
|
+
status: { type: "string", enum: ENTITY_STATUSES, description: "New status" },
|
|
126
1683
|
},
|
|
1684
|
+
required: ["vendor_data", "status"],
|
|
127
1685
|
},
|
|
128
1686
|
},
|
|
129
1687
|
{
|
|
130
|
-
name: "
|
|
131
|
-
description: "
|
|
1688
|
+
name: "didit_vendor_business_delete",
|
|
1689
|
+
description: "Batch delete businesses by vendor_data list and/or didit_internal_id list, or delete all businesses.",
|
|
132
1690
|
inputSchema: {
|
|
133
1691
|
type: "object",
|
|
134
1692
|
properties: {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
1693
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1694
|
+
vendor_data_list: { type: "array", items: { type: "string" } },
|
|
1695
|
+
didit_internal_id_list: { type: "array", items: { type: "string" } },
|
|
1696
|
+
delete_all: { type: "boolean", description: "Set true to delete ALL businesses" },
|
|
1697
|
+
confirm: {
|
|
1698
|
+
type: "boolean",
|
|
1699
|
+
description: "REQUIRED when delete_all is true - permanently removes EVERY vendor business. Only set after explicit user confirmation of this exact action.",
|
|
1700
|
+
},
|
|
139
1701
|
},
|
|
140
1702
|
},
|
|
141
1703
|
},
|
|
1704
|
+
// ── Transactions (AML transaction monitoring) ───────────────────────
|
|
142
1705
|
{
|
|
143
|
-
name: "
|
|
144
|
-
description: "
|
|
1706
|
+
name: "didit_transaction_list",
|
|
1707
|
+
description: "List monitored transactions for ONE app; with multiple apps (or no scope) it auto-spans all your apps. For a cross-app query prefer didit_transaction_search. Supports limit/offset pagination.",
|
|
145
1708
|
inputSchema: {
|
|
146
1709
|
type: "object",
|
|
147
1710
|
properties: {
|
|
148
|
-
|
|
1711
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1712
|
+
limit: { type: "string" },
|
|
1713
|
+
offset: { type: "string" },
|
|
149
1714
|
},
|
|
150
|
-
required: ["session_id"],
|
|
151
1715
|
},
|
|
152
1716
|
},
|
|
153
1717
|
{
|
|
154
|
-
name: "
|
|
155
|
-
description: "
|
|
1718
|
+
name: "didit_transaction_create",
|
|
1719
|
+
description: "Submit a transaction for monitoring and rule evaluation. transaction_details and subject shapes depend on transaction_category.",
|
|
156
1720
|
inputSchema: {
|
|
157
1721
|
type: "object",
|
|
158
1722
|
properties: {
|
|
159
|
-
|
|
160
|
-
|
|
1723
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1724
|
+
transaction_id: { type: "string", description: "REQUIRED. Your unique transaction identifier" },
|
|
1725
|
+
transaction_category: {
|
|
1726
|
+
type: "string",
|
|
1727
|
+
enum: ["finance", "kyc", "travel_rule", "user_event", "audit_trail_event", "gambling_bet", "gambling_limit_change", "gambling_bonus_change"],
|
|
1728
|
+
description: "REQUIRED. Determines the expected transaction_details/subject shape",
|
|
1729
|
+
},
|
|
1730
|
+
transaction_details: { type: "object", description: "REQUIRED. Category-specific transaction payload" },
|
|
1731
|
+
subject: { type: "object", description: "REQUIRED. The party initiating the transaction (usually a vendor_data reference)" },
|
|
1732
|
+
counterparty: { type: "object", description: "The other party in the transaction" },
|
|
1733
|
+
transaction_at: { type: "string", description: "ISO timestamp of the transaction" },
|
|
1734
|
+
time_zone: { type: "string" },
|
|
1735
|
+
custom_properties: { type: "object", description: "Custom values keyed for monitoring rules (custom_values.<key>)" },
|
|
1736
|
+
travel_rule_details: { type: "object" },
|
|
1737
|
+
network_snapshot: { type: "object" },
|
|
1738
|
+
include_crypto_screening: { type: "boolean" },
|
|
161
1739
|
},
|
|
162
|
-
required: ["
|
|
1740
|
+
required: ["transaction_id", "transaction_category", "transaction_details", "subject"],
|
|
163
1741
|
},
|
|
164
1742
|
},
|
|
165
1743
|
{
|
|
166
|
-
name: "
|
|
167
|
-
description: "
|
|
1744
|
+
name: "didit_transaction_get",
|
|
1745
|
+
description: "Get a single monitored transaction and its rule-evaluation result.",
|
|
168
1746
|
inputSchema: {
|
|
169
1747
|
type: "object",
|
|
170
1748
|
properties: {
|
|
171
|
-
|
|
1749
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1750
|
+
transaction_id: { type: "string", description: "Transaction ID" },
|
|
172
1751
|
},
|
|
173
|
-
required: ["
|
|
1752
|
+
required: ["transaction_id"],
|
|
174
1753
|
},
|
|
175
1754
|
},
|
|
176
1755
|
{
|
|
177
|
-
name: "
|
|
178
|
-
description: "
|
|
1756
|
+
name: "didit_transaction_screen_wallet",
|
|
1757
|
+
description: "Screen a single crypto wallet address for AML risk WITHOUT creating a transaction. Returns risk_score, severity, sanctions_hit, source/destination of funds. Requires transaction monitoring to be configured (a provider key) or returns 409.",
|
|
179
1758
|
inputSchema: {
|
|
180
1759
|
type: "object",
|
|
181
1760
|
properties: {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
1761
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1762
|
+
wallet_address: { type: "string", description: "REQUIRED. The crypto address to screen (must match the chain's address format)" },
|
|
1763
|
+
blockchain: {
|
|
1764
|
+
type: "string",
|
|
1765
|
+
enum: ["BTC", "ETH", "LTC", "XRP", "BCH", "DOGE", "TRX", "SOL", "MATIC", "BNB", "USDT", "USDC"],
|
|
1766
|
+
description: "REQUIRED. Asset / chain identifier",
|
|
1767
|
+
},
|
|
1768
|
+
direction: {
|
|
1769
|
+
type: "string",
|
|
1770
|
+
enum: ["inbound", "outbound", "deposit", "withdrawal"],
|
|
1771
|
+
description: "Optional screening direction context",
|
|
186
1772
|
},
|
|
187
|
-
delete_all: { type: "boolean", description: "Set true to delete ALL sessions (ignores session_numbers)" },
|
|
188
1773
|
},
|
|
1774
|
+
required: ["wallet_address", "blockchain"],
|
|
189
1775
|
},
|
|
190
1776
|
},
|
|
1777
|
+
...(0, internal_tools_1.internalToolDefs)("transaction_sdk_token"),
|
|
191
1778
|
{
|
|
192
|
-
name: "
|
|
193
|
-
description: "
|
|
1779
|
+
name: "didit_transaction_rule_list",
|
|
1780
|
+
description: "List transaction-monitoring rules for one app. Filter by source (PRESET or CUSTOM), category, mode " +
|
|
1781
|
+
"(ACTIVE evaluates and acts, TEST evaluates and records but skips actions, DISABLED is skipped), bundle, " +
|
|
1782
|
+
"or free-text search. ordering accepts one or more comma-separated fields; prefix a field with '-' to reverse it.",
|
|
194
1783
|
inputSchema: {
|
|
195
1784
|
type: "object",
|
|
196
1785
|
properties: {
|
|
197
|
-
|
|
1786
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1787
|
+
source: { type: "string", enum: ["PRESET", "CUSTOM"] },
|
|
1788
|
+
category: { type: "string" },
|
|
1789
|
+
mode: { type: "string", enum: ["ACTIVE", "DISABLED", "TEST"] },
|
|
1790
|
+
bundle: { type: "string" },
|
|
1791
|
+
search: { type: "string" },
|
|
1792
|
+
ordering: {
|
|
1793
|
+
type: "string",
|
|
1794
|
+
description: "Comma-separated fields from run_count, approved_pct, reviewed_pct, declined_pct, " +
|
|
1795
|
+
"latest_triggered_at, title, created_at, source. Prefix any field with '-' for descending order.",
|
|
1796
|
+
},
|
|
1797
|
+
limit: { type: "string" },
|
|
1798
|
+
offset: { type: "string" },
|
|
198
1799
|
},
|
|
199
|
-
required: ["session_id"],
|
|
200
1800
|
},
|
|
201
1801
|
},
|
|
202
1802
|
{
|
|
203
|
-
name: "
|
|
204
|
-
description: "
|
|
1803
|
+
name: "didit_transaction_rule_get",
|
|
1804
|
+
description: "Get one transaction-monitoring rule, including its persisted conditions, aggregation, scope, actions, and counters.",
|
|
205
1805
|
inputSchema: {
|
|
206
1806
|
type: "object",
|
|
207
1807
|
properties: {
|
|
208
|
-
|
|
1808
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1809
|
+
rule_uuid: { type: "string", description: "REQUIRED. Rule UUID from didit_transaction_rule_list." },
|
|
209
1810
|
},
|
|
210
|
-
required: ["
|
|
1811
|
+
required: ["rule_uuid"],
|
|
211
1812
|
},
|
|
212
1813
|
},
|
|
213
1814
|
{
|
|
214
|
-
name: "
|
|
215
|
-
description: "
|
|
1815
|
+
name: "didit_transaction_rule_create",
|
|
1816
|
+
description: "Create a CUSTOM transaction-monitoring rule. Include the entire requested persisted rule in this call: " +
|
|
1817
|
+
"conditions, aggregation checks, and actions. Backtest accepts a hypothetical config but never attaches " +
|
|
1818
|
+
"aggregation or actions to a created rule. Prefer mode:'TEST', backtest the exact saved config, then switch " +
|
|
1819
|
+
"to ACTIVE only after confirming the hit rate. title is unique among non-deleted rules in the app. " +
|
|
1820
|
+
"actions is REQUIRED: every outcome the user named (review, decline, approve, score, case) must appear " +
|
|
1821
|
+
"there; pass [] ONLY when the user explicitly wants a monitor-only rule that does nothing on match.",
|
|
216
1822
|
inputSchema: {
|
|
217
1823
|
type: "object",
|
|
218
1824
|
properties: {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
1825
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1826
|
+
title: { type: "string", description: "REQUIRED. Unique per application." },
|
|
1827
|
+
category: { type: "string", description: "REQUIRED. Rule category, e.g. finance or aml_ctf." },
|
|
1828
|
+
mode: {
|
|
1829
|
+
type: "string",
|
|
1830
|
+
enum: ["ACTIVE", "DISABLED", "TEST"],
|
|
1831
|
+
description: "REQUIRED. Prefer TEST for a new or materially changed rule.",
|
|
1832
|
+
},
|
|
1833
|
+
description: { type: "string" },
|
|
1834
|
+
...RULE_EVALUATION_MODE_PROP,
|
|
1835
|
+
...RULE_SCOPE_PROP,
|
|
1836
|
+
...RULE_CONDITIONS_PROP,
|
|
1837
|
+
...RULE_AGGREGATION_PROP,
|
|
1838
|
+
...RULE_ACTIONS_PROP,
|
|
1839
|
+
metadata: { type: "object", description: "Free-form key/value metadata." },
|
|
222
1840
|
},
|
|
223
|
-
required: ["
|
|
1841
|
+
required: ["title", "category", "mode", "actions"],
|
|
224
1842
|
},
|
|
225
1843
|
},
|
|
226
1844
|
{
|
|
227
|
-
name: "
|
|
228
|
-
description: "
|
|
1845
|
+
name: "didit_transaction_rule_update",
|
|
1846
|
+
description: "Partially update a transaction-monitoring rule. Send every changed persisted field in this PATCH. PRESET " +
|
|
1847
|
+
"rules only allow mode changes. Before raising impact, backtest the exact candidate config and keep the rule " +
|
|
1848
|
+
"in TEST until the result is acceptable.",
|
|
229
1849
|
inputSchema: {
|
|
230
1850
|
type: "object",
|
|
231
1851
|
properties: {
|
|
232
|
-
|
|
233
|
-
|
|
1852
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1853
|
+
rule_uuid: { type: "string", description: "REQUIRED. Rule UUID." },
|
|
1854
|
+
title: { type: "string" },
|
|
1855
|
+
category: { type: "string" },
|
|
1856
|
+
mode: { type: "string", enum: ["ACTIVE", "DISABLED", "TEST"] },
|
|
1857
|
+
description: { type: "string" },
|
|
1858
|
+
...RULE_EVALUATION_MODE_PROP,
|
|
1859
|
+
...RULE_SCOPE_PROP,
|
|
1860
|
+
...RULE_CONDITIONS_PROP,
|
|
1861
|
+
...RULE_AGGREGATION_PROP,
|
|
1862
|
+
...RULE_ACTIONS_PROP,
|
|
1863
|
+
metadata: { type: "object" },
|
|
234
1864
|
},
|
|
235
|
-
required: ["
|
|
1865
|
+
required: ["rule_uuid"],
|
|
236
1866
|
},
|
|
237
1867
|
},
|
|
238
1868
|
{
|
|
239
|
-
name: "
|
|
240
|
-
description: "
|
|
1869
|
+
name: "didit_transaction_rule_delete",
|
|
1870
|
+
description: "Delete a CUSTOM transaction-monitoring rule. PRESET rules must be removed with didit_transaction_rule_uninstall.",
|
|
241
1871
|
inputSchema: {
|
|
242
1872
|
type: "object",
|
|
243
1873
|
properties: {
|
|
244
|
-
|
|
1874
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1875
|
+
rule_uuid: { type: "string", description: "REQUIRED. Rule UUID." },
|
|
245
1876
|
},
|
|
246
|
-
required: ["
|
|
1877
|
+
required: ["rule_uuid"],
|
|
247
1878
|
},
|
|
248
1879
|
},
|
|
249
|
-
// ── Workflows (Verification Settings) ───────────────────────────────
|
|
250
|
-
{
|
|
251
|
-
name: "didit_list_workflows",
|
|
252
|
-
description: "List all verification workflows for your application. Each workflow defines verification steps, thresholds, and accepted documents.",
|
|
253
|
-
inputSchema: { type: "object", properties: {} },
|
|
254
|
-
},
|
|
255
1880
|
{
|
|
256
|
-
name: "
|
|
257
|
-
description: "
|
|
1881
|
+
name: "didit_transaction_rule_backtest",
|
|
1882
|
+
description: "Dry-run a hypothetical rule config against up to the 10,000 most recent transactions in the app. This " +
|
|
1883
|
+
"writes nothing, accepts no rule_uuid, and never changes or completes a saved rule. To test a saved rule, " +
|
|
1884
|
+
"read it first and pass its exact conditions, aggregation, evaluation_mode, and scope here.",
|
|
258
1885
|
inputSchema: {
|
|
259
1886
|
type: "object",
|
|
260
1887
|
properties: {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
1888
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1889
|
+
...RULE_CONDITIONS_PROP,
|
|
1890
|
+
...RULE_AGGREGATION_PROP,
|
|
1891
|
+
...RULE_EVALUATION_MODE_PROP,
|
|
1892
|
+
...RULE_SCOPE_PROP,
|
|
1893
|
+
period_days: {
|
|
1894
|
+
type: "integer",
|
|
1895
|
+
minimum: 1,
|
|
1896
|
+
maximum: 365,
|
|
1897
|
+
description: "Days of history to evaluate, from 1 through 365. Default 90.",
|
|
1898
|
+
},
|
|
271
1899
|
},
|
|
272
|
-
required: ["workflow_label"],
|
|
273
1900
|
},
|
|
274
1901
|
},
|
|
275
1902
|
{
|
|
276
|
-
name: "
|
|
277
|
-
description: "
|
|
1903
|
+
name: "didit_transaction_rule_library_list",
|
|
1904
|
+
description: "List Didit's preset rule library. Each entry includes its full config, bundle, tags, industries, and is_installed. " +
|
|
1905
|
+
"Filter by bundle, category, or search; paginated.",
|
|
278
1906
|
inputSchema: {
|
|
279
1907
|
type: "object",
|
|
280
1908
|
properties: {
|
|
281
|
-
|
|
1909
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1910
|
+
bundle: { type: "string" },
|
|
1911
|
+
category: { type: "string" },
|
|
1912
|
+
search: { type: "string" },
|
|
1913
|
+
limit: { type: "string" },
|
|
1914
|
+
offset: { type: "string" },
|
|
282
1915
|
},
|
|
283
|
-
required: ["workflow_id"],
|
|
284
1916
|
},
|
|
285
1917
|
},
|
|
286
1918
|
{
|
|
287
|
-
name: "
|
|
288
|
-
description: "
|
|
1919
|
+
name: "didit_transaction_rule_install",
|
|
1920
|
+
description: "Install PRESET rules by library_keys, bundle, or both. If both are supplied, only keys in that bundle are " +
|
|
1921
|
+
"installed. At least one selector is required. Installed rules start ACTIVE when transaction monitoring is " +
|
|
1922
|
+
"enabled for the app, otherwise DISABLED. Set TEST explicitly before relying on a newly installed rule.",
|
|
289
1923
|
inputSchema: {
|
|
290
1924
|
type: "object",
|
|
291
1925
|
properties: {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
is_phone_verification_enabled: { type: "boolean" },
|
|
300
|
-
is_email_verification_enabled: { type: "boolean" },
|
|
301
|
-
is_poa_enabled: { type: "boolean" },
|
|
302
|
-
is_questionnaire_enabled: { type: "boolean" },
|
|
1926
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1927
|
+
library_keys: {
|
|
1928
|
+
type: "array",
|
|
1929
|
+
items: { type: "string" },
|
|
1930
|
+
description: "Specific preset library_key values to install.",
|
|
1931
|
+
},
|
|
1932
|
+
bundle: { type: "string", description: "Install presets from this bundle." },
|
|
303
1933
|
},
|
|
304
|
-
required: ["
|
|
1934
|
+
anyOf: [{ required: ["library_keys"] }, { required: ["bundle"] }],
|
|
305
1935
|
},
|
|
306
1936
|
},
|
|
307
1937
|
{
|
|
308
|
-
name: "
|
|
309
|
-
description: "
|
|
1938
|
+
name: "didit_transaction_rule_uninstall",
|
|
1939
|
+
description: "Remove installed PRESET rules by library_keys, bundle, or both. If both are supplied, only keys in that " +
|
|
1940
|
+
"bundle are removed. At least one selector is required. To pause without removing, update mode to DISABLED.",
|
|
310
1941
|
inputSchema: {
|
|
311
1942
|
type: "object",
|
|
312
1943
|
properties: {
|
|
313
|
-
|
|
1944
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
1945
|
+
library_keys: {
|
|
1946
|
+
type: "array",
|
|
1947
|
+
items: { type: "string" },
|
|
1948
|
+
description: "Specific preset library_key values to uninstall.",
|
|
1949
|
+
},
|
|
1950
|
+
bundle: { type: "string", description: "Uninstall presets from this bundle." },
|
|
314
1951
|
},
|
|
315
|
-
required: ["
|
|
1952
|
+
anyOf: [{ required: ["library_keys"] }, { required: ["bundle"] }],
|
|
316
1953
|
},
|
|
317
1954
|
},
|
|
318
|
-
// ──
|
|
1955
|
+
// ── Travel Rule (FATF / EU TFR managed exchange) ─────────────────────
|
|
1956
|
+
...(0, internal_tools_1.internalToolDefs)("travel_rule"),
|
|
1957
|
+
// ── Marketplace (provider catalog & connections) ─────────────────────
|
|
1958
|
+
...(0, internal_tools_1.internalToolDefs)("marketplace"),
|
|
1959
|
+
// ── Billing ─────────────────────────────────────────────────────────
|
|
319
1960
|
{
|
|
320
|
-
name: "
|
|
321
|
-
description: "
|
|
322
|
-
|
|
1961
|
+
name: "didit_org_get_balance",
|
|
1962
|
+
description: "Get current credit balance and auto-refill settings. A `0.00` balance does NOT by itself " +
|
|
1963
|
+
"block verifications, so never answer a \"not enough credits\" report with \"top up\" from this " +
|
|
1964
|
+
"result alone: a workflow whose features are all free-tier (ID verification, passive liveness, " +
|
|
1965
|
+
"face match 1:1, device/IP analysis — 500 free each per month) runs fine on a zero balance. " +
|
|
1966
|
+
"Read the failing workflow with didit_workflow_list first — `is_white_label_enabled: true` adds " +
|
|
1967
|
+
"$0.20/session AND drops the workflow out of the free tier entirely, which is the single most " +
|
|
1968
|
+
"common cause. This result also carries `allow_free_usage` (false = the free tier is off for " +
|
|
1969
|
+
"this organization) and `usage_summary.white_label_sessions`. Only a NEGATIVE balance stops " +
|
|
1970
|
+
"free-tier work; zero does not.",
|
|
1971
|
+
inputSchema: { type: "object", properties: { organization_id: orgapp_1.ORG_APP_PROPS.organization_id } },
|
|
323
1972
|
},
|
|
324
1973
|
{
|
|
325
|
-
name: "
|
|
326
|
-
description: "Create a
|
|
1974
|
+
name: "didit_org_top_up",
|
|
1975
|
+
description: "Create a Stripe checkout session to top up credits. Returns a checkout URL.",
|
|
327
1976
|
inputSchema: {
|
|
328
1977
|
type: "object",
|
|
329
1978
|
properties: {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
1979
|
+
amount_in_dollars: { type: "number", description: "Amount in USD (minimum $50)" },
|
|
1980
|
+
success_url: { type: "string", description: "Optional redirect after successful payment" },
|
|
1981
|
+
cancel_url: { type: "string", description: "Optional redirect if payment is cancelled" },
|
|
1982
|
+
confirm: {
|
|
1983
|
+
type: "boolean",
|
|
1984
|
+
description: "REQUIRED. Must be true - creates a Stripe checkout that moves money (it never auto-charges). Only set after explicit user confirmation of this exact action.",
|
|
335
1985
|
},
|
|
336
1986
|
},
|
|
337
|
-
required: ["
|
|
1987
|
+
required: ["amount_in_dollars"],
|
|
338
1988
|
},
|
|
339
1989
|
},
|
|
1990
|
+
// ── Customization (verification UI branding) ────────────────────────
|
|
340
1991
|
{
|
|
341
|
-
name: "
|
|
342
|
-
description: "Get
|
|
1992
|
+
name: "didit_branding_get",
|
|
1993
|
+
description: "Get the current branding customization (logos, colors) applied to your verification UI.",
|
|
1994
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
1995
|
+
},
|
|
1996
|
+
{
|
|
1997
|
+
name: "didit_branding_update",
|
|
1998
|
+
description: "Update verification UI branding images and/or the SMS sender name. Each image is a local absolute *_path (local/stdio runs) or inline *_base64 content (hosted runs).",
|
|
343
1999
|
inputSchema: {
|
|
344
2000
|
type: "object",
|
|
345
2001
|
properties: {
|
|
346
|
-
|
|
2002
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2003
|
+
image_square_path: { type: "string", description: "Absolute path to a square logo image (local/stdio only)" },
|
|
2004
|
+
image_rectangular_path: { type: "string", description: "Absolute path to a rectangular logo image (local/stdio only)" },
|
|
2005
|
+
image_favicon_path: { type: "string", description: "Absolute path to a favicon image (local/stdio only)" },
|
|
2006
|
+
image_square_base64: { type: "string", description: "Square logo as base64 or data URL (or an attachment reference like att_1)" },
|
|
2007
|
+
image_rectangular_base64: { type: "string", description: "Rectangular logo as base64 or data URL (or an attachment reference like att_1)" },
|
|
2008
|
+
image_favicon_base64: { type: "string", description: "Favicon as base64 or data URL (or an attachment reference like att_1)" },
|
|
2009
|
+
sms_sender_name: {
|
|
2010
|
+
type: ["string", "null"],
|
|
2011
|
+
maxLength: 30,
|
|
2012
|
+
description: "The name every SMS verification code of this application carries (\"123456 is your verification code for Acme Bank\"), in every workflow and through the phone verification API. Free. 1 to 30 characters: letters, digits, spaces and ' & - ! only, not only digits, single spaces between words. Empty string or null clears it. WhatsApp codes are not branded.",
|
|
2013
|
+
},
|
|
347
2014
|
},
|
|
348
|
-
required: ["questionnaire_id"],
|
|
349
2015
|
},
|
|
350
2016
|
},
|
|
2017
|
+
// ── Webhook destinations ────────────────────────────────────────────
|
|
2018
|
+
{
|
|
2019
|
+
name: "didit_webhook_list",
|
|
2020
|
+
description: "List configured webhook destinations. Each destination has its own URL, version, enabled flag, subscribed events, and redacted signing-secret metadata.",
|
|
2021
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2022
|
+
},
|
|
351
2023
|
{
|
|
352
|
-
name: "
|
|
353
|
-
description: "
|
|
2024
|
+
name: "didit_webhook_create",
|
|
2025
|
+
description: "Create a webhook destination. The signing secret is redacted in the response.",
|
|
354
2026
|
inputSchema: {
|
|
355
2027
|
type: "object",
|
|
356
2028
|
properties: {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
2029
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2030
|
+
label: { type: "string", description: "REQUIRED. Human-readable name" },
|
|
2031
|
+
url: { type: "string", description: "REQUIRED. HTTPS endpoint to receive events" },
|
|
2032
|
+
enabled: { type: "boolean", description: "Whether the destination receives events (default true)" },
|
|
2033
|
+
webhook_version: { type: "string", enum: ["v1", "v2", "v3"], description: "Payload version (v3 recommended)" },
|
|
2034
|
+
subscribed_events: { type: "array", items: { type: "string" }, description: "Event types to deliver (e.g. status.updated, data.updated, user.created). Omit to receive all." },
|
|
361
2035
|
},
|
|
362
|
-
required: ["
|
|
2036
|
+
required: ["label", "url"],
|
|
363
2037
|
},
|
|
364
2038
|
},
|
|
365
2039
|
{
|
|
366
|
-
name: "
|
|
367
|
-
description: "
|
|
2040
|
+
name: "didit_webhook_get",
|
|
2041
|
+
description: "Get a single webhook destination with redacted signing-secret metadata.",
|
|
368
2042
|
inputSchema: {
|
|
369
2043
|
type: "object",
|
|
370
2044
|
properties: {
|
|
371
|
-
|
|
2045
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2046
|
+
destination_uuid: { type: "string", description: "Webhook destination UUID" },
|
|
372
2047
|
},
|
|
373
|
-
required: ["
|
|
2048
|
+
required: ["destination_uuid"],
|
|
374
2049
|
},
|
|
375
2050
|
},
|
|
376
|
-
// ── Users ───────────────────────────────────────────────────────────
|
|
377
2051
|
{
|
|
378
|
-
name: "
|
|
379
|
-
description: "
|
|
2052
|
+
name: "didit_webhook_update",
|
|
2053
|
+
description: "Overwrite the supplied settings of an existing webhook destination. Changing its URL redirects future deliveries; disabling it stops deliveries, and subscribed_events replaces its event subscriptions. Before calling, show the destination UUID and each proposed field change and obtain explicit user confirmation.",
|
|
380
2054
|
inputSchema: {
|
|
381
2055
|
type: "object",
|
|
382
2056
|
properties: {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
2057
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2058
|
+
destination_uuid: { type: "string", description: "Webhook destination UUID" },
|
|
2059
|
+
label: { type: "string" },
|
|
2060
|
+
url: { type: "string" },
|
|
2061
|
+
enabled: { type: "boolean" },
|
|
2062
|
+
webhook_version: { type: "string", enum: ["v1", "v2", "v3"] },
|
|
2063
|
+
subscribed_events: { type: "array", items: { type: "string" } },
|
|
386
2064
|
},
|
|
2065
|
+
required: ["destination_uuid"],
|
|
387
2066
|
},
|
|
388
2067
|
},
|
|
389
2068
|
{
|
|
390
|
-
name: "
|
|
391
|
-
description: "
|
|
2069
|
+
name: "didit_webhook_delete",
|
|
2070
|
+
description: "Delete a webhook destination so it stops receiving events.",
|
|
392
2071
|
inputSchema: {
|
|
393
2072
|
type: "object",
|
|
394
2073
|
properties: {
|
|
395
|
-
|
|
2074
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2075
|
+
destination_uuid: { type: "string", description: "Webhook destination UUID" },
|
|
396
2076
|
},
|
|
397
|
-
required: ["
|
|
2077
|
+
required: ["destination_uuid"],
|
|
398
2078
|
},
|
|
399
2079
|
},
|
|
2080
|
+
// ── Lists (Blocklists, Allowlists & Custom) ─────────────────────────
|
|
400
2081
|
{
|
|
401
|
-
name: "
|
|
402
|
-
description: "
|
|
2082
|
+
name: "didit_lists_list",
|
|
2083
|
+
description: "List all lists (blocklists, allowlists, custom) for the application. Filter by list_type or entry_type.",
|
|
403
2084
|
inputSchema: {
|
|
404
2085
|
type: "object",
|
|
405
2086
|
properties: {
|
|
406
|
-
|
|
407
|
-
|
|
2087
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2088
|
+
list_type: { type: "string", description: "Filter: blocklist, allowlist, custom" },
|
|
2089
|
+
entry_type: { type: "string", description: `Filter: ${LIST_ENTRY_TYPES.join(", ")}` },
|
|
2090
|
+
limit: { type: "string" },
|
|
2091
|
+
offset: { type: "string" },
|
|
408
2092
|
},
|
|
409
|
-
required: ["vendor_data"],
|
|
410
2093
|
},
|
|
411
2094
|
},
|
|
412
2095
|
{
|
|
413
|
-
name: "
|
|
414
|
-
description: "
|
|
2096
|
+
name: "didit_lists_create",
|
|
2097
|
+
description: "Create an allowlist or custom list. System blocklists are auto-provisioned (one per entry type) and cannot be created. name must be unique per application.",
|
|
415
2098
|
inputSchema: {
|
|
416
2099
|
type: "object",
|
|
417
2100
|
properties: {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
},
|
|
423
|
-
delete_all: { type: "boolean", description: "Set true to delete ALL users" },
|
|
2101
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2102
|
+
name: { type: "string", description: "REQUIRED. Unique list name" },
|
|
2103
|
+
list_type: { type: "string", enum: ["allowlist", "custom"], description: "REQUIRED. allowlist or custom (blocklists are auto-provisioned)" },
|
|
2104
|
+
entry_type: { type: "string", enum: LIST_ENTRY_TYPES, description: "REQUIRED. What kind of values the list holds" },
|
|
2105
|
+
description: { type: "string" },
|
|
424
2106
|
},
|
|
2107
|
+
required: ["name", "list_type", "entry_type"],
|
|
425
2108
|
},
|
|
426
2109
|
},
|
|
427
|
-
// ── Billing ─────────────────────────────────────────────────────────
|
|
428
|
-
{
|
|
429
|
-
name: "didit_get_balance",
|
|
430
|
-
description: "Get current credit balance and auto-refill settings.",
|
|
431
|
-
inputSchema: { type: "object", properties: {} },
|
|
432
|
-
},
|
|
433
2110
|
{
|
|
434
|
-
name: "
|
|
435
|
-
description: "
|
|
2111
|
+
name: "didit_lists_get",
|
|
2112
|
+
description: "Get a single list's details by UUID.",
|
|
436
2113
|
inputSchema: {
|
|
437
2114
|
type: "object",
|
|
438
2115
|
properties: {
|
|
439
|
-
|
|
2116
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2117
|
+
list_uuid: { type: "string", description: "UUID of the list" },
|
|
440
2118
|
},
|
|
441
|
-
required: ["
|
|
2119
|
+
required: ["list_uuid"],
|
|
442
2120
|
},
|
|
443
2121
|
},
|
|
444
|
-
// ── Webhook ────────────────────────────────────────────────────────
|
|
445
|
-
{
|
|
446
|
-
name: "didit_get_webhook",
|
|
447
|
-
description: "Get current webhook configuration including URL, version, and secret key for verifying signatures.",
|
|
448
|
-
inputSchema: { type: "object", properties: {} },
|
|
449
|
-
},
|
|
450
2122
|
{
|
|
451
|
-
name: "
|
|
452
|
-
description: "
|
|
2123
|
+
name: "didit_lists_update",
|
|
2124
|
+
description: "Rename or update the description of an allowlist/custom list. System blocklists are immutable.",
|
|
453
2125
|
inputSchema: {
|
|
454
2126
|
type: "object",
|
|
455
2127
|
properties: {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
2128
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2129
|
+
list_uuid: { type: "string", description: "UUID of the list" },
|
|
2130
|
+
name: { type: "string" },
|
|
2131
|
+
description: { type: "string" },
|
|
459
2132
|
},
|
|
2133
|
+
required: ["list_uuid"],
|
|
460
2134
|
},
|
|
461
2135
|
},
|
|
462
|
-
// ── Lists (Blocklists, Allowlists & Custom) ─────────────────────────
|
|
463
2136
|
{
|
|
464
|
-
name: "
|
|
465
|
-
description: "
|
|
2137
|
+
name: "didit_lists_delete",
|
|
2138
|
+
description: "Delete an allowlist/custom list and all its entries. System blocklists cannot be deleted.",
|
|
466
2139
|
inputSchema: {
|
|
467
2140
|
type: "object",
|
|
468
2141
|
properties: {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
limit: { type: "string" },
|
|
472
|
-
offset: { type: "string" },
|
|
2142
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2143
|
+
list_uuid: { type: "string", description: "UUID of the list" },
|
|
473
2144
|
},
|
|
2145
|
+
required: ["list_uuid"],
|
|
474
2146
|
},
|
|
475
2147
|
},
|
|
476
2148
|
{
|
|
477
|
-
name: "
|
|
2149
|
+
name: "didit_lists_entries_list",
|
|
478
2150
|
description: "List entries in a specific list. Use search to filter by value or label.",
|
|
479
2151
|
inputSchema: {
|
|
480
2152
|
type: "object",
|
|
481
2153
|
properties: {
|
|
2154
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
482
2155
|
list_uuid: { type: "string", description: "UUID of the list" },
|
|
483
2156
|
search: { type: "string", description: "Search by value or display label" },
|
|
2157
|
+
reference_session_id: { type: "string", description: "Only the entries created from this session UUID (e.g. which of its faces are already blocklisted)" },
|
|
484
2158
|
limit: { type: "string" },
|
|
485
2159
|
offset: { type: "string" },
|
|
486
2160
|
},
|
|
@@ -488,15 +2162,22 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
488
2162
|
},
|
|
489
2163
|
},
|
|
490
2164
|
{
|
|
491
|
-
name: "
|
|
492
|
-
description: "Add an entry to a blocklist/allowlist/custom list. Pass value directly, or reference_session_id to auto-extract from a session (face, document, phone, email, IP, device). Pass both to disambiguate when a session has multiple values of the same type.
|
|
2165
|
+
name: "didit_lists_entry_create",
|
|
2166
|
+
description: "Add an entry to a blocklist/allowlist/custom list. Pass value directly, or reference_session_id to auto-extract from a session (face, document, phone, email, IP, device). Pass both to disambiguate when a session has multiple values of the same type. For the face blocklist, face_image_source picks which of the session's faces to block: the liveness selfie (default) or a selfie the front camera took while the user photographed their document. For face entries without a session, use didit_lists_entry_upload_face instead.",
|
|
493
2167
|
inputSchema: {
|
|
494
2168
|
type: "object",
|
|
495
2169
|
properties: {
|
|
2170
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
496
2171
|
list_uuid: { type: "string", description: "UUID of the list to add to" },
|
|
497
|
-
value: { type: "string", description: "Value to
|
|
2172
|
+
value: { type: "string", description: "Value to add (phone, email, IP, etc.). Optional if reference_session_id is provided." },
|
|
498
2173
|
reference_session_id: { type: "string", description: "Session UUID — backend auto-extracts the value based on the list's entry type" },
|
|
499
2174
|
reference_object_uuid: { type: "string", description: "UUID of the source entity (transaction, vendor user/business) for traceability" },
|
|
2175
|
+
face_image_source: {
|
|
2176
|
+
type: "string",
|
|
2177
|
+
enum: ["liveness", "front_image_camera_front", "back_image_camera_front"],
|
|
2178
|
+
description: "Face blocklist with reference_session_id only: which of the session's faces to block. liveness (default) is the liveness selfie; front_image_camera_front / back_image_camera_front are the selfies taken while the user photographed the front / back of their document. Leave value empty with a document-capture source.",
|
|
2179
|
+
},
|
|
2180
|
+
reference_node_id: { type: "string", description: "With a document-capture face_image_source: the ID verification node whose selfie to use, for workflows with several ID verification steps" },
|
|
500
2181
|
display_label: { type: "string", description: "Human-readable label" },
|
|
501
2182
|
comment: { type: "string", description: "Reason for adding" },
|
|
502
2183
|
metadata: { type: "object", description: "Additional structured data (e.g. reference_type, full_name)" },
|
|
@@ -505,11 +2186,28 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
505
2186
|
},
|
|
506
2187
|
},
|
|
507
2188
|
{
|
|
508
|
-
name: "
|
|
2189
|
+
name: "didit_lists_entry_upload_face",
|
|
2190
|
+
description: "Add a face entry to a face list by uploading an image directly (no session needed). Use this when you have a photo but no reference_session_id. Provide the image as image_path (local/stdio runs) or image_base64 (hosted runs).",
|
|
2191
|
+
inputSchema: {
|
|
2192
|
+
type: "object",
|
|
2193
|
+
properties: {
|
|
2194
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2195
|
+
list_uuid: { type: "string", description: "UUID of a face-type list" },
|
|
2196
|
+
image_path: { type: "string", description: "Absolute path to the face image file (local/stdio only)" },
|
|
2197
|
+
image_base64: { type: "string", description: "Face image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2198
|
+
display_label: { type: "string" },
|
|
2199
|
+
comment: { type: "string" },
|
|
2200
|
+
},
|
|
2201
|
+
required: ["list_uuid"],
|
|
2202
|
+
},
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
name: "didit_lists_entry_delete",
|
|
509
2206
|
description: "Remove an entry from a list. Also unblocks the underlying user/business if applicable.",
|
|
510
2207
|
inputSchema: {
|
|
511
2208
|
type: "object",
|
|
512
2209
|
properties: {
|
|
2210
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
513
2211
|
list_uuid: { type: "string", description: "UUID of the list" },
|
|
514
2212
|
entry_uuid: { type: "string", description: "UUID of the entry to remove" },
|
|
515
2213
|
},
|
|
@@ -518,123 +2216,198 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
518
2216
|
},
|
|
519
2217
|
// ── Standalone: Identity & Documents ────────────────────────────────
|
|
520
2218
|
{
|
|
521
|
-
name: "
|
|
522
|
-
description: "Verify an identity document by submitting front (and optionally back) images. Returns structured OCR data and authenticity checks.",
|
|
2219
|
+
name: "didit_verify_id",
|
|
2220
|
+
description: "Verify an identity document by submitting front (and optionally back) images. Returns structured OCR data and authenticity checks. Each image is a local absolute *_path (local/stdio runs) or inline *_base64 content (hosted runs).",
|
|
523
2221
|
inputSchema: {
|
|
524
2222
|
type: "object",
|
|
525
2223
|
properties: {
|
|
526
|
-
|
|
527
|
-
|
|
2224
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2225
|
+
front_image_path: { type: "string", description: "Absolute path to front image file (local/stdio only)" },
|
|
2226
|
+
back_image_path: { type: "string", description: "Absolute path to back image file (optional; local/stdio only)" },
|
|
2227
|
+
front_image_base64: { type: "string", description: "Front image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2228
|
+
back_image_base64: { type: "string", description: "Back image as base64 or data URL (optional; or an attachment reference like att_1)" },
|
|
2229
|
+
vendor_data: { type: "string", description: "Optional identifier to link the result to a user" },
|
|
2230
|
+
perform_document_liveness: { type: "boolean", description: "Run document-presence (anti-screenshot) checks" },
|
|
2231
|
+
minimum_age: { type: "number", description: "Decline if the extracted age is below this value" },
|
|
2232
|
+
preferred_characters: { type: "string", enum: ["latin", "non_latin"], description: "Preferred OCR script" },
|
|
528
2233
|
},
|
|
529
|
-
required: ["front_image_path"],
|
|
530
2234
|
},
|
|
531
2235
|
},
|
|
532
2236
|
{
|
|
533
|
-
name: "
|
|
534
|
-
description: "Proof of Address verification. Submit document
|
|
2237
|
+
name: "didit_verify_poa",
|
|
2238
|
+
description: "Proof of Address verification. Submit a single document image to extract and validate address information. The image is a local absolute *_path (local/stdio runs) or inline *_base64 content (hosted runs).",
|
|
535
2239
|
inputSchema: {
|
|
536
2240
|
type: "object",
|
|
537
2241
|
properties: {
|
|
538
|
-
|
|
539
|
-
|
|
2242
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2243
|
+
document_image_path: { type: "string", description: "Absolute path to the POA document image (local/stdio only)" },
|
|
2244
|
+
document_image_base64: { type: "string", description: "POA document image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2245
|
+
vendor_data: { type: "string", description: "Optional identifier to link the result to a user" },
|
|
2246
|
+
expected_address: { type: "string", description: "Address to validate the document against" },
|
|
2247
|
+
expected_country: { type: "string", description: "ISO 3166-1 alpha-2 country code to validate against" },
|
|
2248
|
+
expected_first_name: { type: "string" },
|
|
2249
|
+
expected_last_name: { type: "string" },
|
|
540
2250
|
},
|
|
541
|
-
required: ["front_image_path"],
|
|
542
2251
|
},
|
|
543
2252
|
},
|
|
544
2253
|
{
|
|
545
|
-
name: "
|
|
546
|
-
description: "Validate identity data against national and global authoritative data sources.",
|
|
2254
|
+
name: "didit_verify_database",
|
|
2255
|
+
description: "Validate identity data against national and global authoritative data sources. issuing_state (ISO 3166-1 alpha-3) is required and selects which sources run.",
|
|
547
2256
|
inputSchema: {
|
|
548
2257
|
type: "object",
|
|
549
2258
|
properties: {
|
|
2259
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2260
|
+
issuing_state: { type: "string", description: "REQUIRED. ISO 3166-1 alpha-3 country code that selects the data sources to query" },
|
|
550
2261
|
first_name: { type: "string" },
|
|
551
2262
|
last_name: { type: "string" },
|
|
552
|
-
|
|
2263
|
+
middle_name: { type: "string" },
|
|
2264
|
+
full_name: { type: "string" },
|
|
2265
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD" },
|
|
553
2266
|
document_number: { type: "string" },
|
|
554
|
-
|
|
2267
|
+
document_type: { type: "string", enum: DOCUMENT_TYPES },
|
|
2268
|
+
personal_number: { type: "string" },
|
|
2269
|
+
tax_number: { type: "string" },
|
|
2270
|
+
gender: { type: "string", enum: ["M", "F", "X"] },
|
|
2271
|
+
nationality: { type: "string" },
|
|
2272
|
+
services: { type: "array", items: { type: "string" }, description: "Optional service_ids to restrict which sources run" },
|
|
2273
|
+
partial_match_action: { type: "string", enum: ["DECLINE", "NO_ACTION"] },
|
|
2274
|
+
no_match_action: { type: "string", enum: ["DECLINE", "NO_ACTION"] },
|
|
2275
|
+
vendor_data: { type: "string" },
|
|
2276
|
+
metadata: { type: "object" },
|
|
2277
|
+
},
|
|
2278
|
+
required: ["issuing_state"],
|
|
2279
|
+
},
|
|
2280
|
+
},
|
|
2281
|
+
// ── Standalone: KYB registry ────────────────────────────────────────
|
|
2282
|
+
{
|
|
2283
|
+
name: "didit_verify_kyb_search",
|
|
2284
|
+
description: "Search official company registries for a business by name and/or registration number. Returns candidate matches; pass a candidate's kyb_response_id to didit_verify_kyb_select to pull the full record.",
|
|
2285
|
+
inputSchema: {
|
|
2286
|
+
type: "object",
|
|
2287
|
+
properties: {
|
|
2288
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2289
|
+
country_code: { type: "string", description: "REQUIRED. ISO 3166-1 alpha-2 country code" },
|
|
2290
|
+
name: { type: "string", description: "Company name to search" },
|
|
2291
|
+
registration_number: { type: "string", description: "Registration number to search" },
|
|
2292
|
+
search_type: { type: "string", enum: ["contains", "start_with", "fuzzy"], description: "Name match strategy" },
|
|
2293
|
+
vendor_data: { type: "string" },
|
|
2294
|
+
metadata: { type: "object" },
|
|
2295
|
+
webhook_url: { type: "string", description: "Optional URL notified when the registry result resolves" },
|
|
2296
|
+
},
|
|
2297
|
+
required: ["country_code"],
|
|
2298
|
+
},
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
name: "didit_verify_kyb_select",
|
|
2302
|
+
description: "Resolve a candidate from didit_verify_kyb_search into a full company registry record. kyb_response_id is the per-search candidate handle returned by the search.",
|
|
2303
|
+
inputSchema: {
|
|
2304
|
+
type: "object",
|
|
2305
|
+
properties: {
|
|
2306
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2307
|
+
kyb_response_id: { type: "string", description: "REQUIRED. Candidate handle from didit_verify_kyb_search" },
|
|
2308
|
+
vendor_data: { type: "string" },
|
|
2309
|
+
metadata: { type: "object" },
|
|
2310
|
+
save_api_request: { type: "boolean" },
|
|
555
2311
|
},
|
|
556
|
-
required: ["
|
|
2312
|
+
required: ["kyb_response_id"],
|
|
557
2313
|
},
|
|
558
2314
|
},
|
|
559
2315
|
// ── Standalone: Biometrics & Face ───────────────────────────────────
|
|
560
2316
|
{
|
|
561
|
-
name: "
|
|
562
|
-
description: "Passive liveness detection -- verify a person is physically present from a single image (no interaction required).",
|
|
2317
|
+
name: "didit_verify_passive_liveness",
|
|
2318
|
+
description: "Passive liveness detection -- verify a person is physically present from a single image (no interaction required). The image is a local absolute image_path (local/stdio runs) or inline image_base64 content (hosted runs).",
|
|
563
2319
|
inputSchema: {
|
|
564
2320
|
type: "object",
|
|
565
2321
|
properties: {
|
|
566
|
-
|
|
2322
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2323
|
+
image_path: { type: "string", description: "Absolute path to facial image file (local/stdio only)" },
|
|
2324
|
+
image_base64: { type: "string", description: "Facial image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2325
|
+
vendor_data: { type: "string", description: "Optional identifier to link the result to a user" },
|
|
567
2326
|
},
|
|
568
|
-
required: ["image_path"],
|
|
569
2327
|
},
|
|
570
2328
|
},
|
|
571
2329
|
{
|
|
572
|
-
name: "
|
|
573
|
-
description: "Compare two facial images to determine if they belong to the same person (1:1 face matching).",
|
|
2330
|
+
name: "didit_verify_face_match",
|
|
2331
|
+
description: "Compare two facial images to determine if they belong to the same person (1:1 face matching). The score is symmetric, so image order does not affect the result. Each image is a local absolute *_path (local/stdio runs) or inline *_base64 content (hosted runs).",
|
|
574
2332
|
inputSchema: {
|
|
575
2333
|
type: "object",
|
|
576
2334
|
properties: {
|
|
577
|
-
|
|
578
|
-
|
|
2335
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2336
|
+
image_1_path: { type: "string", description: "Absolute path to the first facial image, e.g. the selfie (local/stdio only)" },
|
|
2337
|
+
image_2_path: { type: "string", description: "Absolute path to the second facial image, e.g. the ID portrait (local/stdio only)" },
|
|
2338
|
+
image_1_base64: { type: "string", description: "First facial image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2339
|
+
image_2_base64: { type: "string", description: "Second facial image as base64 or data URL (or an attachment reference like att_2)" },
|
|
2340
|
+
vendor_data: { type: "string", description: "Optional identifier to link the result to a user" },
|
|
579
2341
|
},
|
|
580
|
-
required: ["image_1_path", "image_2_path"],
|
|
581
2342
|
},
|
|
582
2343
|
},
|
|
583
2344
|
{
|
|
584
|
-
name: "
|
|
585
|
-
description: "Search for a face against a database of previously verified faces (1:N face matching).",
|
|
2345
|
+
name: "didit_verify_face_search",
|
|
2346
|
+
description: "Search for a face against a database of previously verified faces (1:N face matching). The image is a local absolute image_path (local/stdio runs) or inline image_base64 content (hosted runs).",
|
|
586
2347
|
inputSchema: {
|
|
587
2348
|
type: "object",
|
|
588
2349
|
properties: {
|
|
589
|
-
|
|
2350
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2351
|
+
image_path: { type: "string", description: "Absolute path to facial image file (local/stdio only)" },
|
|
2352
|
+
image_base64: { type: "string", description: "Facial image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2353
|
+
vendor_data: { type: "string", description: "Optional identifier to link the result to a user" },
|
|
590
2354
|
},
|
|
591
|
-
required: ["image_path"],
|
|
592
2355
|
},
|
|
593
2356
|
},
|
|
594
2357
|
{
|
|
595
|
-
name: "
|
|
596
|
-
description: "Estimate a person's age from a facial image. Also performs passive liveness check.",
|
|
2358
|
+
name: "didit_verify_age",
|
|
2359
|
+
description: "Estimate a person's age from a facial image. Also performs passive liveness check. The image is a local absolute image_path (local/stdio runs) or inline image_base64 content (hosted runs).",
|
|
597
2360
|
inputSchema: {
|
|
598
2361
|
type: "object",
|
|
599
2362
|
properties: {
|
|
600
|
-
|
|
2363
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2364
|
+
image_path: { type: "string", description: "Absolute path to facial image file (local/stdio only)" },
|
|
2365
|
+
image_base64: { type: "string", description: "Facial image as base64 or data URL (or an attachment reference like att_1)" },
|
|
2366
|
+
vendor_data: { type: "string", description: "Optional identifier to link the result to a user" },
|
|
601
2367
|
},
|
|
602
|
-
required: ["image_path"],
|
|
603
2368
|
},
|
|
604
2369
|
},
|
|
605
2370
|
// ── Standalone: AML Screening ───────────────────────────────────────
|
|
606
2371
|
{
|
|
607
|
-
name: "
|
|
608
|
-
description: "AML screening against global watchlists, PEP lists, and
|
|
2372
|
+
name: "didit_verify_aml",
|
|
2373
|
+
description: "AML screening against global watchlists, PEP lists, sanctions, and (optionally) adverse media. Supports person and company entity types.",
|
|
609
2374
|
inputSchema: {
|
|
610
2375
|
type: "object",
|
|
611
2376
|
properties: {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
entity_type: { type: "string",
|
|
615
|
-
|
|
2377
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2378
|
+
full_name: { type: "string", description: "REQUIRED. Full name to screen" },
|
|
2379
|
+
entity_type: { type: "string", enum: ["person", "company"], description: "Defaults to person" },
|
|
2380
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD (improves match accuracy)" },
|
|
2381
|
+
nationality: { type: "string", description: "ISO country code (improves match accuracy)" },
|
|
2382
|
+
document_number: { type: "string" },
|
|
2383
|
+
include_adverse_media: { type: "boolean", description: "Include adverse-media findings" },
|
|
2384
|
+
include_ongoing_monitoring: { type: "boolean", description: "Enroll the entity for ongoing monitoring" },
|
|
2385
|
+
vendor_data: { type: "string" },
|
|
2386
|
+
metadata: { type: "object" },
|
|
616
2387
|
},
|
|
617
2388
|
required: ["full_name"],
|
|
618
2389
|
},
|
|
619
2390
|
},
|
|
620
2391
|
// ── Standalone: Email & Phone Verification ──────────────────────────
|
|
621
2392
|
{
|
|
622
|
-
name: "
|
|
2393
|
+
name: "didit_verify_email_send",
|
|
623
2394
|
description: "Send a one-time verification code to an email address. Code valid for 5 minutes.",
|
|
624
2395
|
inputSchema: {
|
|
625
2396
|
type: "object",
|
|
626
2397
|
properties: {
|
|
2398
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
627
2399
|
email: { type: "string", description: "Email address to verify" },
|
|
628
2400
|
},
|
|
629
2401
|
required: ["email"],
|
|
630
2402
|
},
|
|
631
2403
|
},
|
|
632
2404
|
{
|
|
633
|
-
name: "
|
|
2405
|
+
name: "didit_verify_email_check",
|
|
634
2406
|
description: "Verify the OTP code sent to an email. Max 3 attempts per code.",
|
|
635
2407
|
inputSchema: {
|
|
636
2408
|
type: "object",
|
|
637
2409
|
properties: {
|
|
2410
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
638
2411
|
email: { type: "string" },
|
|
639
2412
|
code: { type: "string", description: "Verification code from email" },
|
|
640
2413
|
},
|
|
@@ -642,234 +2415,1007 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
642
2415
|
},
|
|
643
2416
|
},
|
|
644
2417
|
{
|
|
645
|
-
name: "
|
|
2418
|
+
name: "didit_verify_phone_send",
|
|
646
2419
|
description: "Send a one-time verification code to a phone number via SMS. Code valid for 5 minutes.",
|
|
647
2420
|
inputSchema: {
|
|
648
2421
|
type: "object",
|
|
649
2422
|
properties: {
|
|
2423
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
650
2424
|
phone_number: { type: "string", description: "Phone number with country code (e.g. +1234567890)" },
|
|
651
2425
|
},
|
|
652
2426
|
required: ["phone_number"],
|
|
653
2427
|
},
|
|
654
2428
|
},
|
|
655
2429
|
{
|
|
656
|
-
name: "
|
|
2430
|
+
name: "didit_verify_phone_check",
|
|
657
2431
|
description: "Verify the OTP code sent to a phone number. Max 3 attempts per code.",
|
|
658
2432
|
inputSchema: {
|
|
659
2433
|
type: "object",
|
|
660
2434
|
properties: {
|
|
2435
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
661
2436
|
phone_number: { type: "string" },
|
|
662
2437
|
code: { type: "string", description: "Verification code from SMS" },
|
|
663
2438
|
},
|
|
664
2439
|
required: ["phone_number", "code"],
|
|
665
2440
|
},
|
|
666
2441
|
},
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
case "
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
2442
|
+
// ── Blocklist / Allowlist ───────────────────────────────────────────
|
|
2443
|
+
{
|
|
2444
|
+
name: "didit_blocklist_get",
|
|
2445
|
+
description: "List blocklist entries (blocked users/identifiers).",
|
|
2446
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
name: "didit_blocklist_add",
|
|
2450
|
+
description: "Add an entry to the blocklist (e.g. by vendor_data, document number, face).",
|
|
2451
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS }, required: [] },
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
name: "didit_blocklist_remove",
|
|
2455
|
+
description: "Remove an entry from the blocklist.",
|
|
2456
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
name: "didit_allowlist_add",
|
|
2460
|
+
description: "Add an entry to the allowlist (trusted, bypasses some checks).",
|
|
2461
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2462
|
+
},
|
|
2463
|
+
// ── Case management ─────────────────────────────────────────────────
|
|
2464
|
+
{
|
|
2465
|
+
name: "didit_case_list",
|
|
2466
|
+
description: "List investigation/compliance cases for ONE app; with multiple apps (or no scope) it auto-spans all your apps. For a cross-app query prefer didit_case_search.",
|
|
2467
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS, status: { type: "string" }, cursor: { type: "string" } } },
|
|
2468
|
+
},
|
|
2469
|
+
{
|
|
2470
|
+
name: "didit_case_get",
|
|
2471
|
+
description: "Get a case with its details.",
|
|
2472
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS, case_id: { type: "string" } }, required: ["case_id"] },
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
name: "didit_case_create",
|
|
2476
|
+
description: "Create a case.",
|
|
2477
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
name: "didit_case_statistics",
|
|
2481
|
+
description: "Get case statistics (counts by status, etc.).",
|
|
2482
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
name: "didit_case_manage",
|
|
2486
|
+
description: "Act on a case: assign, resolve, reopen, escalate, comment, or update.",
|
|
2487
|
+
inputSchema: {
|
|
2488
|
+
type: "object",
|
|
2489
|
+
properties: {
|
|
2490
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2491
|
+
case_id: { type: "string" },
|
|
2492
|
+
action: { type: "string", enum: ["assign", "resolve", "reopen", "escalate", "comment", "update"] },
|
|
2493
|
+
data: { type: "object", description: "Action payload (e.g. {assignee_id}, {comment}, or fields to update)" },
|
|
2494
|
+
confirm: {
|
|
2495
|
+
type: "boolean",
|
|
2496
|
+
description: "REQUIRED when filing a SAR (action 'sar'/'file_sar', or any action whose data.status is 'SAR_FILED') - a high-impact regulatory action. Only set after explicit user confirmation of this exact action.",
|
|
2497
|
+
},
|
|
2498
|
+
},
|
|
2499
|
+
required: ["case_id", "action"],
|
|
2500
|
+
},
|
|
2501
|
+
},
|
|
2502
|
+
// ── Reports (async exports) ─────────────────────────────────────────
|
|
2503
|
+
{
|
|
2504
|
+
name: "didit_report_list",
|
|
2505
|
+
description: "List generated export reports.",
|
|
2506
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2507
|
+
},
|
|
2508
|
+
{
|
|
2509
|
+
name: "didit_report_get",
|
|
2510
|
+
description: "Get a report's status/details.",
|
|
2511
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS, report_id: { type: "string" } }, required: ["report_id"] },
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
name: "didit_report_get_download_url",
|
|
2515
|
+
description: "Get a signed download URL for a finished report.",
|
|
2516
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS, report_id: { type: "string" } }, required: ["report_id"] },
|
|
2517
|
+
},
|
|
2518
|
+
{
|
|
2519
|
+
name: "didit_report_export",
|
|
2520
|
+
description: "Start an export report. kind ∈ sessions | transactions | businesses | vendor-users | vendor-businesses. `data.columns` is a kind-specific schema — for sessions/vendor-users/vendor-businesses an unknown column 400s with `Invalid columns`, and that error's `allowed` field carries the full valid-column list for that kind, so retry from the error alone rather than guessing names like `date`/`status`/`total_price`.",
|
|
2521
|
+
inputSchema: {
|
|
2522
|
+
type: "object",
|
|
2523
|
+
properties: { ...orgapp_1.ORG_APP_PROPS, kind: { type: "string" }, data: { type: "object", description: "Filters for the export" } },
|
|
2524
|
+
required: ["kind"],
|
|
2525
|
+
},
|
|
2526
|
+
},
|
|
2527
|
+
// ── Audit logs + alerts ─────────────────────────────────────────────
|
|
2528
|
+
{
|
|
2529
|
+
name: "didit_audit_log_list",
|
|
2530
|
+
description: "List audit-log entries for the application (who changed what).",
|
|
2531
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS, cursor: { type: "string" } } },
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
name: "didit_alert_list",
|
|
2535
|
+
description: "List configured alerts.",
|
|
2536
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
name: "didit_alert_configure",
|
|
2540
|
+
description: "Configure an alert by type.",
|
|
2541
|
+
inputSchema: {
|
|
2542
|
+
type: "object",
|
|
2543
|
+
properties: { ...orgapp_1.ORG_APP_PROPS, alert_type: { type: "string" }, data: { type: "object" } },
|
|
2544
|
+
required: ["alert_type"],
|
|
2545
|
+
},
|
|
2546
|
+
},
|
|
2547
|
+
// ── Org members / roles / API keys (apx/auth/v2) ────────────────────
|
|
2548
|
+
{
|
|
2549
|
+
name: "didit_org_list_members",
|
|
2550
|
+
description: "List the organization's members.",
|
|
2551
|
+
inputSchema: { type: "object", properties: { organization_id: orgapp_1.ORG_APP_PROPS.organization_id } },
|
|
2552
|
+
},
|
|
2553
|
+
{
|
|
2554
|
+
name: "didit_org_invite_member",
|
|
2555
|
+
description: "Invite up to 5 members to the organization (emails + role + the applications they may access).",
|
|
2556
|
+
inputSchema: {
|
|
2557
|
+
type: "object",
|
|
2558
|
+
properties: {
|
|
2559
|
+
organization_id: orgapp_1.ORG_APP_PROPS.organization_id,
|
|
2560
|
+
emails: { type: "array", items: { type: "string" }, description: "Email addresses to invite (1-5)." },
|
|
2561
|
+
role: { type: "string", description: "Role UUID (from didit_org_list_roles)." },
|
|
2562
|
+
app_ids: { type: "array", items: { type: "string" }, description: "Application UUIDs the invitee may access (from didit_org_list_applications)." },
|
|
2563
|
+
},
|
|
2564
|
+
required: ["emails", "role", "app_ids"],
|
|
2565
|
+
},
|
|
2566
|
+
},
|
|
2567
|
+
{
|
|
2568
|
+
name: "didit_org_update_member",
|
|
2569
|
+
description: "Update a member's role and the applications they may access.",
|
|
2570
|
+
inputSchema: {
|
|
2571
|
+
type: "object",
|
|
2572
|
+
properties: {
|
|
2573
|
+
organization_id: orgapp_1.ORG_APP_PROPS.organization_id,
|
|
2574
|
+
member_id: { type: "string", description: "Member UUID (from didit_org_list_members)." },
|
|
2575
|
+
role: { type: "string", description: "Role UUID (from didit_org_list_roles)." },
|
|
2576
|
+
accessible_applications: { type: "array", items: { type: "string" }, description: "Application UUIDs the member may access (from didit_org_list_applications)." },
|
|
2577
|
+
},
|
|
2578
|
+
required: ["member_id", "role", "accessible_applications"],
|
|
2579
|
+
},
|
|
2580
|
+
},
|
|
2581
|
+
{
|
|
2582
|
+
name: "didit_org_remove_member",
|
|
2583
|
+
description: "Remove a member from the organization.",
|
|
2584
|
+
inputSchema: {
|
|
2585
|
+
type: "object",
|
|
2586
|
+
properties: { organization_id: orgapp_1.ORG_APP_PROPS.organization_id, member_id: { type: "string" } },
|
|
2587
|
+
required: ["member_id"],
|
|
2588
|
+
},
|
|
2589
|
+
},
|
|
2590
|
+
{
|
|
2591
|
+
name: "didit_org_list_roles",
|
|
2592
|
+
description: "List the roles available in the organization.",
|
|
2593
|
+
inputSchema: { type: "object", properties: { organization_id: orgapp_1.ORG_APP_PROPS.organization_id } },
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
name: "didit_org_list_api_keys",
|
|
2597
|
+
description: "List API key metadata with raw key values redacted (pass application_id for an app's keys).",
|
|
2598
|
+
inputSchema: { type: "object", properties: { ...orgapp_1.ORG_APP_PROPS } },
|
|
2599
|
+
},
|
|
2600
|
+
// ── Compliance ──────────────────────────────────────────────────────
|
|
2601
|
+
...(0, internal_tools_1.internalToolDefs)("compliance"),
|
|
2602
|
+
{
|
|
2603
|
+
name: "didit_workflow_build_graph",
|
|
2604
|
+
description: "Build a complete workflow graph from a PLAIN FEATURE SPEC in one deterministic call - regulations are " +
|
|
2605
|
+
"never consulted" + internal_tools_1.REGULATION_GRAPH_HINT + ". Gate-then-commit: " +
|
|
2606
|
+
"the result is either an accepted build (graph_summary + spec: materialize with ui_workflow_apply_graph " +
|
|
2607
|
+
"{spec} on an open editor, or include_graph:true + didit_workflow_set_graph headless), or 'unsupported'/'questions' naming " +
|
|
2608
|
+
"exactly what cannot be built or what to ask the user FIRST - in that case build NOTHING and relay them. " +
|
|
2609
|
+
"Never rebuild the returned graph by hand and never retry with guesses. Read-only: persists nothing. " +
|
|
2610
|
+
"document_rules express per-country/document filtering, including US state-scoped subtypes " +
|
|
2611
|
+
"(e.g. exclude the Nevada driver's license) and the country wildcard 'ALL' (every catalog country: " +
|
|
2612
|
+
"'only passports, from any country' = one rule {country:'ALL', document:'P', action:'only'}).",
|
|
2613
|
+
inputSchema: {
|
|
2614
|
+
type: "object",
|
|
2615
|
+
properties: {
|
|
2616
|
+
...orgapp_1.ORG_APP_PROPS,
|
|
2617
|
+
subject: { type: "string", enum: ["kyc", "kyb"], description: "kyc verifies a person (default), kyb a company." },
|
|
2618
|
+
features: {
|
|
2619
|
+
type: "array",
|
|
2620
|
+
items: { type: "string" },
|
|
2621
|
+
description: "ONLY the verification steps the user NAMED, by feature code (OCR, LIVENESS, FACE_MATCH, NFC, " +
|
|
2622
|
+
"PROOF_OF_ADDRESS, QUESTIONNAIRE, PHONE_VERIFICATION, EMAIL_VERIFICATION, AGE_ESTIMATION, " +
|
|
2623
|
+
"IP_ANALYSIS, AML, DATABASE_VALIDATION, DOCUMENT_AI; KYB: KYB_REGISTRY, KYB_DOCUMENTS, " +
|
|
2624
|
+
"KYB_KEY_PEOPLE). NEVER add 'standard' steps uninvited ('only id verification' means OCR and " +
|
|
2625
|
+
"nothing else); the builder itself adds true dependencies and orders the chain.",
|
|
2626
|
+
},
|
|
2627
|
+
countries: {
|
|
2628
|
+
type: "object",
|
|
2629
|
+
description: "Which countries' DOCUMENTS are configured. OMIT ENTIRELY for 'all countries' (the default). " +
|
|
2630
|
+
"NEVER use it to exclude a document or a state — that is document_rules' job: 'all countries " +
|
|
2631
|
+
"except the Nevada driver's license' = countries omitted + one document_rule.",
|
|
2632
|
+
properties: {
|
|
2633
|
+
mode: { type: "string", enum: ["all", "only", "except"] },
|
|
2634
|
+
list: {
|
|
2635
|
+
type: "array",
|
|
2636
|
+
items: { type: "string" },
|
|
2637
|
+
description: "Countries EXACTLY as the user named them (a name or ISO3 code per entry). NEVER substitute the country you think they meant — the builder asks when it does not know a name.",
|
|
2638
|
+
},
|
|
2639
|
+
},
|
|
2640
|
+
additionalProperties: false,
|
|
2641
|
+
},
|
|
2642
|
+
document_rules: {
|
|
2643
|
+
type: "array",
|
|
2644
|
+
description: "Per-country document filtering. 'state' (US state name or USPS code) filters the " +
|
|
2645
|
+
"state-scoped document subtypes (how 'exclude the Nevada driver's license' is expressed). " +
|
|
2646
|
+
"country 'ALL' applies the rule to every catalog country ('only passports everywhere' = " +
|
|
2647
|
+
"{country:'ALL', document:'P', action:'only'}; do NOT enumerate countries for that).",
|
|
2648
|
+
items: {
|
|
2649
|
+
type: "object",
|
|
2650
|
+
properties: {
|
|
2651
|
+
country: {
|
|
2652
|
+
type: "string",
|
|
2653
|
+
description: "The country EXACTLY as the user named it (a name or ISO3 code, e.g. USA); never substitute one. 'ALL' = every catalog country (wildcard for rules that apply everywhere).",
|
|
2654
|
+
},
|
|
2655
|
+
document: {
|
|
2656
|
+
type: "string",
|
|
2657
|
+
enum: ["ID", "P", "DL", "RP", "HIC", "TC", "SSC", "FIREARM"],
|
|
2658
|
+
description: "Catalog document code: ID card, Passport, Driver's License, Residence Permit, ...",
|
|
2659
|
+
},
|
|
2660
|
+
state: { type: "string", description: "US state (full name or USPS code), for state-scoped subtypes." },
|
|
2661
|
+
action: { type: "string", enum: ["exclude", "only"] },
|
|
2662
|
+
},
|
|
2663
|
+
required: ["country", "document"],
|
|
2664
|
+
additionalProperties: false,
|
|
2665
|
+
},
|
|
2666
|
+
},
|
|
2667
|
+
per_feature_config: {
|
|
2668
|
+
type: "object",
|
|
2669
|
+
description: "Optional per-feature config overrides, {FEATURE: {contract keys...}}; validated server-side.",
|
|
2670
|
+
},
|
|
2671
|
+
include_graph: {
|
|
2672
|
+
type: "boolean",
|
|
2673
|
+
description: "Return the full graph (for headless didit_workflow_set_graph). Default false: the result carries a " +
|
|
2674
|
+
"graph_summary + the accepted spec, and the editor applies by reference with ui_workflow_apply_graph {spec}.",
|
|
2675
|
+
},
|
|
2676
|
+
branches: {
|
|
2677
|
+
type: "array",
|
|
2678
|
+
description: "Country branches after the routing step; unmatched countries take the else path to the final decision. The ONLY key that carries branching.",
|
|
2679
|
+
items: {
|
|
2680
|
+
type: "object",
|
|
2681
|
+
properties: {
|
|
2682
|
+
countries: {
|
|
2683
|
+
type: "array",
|
|
2684
|
+
items: { type: "string" },
|
|
2685
|
+
description: "Countries exactly as the user named them (a name or ISO3 code per entry).",
|
|
2686
|
+
},
|
|
2687
|
+
features: { type: "array", items: { type: "string" } },
|
|
2688
|
+
},
|
|
2689
|
+
required: ["countries", "features"],
|
|
2690
|
+
additionalProperties: false,
|
|
2691
|
+
},
|
|
2692
|
+
},
|
|
2693
|
+
},
|
|
2694
|
+
// CLOSED, like every nested object above it. The root was the one level
|
|
2695
|
+
// left open, and a model filled it: `branch_rules` for `branches`
|
|
2696
|
+
// reached the backend's serializer and three console users of one
|
|
2697
|
+
// organization lost their workflow to its 400. Client-side
|
|
2698
|
+
// validation of this is best-effort — buildWorkflow enforces it.
|
|
2699
|
+
additionalProperties: false,
|
|
2700
|
+
},
|
|
2701
|
+
},
|
|
2702
|
+
...privileged_tools_1.PRIVILEGED_TOOL_DEFS,
|
|
2703
|
+
];
|
|
2704
|
+
const inputSchemaByTool = new Map(toolDefinitions().map((t) => [t.name, t.inputSchema]));
|
|
2705
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async (_request, extra) => {
|
|
2706
|
+
// Privileged operational tools are emitted ONLY to privileged connections; everyone else never
|
|
2707
|
+
// sees them in tools/list (and a call is rejected below). In the open-source build there are none.
|
|
2708
|
+
const isPrivileged = (0, privileged_tools_1.isPrivilegedCaller)(extra?.authInfo, { hosted });
|
|
2709
|
+
const tools = toolDefinitions();
|
|
2710
|
+
// Hosted (Bearer-authenticated) catalogs never include the account-bootstrap /
|
|
2711
|
+
// checkout / secret-reveal tools — the public app catalog must stay free of
|
|
2712
|
+
// credential-collection, checkout, and secret-reveal flows. Privileged (staff)
|
|
2713
|
+
// callers and local stdio setups keep the full catalog.
|
|
2714
|
+
const hasUserBearer = Boolean(extra?.authInfo?.token || process.env.DIDIT_ACCESS_TOKEN);
|
|
2715
|
+
let catalog = hasUserBearer && !isPrivileged ? tools.filter((t) => !HOSTED_APP_EXCLUDED_TOOLS.has(t.name)) : tools;
|
|
2716
|
+
// Remote connectors authenticate with OAuth, so account credentials must never travel
|
|
2717
|
+
// through the conversation: hosted servers drop the bootstrap tools for EVERY caller
|
|
2718
|
+
// (staff included), regardless of Bearer state. They remain available on stdio.
|
|
2719
|
+
if (hosted)
|
|
2720
|
+
catalog = catalog.filter((t) => !ACCOUNT_BOOTSTRAP_TOOLS.has(t.name));
|
|
2721
|
+
// A tool the caller's organization role could never run is not offered (permissions.ts);
|
|
2722
|
+
// only in enforce mode — shadow mode lists everything and just records the verdicts.
|
|
2723
|
+
const tokenOrg = extra?.authInfo?.extra?.organization_id;
|
|
2724
|
+
const query = { scopes: extra?.authInfo?.scopes, mode: (0, config_1.permissionMode)(), tokenOrg, targetOrg: tokenOrg };
|
|
2725
|
+
catalog = catalog.filter((t) => (0, permissions_1.decidePermission)({ ...query, tool: t.name }) !== "deny");
|
|
2726
|
+
const visible = isPrivileged ? catalog : catalog.filter((t) => !(0, privileged_tools_1.isPrivilegedToolName)(t.name));
|
|
2727
|
+
// Endpoint catalog profile (chatgpt-app.ts): the ChatGPT endpoint offers only the
|
|
2728
|
+
// allow-listed tools, with restricted input properties removed from their schemas.
|
|
2729
|
+
const offered = (0, chatgpt_app_1.applyCatalogProfile)(visible, profile);
|
|
2730
|
+
// Annotate each tool so the connector UI splits them into Read-only / Write / Destructive
|
|
2731
|
+
// groups (driven by readOnlyHint + destructiveHint) instead of one flat "Other tools"
|
|
2732
|
+
// bucket; also tag the logical domain group via _meta for future UI use.
|
|
2733
|
+
return {
|
|
2734
|
+
tools: offered.map((t) => ({
|
|
2735
|
+
...t,
|
|
2736
|
+
outputSchema: t.outputSchema ?? {
|
|
2737
|
+
type: "object",
|
|
2738
|
+
description: "Structured result. Fields vary by tool; see the success payload.",
|
|
2739
|
+
additionalProperties: true,
|
|
2740
|
+
},
|
|
2741
|
+
annotations: {
|
|
2742
|
+
...(t.annotations ?? {}),
|
|
2743
|
+
...annotationsFor(t.name),
|
|
2744
|
+
},
|
|
2745
|
+
_meta: {
|
|
2746
|
+
...(t._meta ?? {}),
|
|
2747
|
+
"anthropic/toolGroup": toolGroupOf(t.name),
|
|
2748
|
+
category: toolGroupOf(t.name),
|
|
2749
|
+
// MCP Apps linkage for the ChatGPT console (chatgpt-app.ts); `{}` on every other
|
|
2750
|
+
// profile, so their descriptors are unchanged.
|
|
2751
|
+
...(0, chatgpt_app_1.widgetToolMeta)(profile, t.name),
|
|
2752
|
+
},
|
|
2753
|
+
})).concat(
|
|
2754
|
+
// The console's entry tool (ChatGPT sidebar entrypoint), on /mcp/chatgpt only.
|
|
2755
|
+
(0, chatgpt_app_1.widgetTools)(profile)),
|
|
2756
|
+
};
|
|
2757
|
+
});
|
|
2758
|
+
// ---------------------------------------------------------------------------
|
|
2759
|
+
// Tool dispatch
|
|
2760
|
+
// ---------------------------------------------------------------------------
|
|
2761
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request, extra) => {
|
|
2762
|
+
const authInfo = extra?.authInfo;
|
|
2763
|
+
// Console (management) tools target /organization/{org}/application/{app}/... paths.
|
|
2764
|
+
// An explicit organization_id / application_id in the tool arguments takes precedence
|
|
2765
|
+
// over the token's org context; both flow into requestContext so orgAppPath() resolves.
|
|
2766
|
+
const callArgs = (request.params.arguments ?? {});
|
|
2767
|
+
const argOrg = typeof callArgs.organization_id === "string" ? callArgs.organization_id : undefined;
|
|
2768
|
+
const argApp = typeof callArgs.application_id === "string" ? callArgs.application_id : undefined;
|
|
2769
|
+
// Permission pre-check verdict (permissions.ts): decided once here so the audit line
|
|
2770
|
+
// can record a shadow-mode "would_deny" and the dispatch below can refuse a "deny".
|
|
2771
|
+
const tokenOrg = authInfo?.extra?.organization_id;
|
|
2772
|
+
const permission = (0, permissions_1.decidePermission)({
|
|
2773
|
+
tool: request.params.name,
|
|
2774
|
+
scopes: authInfo?.scopes,
|
|
2775
|
+
mode: (0, config_1.permissionMode)(),
|
|
2776
|
+
tokenOrg,
|
|
2777
|
+
targetOrg: argOrg || tokenOrg,
|
|
2778
|
+
});
|
|
2779
|
+
const permissionCheck = permission === "would_deny" ? permission : undefined;
|
|
2780
|
+
return config_1.requestContext.run({
|
|
2781
|
+
// Hosted mode: per-request Bearer from OAuth introspection. Stdio mode (tests/eval):
|
|
2782
|
+
// fall back to DIDIT_ACCESS_TOKEN + MCP_DEFAULT_ORG/APP env so the console-path tools
|
|
2783
|
+
// authenticate as that Bearer without the hosted layer.
|
|
2784
|
+
accessToken: authInfo?.token || process.env.DIDIT_ACCESS_TOKEN || undefined,
|
|
2785
|
+
organizationId: argOrg ||
|
|
2786
|
+
authInfo?.extra?.organization_id ||
|
|
2787
|
+
process.env.MCP_DEFAULT_ORG ||
|
|
2788
|
+
undefined,
|
|
2789
|
+
applicationId: argApp || process.env.MCP_DEFAULT_APP || undefined,
|
|
2790
|
+
toolName: request.params.name,
|
|
2791
|
+
}, () => (0, audit_log_1.auditToolCall)({ tool: request.params.name, args: callArgs, authInfo, hosted, permissionCheck }, async () => {
|
|
2792
|
+
const { name } = request.params;
|
|
2793
|
+
// organization_id / application_id are ROUTING, consumed above into
|
|
2794
|
+
// requestContext — they are not payload. Removing them here is what makes
|
|
2795
|
+
// declaring them on a tool safe: the handlers that forward their args
|
|
2796
|
+
// verbatim (lists, webhooks, sessions, transactions, vendors…) would
|
|
2797
|
+
// otherwise put them in a query string or a POST body the console API never
|
|
2798
|
+
// asked for. Behaviour-preserving for the handlers that DO read them —
|
|
2799
|
+
// marketplace/travelRule pass them to resolveOrganizationId /
|
|
2800
|
+
// resolveApplicationId, which fall back to the very context set above.
|
|
2801
|
+
// A blank OPTIONAL argument (`""`, or a `null` the schema never admits) is the
|
|
2802
|
+
// model filling every declared argument, not a value: dropped here so the
|
|
2803
|
+
// handlers forward the call a schema-honouring model would have made. READ
|
|
2804
|
+
// tools only — on an update tool a `""` can mean "clear this field", and a
|
|
2805
|
+
// dropped one would PATCH nothing and report success.
|
|
2806
|
+
const args = (0, blank_args_1.dropBlankOptionals)((0, config_1.stripRoutingIds)(request.params.arguments), annotationsFor(name).readOnlyHint ? inputSchemaByTool.get(name) : undefined);
|
|
2807
|
+
// ...but a handful of handlers take the routing ids as EXPLICIT PARAMETERS rather than
|
|
2808
|
+
// resolving them from requestContext, and the strip above hands them `undefined`:
|
|
2809
|
+
// the auth-service tools build their URL path from the argument (and the reveal tool
|
|
2810
|
+
// deliberately refuses every context/env fallback), and the *_search tools use the ids to
|
|
2811
|
+
// NARROW their fan-out. Re-attach only what the caller actually sent, and only for those.
|
|
2812
|
+
const withRoutingIds = (a) => ({
|
|
2813
|
+
...(a ?? {}),
|
|
2814
|
+
...(argOrg ? { organization_id: argOrg } : {}),
|
|
2815
|
+
...(argApp ? { application_id: argApp } : {}),
|
|
2816
|
+
});
|
|
2817
|
+
// Privileged operational tools require a privileged token (the verification backend's role
|
|
2818
|
+
// permission + 2FA is the authoritative gate; this is defense-in-depth + a clearer error).
|
|
2819
|
+
// There are none in the open-source build (isPrivilegedToolName is always false there).
|
|
2820
|
+
if ((0, privileged_tools_1.isPrivilegedToolName)(name) && !(0, privileged_tools_1.isPrivilegedCaller)(authInfo, { hosted })) {
|
|
2821
|
+
return { content: [{ type: "text", text: `Tool '${name}' requires elevated (privileged) access.` }], isError: true };
|
|
774
2822
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
case "didit_top_up":
|
|
783
|
-
result = await billing.topUp(args.amount_in_dollars);
|
|
784
|
-
break;
|
|
785
|
-
// Webhook
|
|
786
|
-
case "didit_get_webhook": {
|
|
787
|
-
const res = await fetch(`${config_1.DIDIT_API_BASE_URL}/webhook/`, { headers: (0, config_1.getHeaders)() });
|
|
788
|
-
result = await res.json();
|
|
789
|
-
break;
|
|
2823
|
+
// Mirror of the tools/list exclusion: a hosted connector authenticates with OAuth, so it
|
|
2824
|
+
// never accepts account credentials/OTP codes as tool arguments, from any caller.
|
|
2825
|
+
if (hosted && ACCOUNT_BOOTSTRAP_TOOLS.has(name)) {
|
|
2826
|
+
return {
|
|
2827
|
+
content: [{ type: "text", text: `Tool '${name}' is not available on the hosted connector - authentication is handled by OAuth. Use the local stdio server (npx @didit-protocol/mcp-server) for account setup.` }],
|
|
2828
|
+
isError: true,
|
|
2829
|
+
};
|
|
790
2830
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
});
|
|
797
|
-
result = await res.json();
|
|
798
|
-
break;
|
|
2831
|
+
// Mirror of the tools/list catalog profile: a tool (or an input property) the endpoint does
|
|
2832
|
+
// not offer is refused even if the client memorised it from the full catalog.
|
|
2833
|
+
const profileRefusal = (0, chatgpt_app_1.catalogProfileRefusal)(profile, name, callArgs);
|
|
2834
|
+
if (profileRefusal) {
|
|
2835
|
+
return { content: [{ type: "text", text: profileRefusal }], isError: true };
|
|
799
2836
|
}
|
|
800
|
-
//
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
const { list_uuid: leListUuid, ...leParams } = args;
|
|
806
|
-
result = await lists.listEntries(leListUuid, leParams);
|
|
807
|
-
break;
|
|
2837
|
+
// The console's entry tool (chatgpt-app.ts): no Didit call, it names the page to open.
|
|
2838
|
+
if (name === chatgpt_app_1.CONSOLE_OPEN_TOOL) {
|
|
2839
|
+
if (!(0, chatgpt_app_1.profileServesWidgets)(profile))
|
|
2840
|
+
return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
|
|
2841
|
+
return (0, chatgpt_app_1.consoleOpenResult)(callArgs);
|
|
808
2842
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
2843
|
+
// Single-org/single-app callers: fill the default scope so they needn't pass/discover ids.
|
|
2844
|
+
await ensureScopeDefaults(name);
|
|
2845
|
+
try {
|
|
2846
|
+
// The caller's organization role lacks the permission the backend would demand for
|
|
2847
|
+
// this tool: refuse here with the permission named (the backend would 403 anyway).
|
|
2848
|
+
if (permission === "deny")
|
|
2849
|
+
throw (0, permissions_1.missingPermissionError)(name);
|
|
2850
|
+
let result;
|
|
2851
|
+
// Multi-tenant caller invoked a per-app list tool with no resolvable scope: span all apps
|
|
2852
|
+
// (same shape as the *_search sibling) instead of throwing, so the first call succeeds.
|
|
2853
|
+
const aggregate = aggregateFallbackFor(name);
|
|
2854
|
+
if ((0, privileged_tools_1.isPrivilegedToolName)(name)) {
|
|
2855
|
+
result = await (0, privileged_tools_1.dispatchPrivilegedTool)(name, args);
|
|
2856
|
+
}
|
|
2857
|
+
else if ((0, internal_tools_1.isInternalToolName)(name)) {
|
|
2858
|
+
result = await (0, internal_tools_1.dispatchInternalTool)(name, args);
|
|
2859
|
+
}
|
|
2860
|
+
else if (aggregate) {
|
|
2861
|
+
// Scope survives the fallback: when the org resolved but the app did not, span only
|
|
2862
|
+
// that org's apps rather than every org the caller can reach.
|
|
2863
|
+
const scopedOrg = config_1.requestContext.getStore()?.organizationId;
|
|
2864
|
+
result = await aggregate({
|
|
2865
|
+
...withRoutingIds(args),
|
|
2866
|
+
...(scopedOrg ? { organization_id: scopedOrg } : {}),
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2869
|
+
else
|
|
2870
|
+
switch (name) {
|
|
2871
|
+
// Auth
|
|
2872
|
+
case "didit_account_register":
|
|
2873
|
+
result = await auth.register(args.email, args.password);
|
|
2874
|
+
break;
|
|
2875
|
+
case "didit_account_verify_email":
|
|
2876
|
+
result = await auth.verifyEmail(args.email, args.code);
|
|
2877
|
+
break;
|
|
2878
|
+
case "didit_account_resend_otp":
|
|
2879
|
+
result = await auth.resendOtp(args.email);
|
|
2880
|
+
break;
|
|
2881
|
+
case "didit_account_login":
|
|
2882
|
+
result = await auth.login(args.email, args.password);
|
|
2883
|
+
break;
|
|
2884
|
+
case "didit_account_verify_2fa":
|
|
2885
|
+
result = await auth.verify2fa(args.temp_token, args.code);
|
|
2886
|
+
break;
|
|
2887
|
+
case "didit_org_list":
|
|
2888
|
+
result = await auth.listOrganizations(stdioAccessTokenArg(args));
|
|
2889
|
+
break;
|
|
2890
|
+
case "didit_org_list_applications":
|
|
2891
|
+
result = await auth.listApplications(argOrg, stdioAccessTokenArg(args));
|
|
2892
|
+
break;
|
|
2893
|
+
case "didit_org_get_application":
|
|
2894
|
+
result = await auth.getApplication(argOrg, argApp, stdioAccessTokenArg(args));
|
|
2895
|
+
break;
|
|
2896
|
+
case "didit_org_reveal_application_api_key":
|
|
2897
|
+
result = await auth.revealApplicationApiKey(argOrg, argApp, args?.confirm, stdioAccessTokenArg(args));
|
|
2898
|
+
break;
|
|
2899
|
+
// Context + cross-org/app aggregate search
|
|
2900
|
+
case "didit_context_get":
|
|
2901
|
+
result = await context.getContext();
|
|
2902
|
+
break;
|
|
2903
|
+
case "didit_session_search":
|
|
2904
|
+
result = await search.searchSessions(withRoutingIds(args));
|
|
2905
|
+
break;
|
|
2906
|
+
case "didit_transaction_search":
|
|
2907
|
+
result = await search.searchTransactions(withRoutingIds(args));
|
|
2908
|
+
break;
|
|
2909
|
+
case "didit_case_search":
|
|
2910
|
+
result = await search.searchCases(withRoutingIds(args));
|
|
2911
|
+
break;
|
|
2912
|
+
case "didit_vendor_user_search":
|
|
2913
|
+
result = await search.searchVendorUsers(withRoutingIds(args));
|
|
2914
|
+
break;
|
|
2915
|
+
case "didit_vendor_business_search":
|
|
2916
|
+
result = await search.searchVendorBusinesses(withRoutingIds(args));
|
|
2917
|
+
break;
|
|
2918
|
+
case "didit_analytics":
|
|
2919
|
+
// Like the *_search tools: the routing ids NARROW the fan-out (one org, or one app).
|
|
2920
|
+
result = await analytics.analytics(withRoutingIds(args));
|
|
2921
|
+
break;
|
|
2922
|
+
// Sessions
|
|
2923
|
+
case "didit_session_create":
|
|
2924
|
+
result = await sessions.createSession(args || {});
|
|
2925
|
+
break;
|
|
2926
|
+
case "didit_session_list":
|
|
2927
|
+
result = await sessions.listSessions(args);
|
|
2928
|
+
break;
|
|
2929
|
+
case "didit_session_get_decision":
|
|
2930
|
+
result = await sessions.getSessionDecision(args.session_id);
|
|
2931
|
+
break;
|
|
2932
|
+
case "didit_session_update_status": {
|
|
2933
|
+
const { session_id, ...data } = args;
|
|
2934
|
+
result = await sessions.updateSessionStatus(session_id, data);
|
|
2935
|
+
break;
|
|
2936
|
+
}
|
|
2937
|
+
case "didit_session_update_data": {
|
|
2938
|
+
const { session_id, ...data } = args;
|
|
2939
|
+
result = await sessions.updateSessionData(session_id, data);
|
|
2940
|
+
break;
|
|
2941
|
+
}
|
|
2942
|
+
case "didit_session_update_poa_data": {
|
|
2943
|
+
const { session_id, ...data } = args;
|
|
2944
|
+
result = await sessions.updateSessionPoaData(session_id, data);
|
|
2945
|
+
break;
|
|
2946
|
+
}
|
|
2947
|
+
case "didit_session_delete":
|
|
2948
|
+
result = await sessions.deleteSession(args.session_id, args?.confirm);
|
|
2949
|
+
break;
|
|
2950
|
+
case "didit_session_batch_delete":
|
|
2951
|
+
result = await sessions.batchDeleteSessions(args?.session_numbers, args?.delete_all, args?.confirm);
|
|
2952
|
+
break;
|
|
2953
|
+
case "didit_session_generate_pdf":
|
|
2954
|
+
result = await sessions.generateSessionPdf(args.session_id);
|
|
2955
|
+
break;
|
|
2956
|
+
case "didit_session_list_reviews":
|
|
2957
|
+
result = await sessions.listSessionReviews(args.session_id);
|
|
2958
|
+
break;
|
|
2959
|
+
case "didit_session_add_review": {
|
|
2960
|
+
const { session_id, ...data } = args;
|
|
2961
|
+
result = await sessions.addSessionReview(session_id, data);
|
|
2962
|
+
break;
|
|
2963
|
+
}
|
|
2964
|
+
case "didit_session_share":
|
|
2965
|
+
result = await sessions.shareSession(args.session_id, args);
|
|
2966
|
+
break;
|
|
2967
|
+
case "didit_session_explain_decision":
|
|
2968
|
+
result = await (0, session_explain_1.explainSessionDecision)(args.session_id);
|
|
2969
|
+
break;
|
|
2970
|
+
case "didit_session_webhooks":
|
|
2971
|
+
result = await sessions.listSessionWebhooks(args.session_id, Number(args.wait_seconds ?? 0));
|
|
2972
|
+
break;
|
|
2973
|
+
case "didit_session_webhook_resend":
|
|
2974
|
+
result = await sessions.resendSessionWebhook(args.session_id, args.webhook_id);
|
|
2975
|
+
break;
|
|
2976
|
+
case "didit_session_import_shared":
|
|
2977
|
+
result = await sessions.importSharedSession(args);
|
|
2978
|
+
break;
|
|
2979
|
+
// Session imports
|
|
2980
|
+
case "didit_session_create_import":
|
|
2981
|
+
result = await sessions.createImport(args);
|
|
2982
|
+
break;
|
|
2983
|
+
case "didit_session_get_import_template":
|
|
2984
|
+
result = await sessions.getImportTemplate();
|
|
2985
|
+
break;
|
|
2986
|
+
case "didit_session_get_import":
|
|
2987
|
+
result = await sessions.getImport(args.import_id);
|
|
2988
|
+
break;
|
|
2989
|
+
case "didit_session_get_import_errors":
|
|
2990
|
+
result = await sessions.getImportErrors(args.import_id);
|
|
2991
|
+
break;
|
|
2992
|
+
// Workflows
|
|
2993
|
+
case "didit_workflow_list":
|
|
2994
|
+
result = await settings.listWorkflows();
|
|
2995
|
+
break;
|
|
2996
|
+
case "didit_workflow_create":
|
|
2997
|
+
result = await settings.createWorkflow(args || {});
|
|
2998
|
+
break;
|
|
2999
|
+
case "didit_workflow_get":
|
|
3000
|
+
result = await settings.getWorkflow(args.workflow_id);
|
|
3001
|
+
break;
|
|
3002
|
+
case "didit_workflow_update": {
|
|
3003
|
+
const { workflow_id, ...data } = args;
|
|
3004
|
+
result = await settings.updateWorkflow(workflow_id, data);
|
|
3005
|
+
break;
|
|
3006
|
+
}
|
|
3007
|
+
case "didit_workflow_delete":
|
|
3008
|
+
result = await settings.deleteWorkflow(args.workflow_id);
|
|
3009
|
+
break;
|
|
3010
|
+
case "didit_workflow_search":
|
|
3011
|
+
result = await search.searchWorkflows(withRoutingIds(args));
|
|
3012
|
+
break;
|
|
3013
|
+
case "didit_workflow_get_graph":
|
|
3014
|
+
result = await workflowGraph.getWorkflowGraph(args.workflow_id, args, Boolean(args?.include_config));
|
|
3015
|
+
break;
|
|
3016
|
+
case "didit_workflow_get_field_definitions":
|
|
3017
|
+
result = await workflowGraph.getWorkflowFieldDefinitions(args.workflow_id, args);
|
|
3018
|
+
break;
|
|
3019
|
+
case "didit_workflow_get_feature_config_schema": {
|
|
3020
|
+
// Answered from the artifact this server ships with - no API call, so it
|
|
3021
|
+
// works before a workflow or an application even exists.
|
|
3022
|
+
const feature = args?.feature;
|
|
3023
|
+
if (feature && !feature_config_schema_1.FEATURE_CONFIG_SCHEMA.features[feature]) {
|
|
3024
|
+
throw new Error(`Unknown feature "${feature}". Known features: ${feature_config_schema_1.WORKFLOW_FEATURES.join(", ")}.`);
|
|
3025
|
+
}
|
|
3026
|
+
result = {
|
|
3027
|
+
schema_version: feature_config_schema_1.FEATURE_CONFIG_SCHEMA.schema_version,
|
|
3028
|
+
checksum: feature_config_schema_1.FEATURE_CONFIG_CHECKSUM,
|
|
3029
|
+
source: feature_config_schema_1.FEATURE_CONFIG_SCHEMA.source,
|
|
3030
|
+
value_kinds: feature_config_schema_1.FEATURE_CONFIG_SCHEMA.value_kinds,
|
|
3031
|
+
features: feature
|
|
3032
|
+
? { [feature]: feature_config_schema_1.FEATURE_CONFIG_SCHEMA.features[feature] }
|
|
3033
|
+
: feature_config_schema_1.FEATURE_CONFIG_SCHEMA.features,
|
|
3034
|
+
};
|
|
3035
|
+
break;
|
|
3036
|
+
}
|
|
3037
|
+
case "didit_workflow_get_id_verification_methods_catalog":
|
|
3038
|
+
result = await workflowGraph.getIdVerificationMethodsCatalog(args.workflow_id, args);
|
|
3039
|
+
break;
|
|
3040
|
+
case "didit_workflow_get_kyb_registry_catalog":
|
|
3041
|
+
result = await workflowGraph.getKybRegistryCatalog(args?.countries);
|
|
3042
|
+
break;
|
|
3043
|
+
case "didit_workflow_get_branch_fields":
|
|
3044
|
+
result = await workflowGraph.getWorkflowBranchFields(args.workflow_id, args.graph, (args?.branch_node_id ?? args?.node_id), args);
|
|
3045
|
+
break;
|
|
3046
|
+
case "didit_workflow_validate_graph":
|
|
3047
|
+
result = await workflowGraph.validateWorkflowGraph(args?.workflow_id, args.graph, args, Boolean(args?.include_config));
|
|
3048
|
+
break;
|
|
3049
|
+
case "didit_workflow_edit_graph":
|
|
3050
|
+
result = await workflowGraph.editWorkflowGraph(args.workflow_id, args.operations, Boolean(args?.publish), args);
|
|
3051
|
+
break;
|
|
3052
|
+
case "didit_workflow_set_graph":
|
|
3053
|
+
result = await workflowGraph.setWorkflowGraph(args.workflow_id, args.graph, Boolean(args?.publish), args);
|
|
3054
|
+
break;
|
|
3055
|
+
case "didit_workflow_create_draft":
|
|
3056
|
+
result = await workflowGraph.createWorkflowDraft(args.workflow_id, args);
|
|
3057
|
+
break;
|
|
3058
|
+
case "didit_workflow_publish":
|
|
3059
|
+
result = await workflowGraph.publishWorkflow(args.workflow_id, args);
|
|
3060
|
+
break;
|
|
3061
|
+
// Questionnaires
|
|
3062
|
+
case "didit_questionnaire_list":
|
|
3063
|
+
result = await questionnaires.listQuestionnaires();
|
|
3064
|
+
break;
|
|
3065
|
+
case "didit_questionnaire_create":
|
|
3066
|
+
result = await questionnaires.createQuestionnaire(args);
|
|
3067
|
+
break;
|
|
3068
|
+
case "didit_questionnaire_append_choices": {
|
|
3069
|
+
const { questionnaire_id, ...data } = args;
|
|
3070
|
+
result = await questionnaires.appendQuestionnaireChoices(questionnaire_id, data);
|
|
3071
|
+
break;
|
|
3072
|
+
}
|
|
3073
|
+
case "didit_questionnaire_get":
|
|
3074
|
+
result = await questionnaires.getQuestionnaire(args.questionnaire_id, Boolean(args?.include_translations));
|
|
3075
|
+
break;
|
|
3076
|
+
case "didit_questionnaire_update": {
|
|
3077
|
+
const { questionnaire_id, ...data } = args;
|
|
3078
|
+
result = await questionnaires.updateQuestionnaire(questionnaire_id, data);
|
|
3079
|
+
break;
|
|
3080
|
+
}
|
|
3081
|
+
case "didit_questionnaire_delete":
|
|
3082
|
+
result = await questionnaires.deleteQuestionnaire(args.questionnaire_id);
|
|
3083
|
+
break;
|
|
3084
|
+
// Users
|
|
3085
|
+
case "didit_vendor_user_list":
|
|
3086
|
+
result = await users.listUsers(args);
|
|
3087
|
+
break;
|
|
3088
|
+
case "didit_vendor_user_create":
|
|
3089
|
+
result = await users.createUser(args);
|
|
3090
|
+
break;
|
|
3091
|
+
case "didit_vendor_user_get":
|
|
3092
|
+
result = await users.getUser(args.vendor_data);
|
|
3093
|
+
break;
|
|
3094
|
+
case "didit_vendor_user_update": {
|
|
3095
|
+
const { vendor_data, ...data } = args;
|
|
3096
|
+
result = await users.updateUser(vendor_data, data);
|
|
3097
|
+
break;
|
|
3098
|
+
}
|
|
3099
|
+
case "didit_vendor_user_update_status":
|
|
3100
|
+
result = await users.updateUserStatus(args.vendor_data, args.status);
|
|
3101
|
+
break;
|
|
3102
|
+
case "didit_vendor_user_delete":
|
|
3103
|
+
result = await users.deleteUsers(args?.vendor_data_list, args?.delete_all, args?.confirm);
|
|
3104
|
+
break;
|
|
3105
|
+
// Businesses
|
|
3106
|
+
case "didit_vendor_business_list":
|
|
3107
|
+
result = await businesses.listBusinesses(args);
|
|
3108
|
+
break;
|
|
3109
|
+
case "didit_vendor_business_create":
|
|
3110
|
+
result = await businesses.createBusiness(args);
|
|
3111
|
+
break;
|
|
3112
|
+
case "didit_vendor_business_get":
|
|
3113
|
+
result = await businesses.getBusiness(args.vendor_data);
|
|
3114
|
+
break;
|
|
3115
|
+
case "didit_vendor_business_update": {
|
|
3116
|
+
const { vendor_data, ...data } = args;
|
|
3117
|
+
result = await businesses.updateBusiness(vendor_data, data);
|
|
3118
|
+
break;
|
|
3119
|
+
}
|
|
3120
|
+
case "didit_vendor_business_update_status":
|
|
3121
|
+
result = await businesses.updateBusinessStatus(args.vendor_data, args.status);
|
|
3122
|
+
break;
|
|
3123
|
+
case "didit_vendor_business_delete":
|
|
3124
|
+
result = await businesses.deleteBusinesses(args?.vendor_data_list, args?.didit_internal_id_list, args?.delete_all, args?.confirm);
|
|
3125
|
+
break;
|
|
3126
|
+
// Transactions
|
|
3127
|
+
case "didit_transaction_list":
|
|
3128
|
+
result = await transactions.listTransactions(args);
|
|
3129
|
+
break;
|
|
3130
|
+
case "didit_transaction_create":
|
|
3131
|
+
result = await transactions.createTransaction(args);
|
|
3132
|
+
break;
|
|
3133
|
+
case "didit_transaction_get":
|
|
3134
|
+
result = await transactions.getTransaction(args.transaction_id);
|
|
3135
|
+
break;
|
|
3136
|
+
case "didit_transaction_screen_wallet":
|
|
3137
|
+
result = await transactions.screenWallet(args);
|
|
3138
|
+
break;
|
|
3139
|
+
case "didit_transaction_rule_list":
|
|
3140
|
+
result = await transactions.listTransactionRules(args);
|
|
3141
|
+
break;
|
|
3142
|
+
case "didit_transaction_rule_get":
|
|
3143
|
+
result = await transactions.getTransactionRule(args.rule_uuid);
|
|
3144
|
+
break;
|
|
3145
|
+
case "didit_transaction_rule_create":
|
|
3146
|
+
result = await transactions.createTransactionRule(args);
|
|
3147
|
+
break;
|
|
3148
|
+
case "didit_transaction_rule_update": {
|
|
3149
|
+
const { rule_uuid, ...data } = args;
|
|
3150
|
+
result = await transactions.updateTransactionRule(rule_uuid, data);
|
|
3151
|
+
break;
|
|
3152
|
+
}
|
|
3153
|
+
case "didit_transaction_rule_delete":
|
|
3154
|
+
result = await transactions.deleteTransactionRule(args.rule_uuid);
|
|
3155
|
+
break;
|
|
3156
|
+
case "didit_transaction_rule_backtest":
|
|
3157
|
+
result = await transactions.backtestTransactionRule(args);
|
|
3158
|
+
break;
|
|
3159
|
+
case "didit_transaction_rule_library_list":
|
|
3160
|
+
result = await transactions.listTransactionRuleLibrary(args);
|
|
3161
|
+
break;
|
|
3162
|
+
case "didit_transaction_rule_install":
|
|
3163
|
+
result = await transactions.installTransactionRuleLibrary(args);
|
|
3164
|
+
break;
|
|
3165
|
+
case "didit_transaction_rule_uninstall":
|
|
3166
|
+
result = await transactions.uninstallTransactionRuleLibrary(args);
|
|
3167
|
+
break;
|
|
3168
|
+
// Billing
|
|
3169
|
+
case "didit_org_get_balance":
|
|
3170
|
+
result = await billing.getBalance(args?.organization_id);
|
|
3171
|
+
break;
|
|
3172
|
+
case "didit_org_top_up":
|
|
3173
|
+
result = await billing.topUp((args?.amount_in_dollars ?? args?.amount), args?.confirm, args?.success_url, args?.cancel_url);
|
|
3174
|
+
break;
|
|
3175
|
+
// Customization
|
|
3176
|
+
case "didit_branding_get":
|
|
3177
|
+
result = await customization.getCustomization();
|
|
3178
|
+
break;
|
|
3179
|
+
case "didit_branding_update":
|
|
3180
|
+
result = await customization.updateCustomization(args);
|
|
3181
|
+
break;
|
|
3182
|
+
// Webhook destinations
|
|
3183
|
+
case "didit_webhook_list":
|
|
3184
|
+
result = await webhooks.listDestinations();
|
|
3185
|
+
break;
|
|
3186
|
+
case "didit_webhook_create":
|
|
3187
|
+
result = await webhooks.createDestination(args);
|
|
3188
|
+
break;
|
|
3189
|
+
case "didit_webhook_get":
|
|
3190
|
+
result = await webhooks.getDestination(args.destination_uuid);
|
|
3191
|
+
break;
|
|
3192
|
+
case "didit_webhook_update": {
|
|
3193
|
+
const { destination_uuid, ...data } = args;
|
|
3194
|
+
result = await webhooks.updateDestination(destination_uuid, data);
|
|
3195
|
+
break;
|
|
3196
|
+
}
|
|
3197
|
+
case "didit_webhook_delete":
|
|
3198
|
+
result = await webhooks.deleteDestination(args.destination_uuid);
|
|
3199
|
+
break;
|
|
3200
|
+
// Lists
|
|
3201
|
+
case "didit_lists_list":
|
|
3202
|
+
result = await lists.listLists(args);
|
|
3203
|
+
break;
|
|
3204
|
+
case "didit_lists_create":
|
|
3205
|
+
result = await lists.createList(args);
|
|
3206
|
+
break;
|
|
3207
|
+
case "didit_lists_get":
|
|
3208
|
+
result = await lists.getListDetail(args.list_uuid);
|
|
3209
|
+
break;
|
|
3210
|
+
case "didit_lists_update": {
|
|
3211
|
+
const { list_uuid: ulListUuid, ...ulData } = args;
|
|
3212
|
+
result = await lists.updateList(ulListUuid, ulData);
|
|
3213
|
+
break;
|
|
3214
|
+
}
|
|
3215
|
+
case "didit_lists_delete":
|
|
3216
|
+
result = await lists.deleteList(args.list_uuid);
|
|
3217
|
+
break;
|
|
3218
|
+
case "didit_lists_entries_list": {
|
|
3219
|
+
const { list_uuid: leListUuid, ...leParams } = args;
|
|
3220
|
+
result = await lists.listEntries(leListUuid, leParams);
|
|
3221
|
+
break;
|
|
3222
|
+
}
|
|
3223
|
+
case "didit_lists_entry_create": {
|
|
3224
|
+
const { list_uuid: ceListUuid, ...ceData } = args;
|
|
3225
|
+
result = await lists.createEntry(ceListUuid, ceData);
|
|
3226
|
+
break;
|
|
3227
|
+
}
|
|
3228
|
+
case "didit_lists_entry_upload_face": {
|
|
3229
|
+
const { list_uuid: ufListUuid, image_path, image_base64, ...ufData } = args;
|
|
3230
|
+
result = await lists.uploadFaceEntry(ufListUuid, { image_path, image_base64, ...ufData });
|
|
3231
|
+
break;
|
|
3232
|
+
}
|
|
3233
|
+
case "didit_lists_entry_delete": {
|
|
3234
|
+
const { list_uuid: deListUuid, entry_uuid: deEntryUuid } = args;
|
|
3235
|
+
result = await lists.deleteEntry(deListUuid, deEntryUuid);
|
|
3236
|
+
break;
|
|
3237
|
+
}
|
|
3238
|
+
// Standalone: Identity & Documents
|
|
3239
|
+
case "didit_verify_id": {
|
|
3240
|
+
const { front_image_path, back_image_path, front_image_base64, back_image_base64, ...idOpts } = args;
|
|
3241
|
+
result = await standalone.idVerification({ path: front_image_path, base64: front_image_base64 }, back_image_path || back_image_base64 ? { path: back_image_path, base64: back_image_base64 } : undefined, idOpts);
|
|
3242
|
+
break;
|
|
3243
|
+
}
|
|
3244
|
+
case "didit_verify_poa": {
|
|
3245
|
+
const { document_image_path, document_image_base64, ...poaOpts } = args;
|
|
3246
|
+
result = await standalone.poaVerification({ path: document_image_path, base64: document_image_base64 }, poaOpts);
|
|
3247
|
+
break;
|
|
3248
|
+
}
|
|
3249
|
+
case "didit_verify_database":
|
|
3250
|
+
result = await standalone.databaseValidation(args);
|
|
3251
|
+
break;
|
|
3252
|
+
// Standalone: KYB registry
|
|
3253
|
+
case "didit_verify_kyb_search":
|
|
3254
|
+
result = await standalone.kybSearch(args);
|
|
3255
|
+
break;
|
|
3256
|
+
case "didit_verify_kyb_select":
|
|
3257
|
+
result = await standalone.kybSelect(args);
|
|
3258
|
+
break;
|
|
3259
|
+
// Standalone: Biometrics
|
|
3260
|
+
case "didit_verify_passive_liveness": {
|
|
3261
|
+
const { image_path, image_base64, ...plOpts } = args;
|
|
3262
|
+
result = await standalone.passiveLiveness({ path: image_path, base64: image_base64 }, plOpts);
|
|
3263
|
+
break;
|
|
3264
|
+
}
|
|
3265
|
+
case "didit_verify_face_match": {
|
|
3266
|
+
const { image_1_path, image_2_path, image_1_base64, image_2_base64, ...fmOpts } = args;
|
|
3267
|
+
result = await standalone.faceMatch({ path: image_1_path, base64: image_1_base64 }, { path: image_2_path, base64: image_2_base64 }, fmOpts);
|
|
3268
|
+
break;
|
|
3269
|
+
}
|
|
3270
|
+
case "didit_verify_face_search": {
|
|
3271
|
+
const { image_path, image_base64, ...fsOpts } = args;
|
|
3272
|
+
result = await standalone.faceSearch({ path: image_path, base64: image_base64 }, fsOpts);
|
|
3273
|
+
break;
|
|
3274
|
+
}
|
|
3275
|
+
case "didit_verify_age": {
|
|
3276
|
+
const { image_path, image_base64, ...aeOpts } = args;
|
|
3277
|
+
result = await standalone.ageEstimation({ path: image_path, base64: image_base64 }, aeOpts);
|
|
3278
|
+
break;
|
|
3279
|
+
}
|
|
3280
|
+
// Standalone: AML
|
|
3281
|
+
case "didit_verify_aml":
|
|
3282
|
+
result = await standalone.amlScreening(args);
|
|
3283
|
+
break;
|
|
3284
|
+
// Standalone: Email & Phone
|
|
3285
|
+
case "didit_verify_email_send":
|
|
3286
|
+
result = await standalone.emailSend(args);
|
|
3287
|
+
break;
|
|
3288
|
+
case "didit_verify_email_check":
|
|
3289
|
+
result = await standalone.emailCheck(args);
|
|
3290
|
+
break;
|
|
3291
|
+
case "didit_verify_phone_send":
|
|
3292
|
+
result = await standalone.phoneSend(args);
|
|
3293
|
+
break;
|
|
3294
|
+
case "didit_verify_phone_check":
|
|
3295
|
+
result = await standalone.phoneCheck(args);
|
|
3296
|
+
break;
|
|
3297
|
+
// Blocklist / allowlist
|
|
3298
|
+
case "didit_blocklist_get":
|
|
3299
|
+
result = await blocklist.getBlocklist(args);
|
|
3300
|
+
break;
|
|
3301
|
+
case "didit_blocklist_add":
|
|
3302
|
+
result = await blocklist.addToBlocklist(args);
|
|
3303
|
+
break;
|
|
3304
|
+
case "didit_blocklist_remove":
|
|
3305
|
+
result = await blocklist.removeFromBlocklist(args);
|
|
3306
|
+
break;
|
|
3307
|
+
case "didit_allowlist_add":
|
|
3308
|
+
result = await blocklist.addToAllowlist(args);
|
|
3309
|
+
break;
|
|
3310
|
+
// Case management
|
|
3311
|
+
case "didit_case_list":
|
|
3312
|
+
result = await cases.listCases(args);
|
|
3313
|
+
break;
|
|
3314
|
+
case "didit_case_get":
|
|
3315
|
+
result = await cases.getCase(args.case_id);
|
|
3316
|
+
break;
|
|
3317
|
+
case "didit_case_create":
|
|
3318
|
+
result = await cases.createCase(args);
|
|
3319
|
+
break;
|
|
3320
|
+
case "didit_case_statistics":
|
|
3321
|
+
result = await cases.caseStatistics(args);
|
|
3322
|
+
break;
|
|
3323
|
+
case "didit_case_manage":
|
|
3324
|
+
result = await cases.manageCase(args.case_id, args.action, args?.data || {}, args?.confirm);
|
|
3325
|
+
break;
|
|
3326
|
+
// Reports
|
|
3327
|
+
case "didit_report_list":
|
|
3328
|
+
result = await reports.listReports(args);
|
|
3329
|
+
break;
|
|
3330
|
+
case "didit_report_get":
|
|
3331
|
+
result = await reports.getReport(args.report_id);
|
|
3332
|
+
break;
|
|
3333
|
+
case "didit_report_get_download_url":
|
|
3334
|
+
result = await reports.getReportDownloadUrl(args.report_id);
|
|
3335
|
+
break;
|
|
3336
|
+
case "didit_report_export":
|
|
3337
|
+
result = await reports.exportReport(args.kind, args?.data || {});
|
|
3338
|
+
break;
|
|
3339
|
+
// Audit logs + alerts
|
|
3340
|
+
case "didit_audit_log_list":
|
|
3341
|
+
result = await observability.listAuditLogs(args);
|
|
3342
|
+
break;
|
|
3343
|
+
case "didit_alert_list":
|
|
3344
|
+
result = await observability.listAlerts(args);
|
|
3345
|
+
break;
|
|
3346
|
+
case "didit_alert_configure":
|
|
3347
|
+
result = await observability.configureAlert(args.alert_type, args?.data || {});
|
|
3348
|
+
break;
|
|
3349
|
+
// Org members / roles / API keys
|
|
3350
|
+
case "didit_org_list_members":
|
|
3351
|
+
result = await members.listMembers(args?.organization_id, args);
|
|
3352
|
+
break;
|
|
3353
|
+
case "didit_org_invite_member":
|
|
3354
|
+
result = await members.inviteMember(args, args?.organization_id);
|
|
3355
|
+
break;
|
|
3356
|
+
case "didit_org_update_member":
|
|
3357
|
+
result = await members.updateMember(args.member_id, args, args?.organization_id);
|
|
3358
|
+
break;
|
|
3359
|
+
case "didit_org_remove_member":
|
|
3360
|
+
result = await members.removeMember(args.member_id, args?.organization_id);
|
|
3361
|
+
break;
|
|
3362
|
+
case "didit_org_list_roles":
|
|
3363
|
+
result = await members.listRoles(args?.organization_id);
|
|
3364
|
+
break;
|
|
3365
|
+
case "didit_org_list_api_keys":
|
|
3366
|
+
result = await members.listApiKeys(args?.organization_id, args?.application_id);
|
|
3367
|
+
break;
|
|
3368
|
+
// Compliance
|
|
3369
|
+
case "didit_workflow_build_graph":
|
|
3370
|
+
result = await compliance.buildWorkflow(args);
|
|
3371
|
+
break;
|
|
3372
|
+
default:
|
|
3373
|
+
return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
|
|
3374
|
+
}
|
|
3375
|
+
// Annotated here, after BOTH paths (the scoped list and the cross-app aggregate
|
|
3376
|
+
// fallback) have produced their rows, so the flag behaves the same either way.
|
|
3377
|
+
if (name === "didit_workflow_list" && args?.include_age_assurance) {
|
|
3378
|
+
result = await workflowGraph.annotateAgeAssurance(result);
|
|
3379
|
+
}
|
|
3380
|
+
// Apply the endpoint's data boundary to BOTH response channels, including modern RPC.
|
|
3381
|
+
result = (0, chatgpt_app_1.applyCatalogResult)(profile, name, result);
|
|
3382
|
+
// `content` is the model-facing channel (a client with an outputSchema hands
|
|
3383
|
+
// THIS text to the model, not structuredContent), so it is COMPACT: the
|
|
3384
|
+
// 2-space pretty print ran ~3× the compact form — seven didit_workflow_get
|
|
3385
|
+
// reads of ~50k chars reached the assistant's model as ~147k chars each and
|
|
3386
|
+
// burst its 1.05M-token window (didit-ai-assistant, Sentry
|
|
3387
|
+
// DIDIT-AI-ASSISTANT-2K, 429 turns 11-15 Sep 2026). Same data, same order.
|
|
3388
|
+
return {
|
|
3389
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
3390
|
+
structuredContent: result && typeof result === "object" && !Array.isArray(result) ? result : { value: result },
|
|
3391
|
+
};
|
|
813
3392
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
3393
|
+
catch (error) {
|
|
3394
|
+
// Structured, sanitized error: code/field/hint/allowed surfaced; backend secrets,
|
|
3395
|
+
// PII and local paths stripped; structuredContent OMITTED so a strict client never
|
|
3396
|
+
// validates an error against the tool's success outputSchema.
|
|
3397
|
+
const shape = (0, security_1.toSafeErrorShape)(error);
|
|
3398
|
+
const fieldLine = shape.field ? `\nField: ${shape.field}` : "";
|
|
3399
|
+
const hintLine = shape.hint ? `\nHint: ${shape.hint}` : "";
|
|
3400
|
+
const allowedLine = shape.allowed && shape.allowed.length ? `\nAllowed: ${shape.allowed.join(", ")}` : "";
|
|
3401
|
+
return {
|
|
3402
|
+
content: [{ type: "text", text: `Error [${shape.code}]: ${shape.message}${fieldLine}${hintLine}${allowedLine}` }],
|
|
3403
|
+
isError: true,
|
|
3404
|
+
};
|
|
818
3405
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
case "didit_poa_verification":
|
|
824
|
-
result = await standalone.poaVerification(args.front_image_path, args?.back_image_path);
|
|
825
|
-
break;
|
|
826
|
-
case "didit_database_validation":
|
|
827
|
-
result = await standalone.databaseValidation(args);
|
|
828
|
-
break;
|
|
829
|
-
// Standalone: Biometrics
|
|
830
|
-
case "didit_passive_liveness":
|
|
831
|
-
result = await standalone.passiveLiveness(args.image_path);
|
|
832
|
-
break;
|
|
833
|
-
case "didit_face_match":
|
|
834
|
-
result = await standalone.faceMatch(args.image_1_path, args.image_2_path);
|
|
835
|
-
break;
|
|
836
|
-
case "didit_face_search":
|
|
837
|
-
result = await standalone.faceSearch(args.image_path);
|
|
838
|
-
break;
|
|
839
|
-
case "didit_age_estimation":
|
|
840
|
-
result = await standalone.ageEstimation(args.image_path);
|
|
841
|
-
break;
|
|
842
|
-
// Standalone: AML
|
|
843
|
-
case "didit_aml_screening":
|
|
844
|
-
result = await standalone.amlScreening(args);
|
|
845
|
-
break;
|
|
846
|
-
// Standalone: Email & Phone
|
|
847
|
-
case "didit_email_send":
|
|
848
|
-
result = await standalone.emailSend(args);
|
|
849
|
-
break;
|
|
850
|
-
case "didit_email_check":
|
|
851
|
-
result = await standalone.emailCheck(args);
|
|
852
|
-
break;
|
|
853
|
-
case "didit_phone_send":
|
|
854
|
-
result = await standalone.phoneSend(args);
|
|
855
|
-
break;
|
|
856
|
-
case "didit_phone_check":
|
|
857
|
-
result = await standalone.phoneCheck(args);
|
|
858
|
-
break;
|
|
859
|
-
default:
|
|
860
|
-
return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
|
|
861
|
-
}
|
|
862
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
863
|
-
}
|
|
864
|
-
catch (error) {
|
|
865
|
-
const message = error?.message || String(error);
|
|
866
|
-
return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
|
|
867
|
-
}
|
|
868
|
-
});
|
|
3406
|
+
}));
|
|
3407
|
+
});
|
|
3408
|
+
return server;
|
|
3409
|
+
}
|
|
869
3410
|
async function main() {
|
|
870
3411
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
3412
|
+
const server = createServer({ profile: (0, chatgpt_app_1.stdioCatalogProfile)() });
|
|
871
3413
|
await server.connect(transport);
|
|
872
|
-
console.error(
|
|
3414
|
+
console.error(`Didit MCP Server v${config_1.SERVER_VERSION} running on stdio`);
|
|
3415
|
+
}
|
|
3416
|
+
// Only auto-start the stdio server when this file is run directly — when the HTTP
|
|
3417
|
+
// entrypoint (src/http.ts) imports createServer(), main() must NOT fire.
|
|
3418
|
+
if (require.main === module) {
|
|
3419
|
+
main().catch(console.error);
|
|
873
3420
|
}
|
|
874
|
-
main().catch(console.error);
|
|
875
3421
|
//# sourceMappingURL=index.js.map
|