@bitsbound/mcp-server 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orchestration/backautocrat/Bitsbound_Kings_McpServer_Backend_Orchestration_Backautocrat.d.ts +21 -5
- package/dist/orchestration/backautocrat/Bitsbound_Kings_McpServer_Backend_Orchestration_Backautocrat.d.ts.map +1 -1
- package/dist/orchestration/backautocrat/Bitsbound_Kings_McpServer_Backend_Orchestration_Backautocrat.js +118 -237
- package/dist/orchestration/backautocrat/Bitsbound_Kings_McpServer_Backend_Orchestration_Backautocrat.js.map +1 -1
- package/dist/server/Bitsbound_Kings_McpServer_Backend_Server.js +31 -0
- package/dist/server/Bitsbound_Kings_McpServer_Backend_Server.js.map +1 -1
- package/dist/types/Bitsbound_Kings_McpServer_Backend_Types.d.ts +318 -46
- package/dist/types/Bitsbound_Kings_McpServer_Backend_Types.d.ts.map +1 -1
- package/dist/types/Bitsbound_Kings_McpServer_Backend_Types.js +399 -8
- package/dist/types/Bitsbound_Kings_McpServer_Backend_Types.js.map +1 -1
- package/logger/Bitsbound_Kings_McpServer_Backend_Logger.ts +130 -0
- package/orchestration/backautocrat/Bitsbound_Kings_McpServer_Backend_Orchestration_Backautocrat.ts +715 -0
- package/package.json +12 -17
- package/server/Bitsbound_Kings_McpServer_Backend_Server.ts +1441 -0
- package/server.json +20 -0
- package/tsconfig.json +21 -0
- package/types/Bitsbound_Kings_McpServer_Backend_Types.node.test.mjs +14 -0
- package/types/Bitsbound_Kings_McpServer_Backend_Types.ts +1667 -0
|
@@ -0,0 +1,1667 @@
|
|
|
1
|
+
////////////////////////////////////////
|
|
2
|
+
// # GOLDEN RULE!!!! HONOR ABOVE ALL!!!!
|
|
3
|
+
////////////////////////////////////////
|
|
4
|
+
// NO NEW FILES!!!!!!!!!
|
|
5
|
+
////////////////////////////////////////
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
9
|
+
*/
|
|
10
|
+
// ## REQUIREMENTS 'R'
|
|
11
|
+
/*
|
|
12
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
|
|
18
|
+
*/
|
|
19
|
+
// ### DEFINITIONS, VALIDATIONS, AND TRANSFORMATIONS 'R_DVT'
|
|
20
|
+
/*
|
|
21
|
+
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
######################################################################################################################################################################################################
|
|
27
|
+
*/
|
|
28
|
+
// #### GLOBAL 'R_DVT_G', i.e., File/Agreement Level DVTs
|
|
29
|
+
/*
|
|
30
|
+
######################################################################################################################################################################################################
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅
|
|
36
|
+
*/
|
|
37
|
+
// ##### DEFINITIONS 'R_DVT_G_D' - MCP Server Configuration & API Types
|
|
38
|
+
/*
|
|
39
|
+
❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅❅
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
43
|
+
// MCP Server Configuration 'R_DVT_G_D_Config'
|
|
44
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
45
|
+
|
|
46
|
+
export interface McpServerConfig {
|
|
47
|
+
readonly BITSBOUND_API_URL: string;
|
|
48
|
+
readonly BITSBOUND_API_KEY: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const DEFAULT_API_URL = 'https://bitsbound-saas-backend-mxb1.onrender.com';
|
|
52
|
+
|
|
53
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
54
|
+
// Tool Input Schemas 'R_DVT_G_D_ToolInputs' - What AI platforms send to each tool
|
|
55
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
56
|
+
|
|
57
|
+
export interface AnalyzeContractInput {
|
|
58
|
+
readonly filePath?: string; // RECOMMENDED: Absolute path to DOCX file on disk
|
|
59
|
+
readonly docxBase64?: string; // Alternative: Base64-encoded DOCX content
|
|
60
|
+
readonly fileName?: string; // Optional if using filePath (extracted from path)
|
|
61
|
+
readonly analysisDepth?: 'quick' | 'standard' | 'deep';
|
|
62
|
+
readonly perspective?: 'customer' | 'vendor' | 'neutral';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface GetAnalysisStatusInput {
|
|
66
|
+
readonly analysisId: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface AskSacInput {
|
|
70
|
+
readonly analysisId: string;
|
|
71
|
+
readonly question: string;
|
|
72
|
+
readonly includeClauseCitations?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface GenerateRedlineInput {
|
|
76
|
+
readonly analysisId: string;
|
|
77
|
+
readonly aggressiveness?: 1 | 2 | 3 | 4 | 5;
|
|
78
|
+
readonly includeComments?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface GenerateNegotiationEmailInput {
|
|
82
|
+
readonly analysisId: string;
|
|
83
|
+
readonly tone?: 'collaborative' | 'firm' | 'aggressive';
|
|
84
|
+
readonly recipientRole?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface ExtractClauseInput {
|
|
88
|
+
readonly analysisId: string;
|
|
89
|
+
readonly clauseType: 'indemnification' | 'liability' | 'ip' | 'termination' | 'payment' | 'confidentiality' | 'data_privacy' | 'sla' | 'force_majeure' | 'assignment';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ComparePlaybookInput {
|
|
93
|
+
readonly analysisId: string;
|
|
94
|
+
readonly playbookId: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface DownloadFileInput {
|
|
98
|
+
readonly downloadUrl: string;
|
|
99
|
+
readonly saveToPath?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
103
|
+
// INSTANT SWARM Input Schemas 'R_DVT_G_D_InstantSwarmInputs' - Parallel 17-Section Redlining
|
|
104
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* InstantSwarmInput - Parallel redlining of entire contract across all 17 BUBSA sections
|
|
108
|
+
* D: Input for spawning parallel SAC sessions that independently analyze and redline each section
|
|
109
|
+
*
|
|
110
|
+
* TIR{ADVT}O Context:
|
|
111
|
+
* - T: User requests instant parallel redlining of entire contract
|
|
112
|
+
* - I: Analysis context + aggressiveness + party position
|
|
113
|
+
* - R: Spawns 17 parallel SAC sessions (one per BUBSA section), no lock contention
|
|
114
|
+
* - O: Merged redlined DOCX + per-section results
|
|
115
|
+
*/
|
|
116
|
+
export interface InstantSwarmInput {
|
|
117
|
+
readonly analysisId: string; // ID of completed TCA analysis (provides contract context)
|
|
118
|
+
readonly aggressivenessLevel: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; // How aggressive redlines should be (1-10)
|
|
119
|
+
readonly partyPosition: 'customer' | 'vendor'; // Whose side are we on?
|
|
120
|
+
readonly ourPartyName?: string; // Our company name (for proper party references)
|
|
121
|
+
readonly counterpartyName?: string; // Counterparty name
|
|
122
|
+
readonly targetSections?: string[]; // Optional: specific BUBSA sections to analyze (default: all 17)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* QuickScanInput - Instant contract analysis (5-10 seconds)
|
|
127
|
+
* D: Input for immediate risk scan and classification without full pipeline
|
|
128
|
+
*/
|
|
129
|
+
export interface QuickScanInput {
|
|
130
|
+
readonly contractText: string; // Raw contract text (or base64 DOCX)
|
|
131
|
+
readonly fileName?: string; // Optional filename for context
|
|
132
|
+
readonly perspective?: 'customer' | 'vendor' | 'neutral';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* AskClauseInput - Instant clause Q&A without prior analysis
|
|
137
|
+
* D: Ask about specific clauses directly from contract text
|
|
138
|
+
*/
|
|
139
|
+
export interface AskClauseInput {
|
|
140
|
+
readonly contractText: string; // Raw contract text
|
|
141
|
+
readonly question: string; // What to find/explain
|
|
142
|
+
readonly clauseType?: 'indemnification' | 'liability' | 'ip' | 'termination' | 'payment' | 'confidentiality' | 'data_privacy' | 'sla' | 'force_majeure' | 'assignment' | 'any';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* CheckDealbreakersInput - Quick playbook compliance check
|
|
147
|
+
* D: Fast check for must-have clauses and dealbreakers
|
|
148
|
+
*/
|
|
149
|
+
export interface CheckDealbreakersInput {
|
|
150
|
+
readonly contractText: string; // Raw contract text
|
|
151
|
+
readonly playbookId?: string; // Optional specific playbook (default: customer's default)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
155
|
+
// Tool Output Types 'R_DVT_G_D_ToolOutputs' - What tools return to AI platforms
|
|
156
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
157
|
+
|
|
158
|
+
export interface AnalyzeContractOutput {
|
|
159
|
+
readonly analysisId: string;
|
|
160
|
+
readonly status: 'queued' | 'processing' | 'completed' | 'failed';
|
|
161
|
+
readonly estimatedTimeMinutes: number;
|
|
162
|
+
readonly initialRiskSummary?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* AnalysisStatusOutput - Status of running/completed analysis
|
|
167
|
+
* D: Reports progress through the 8-stage TCA pipeline:
|
|
168
|
+
* 1. Loading Context - Parsing deal context and contract structure
|
|
169
|
+
* 2. Extracting Data - Running 13 deterministic extraction scripts
|
|
170
|
+
* 3. Identifying Parties - AI identifying customer and vendor
|
|
171
|
+
* 4. Researching - Running 8 parallel research analyzers
|
|
172
|
+
* 5. AI Analysis - Running 18 parallel AI analyzers
|
|
173
|
+
* 6. Instant Swarm™ - Parallel redlining across all sections (if enabled)
|
|
174
|
+
* 7. Generating Email - Drafting negotiation email (if enabled)
|
|
175
|
+
* 8. Synthesizing Results - Generating recommendations and scores
|
|
176
|
+
*/
|
|
177
|
+
export interface AnalysisStatusOutput {
|
|
178
|
+
readonly analysisId: string;
|
|
179
|
+
readonly status: 'queued' | 'processing' | 'completed' | 'failed';
|
|
180
|
+
readonly progressPercent: number;
|
|
181
|
+
readonly currentPhase: string;
|
|
182
|
+
readonly phasesCompleted: string[];
|
|
183
|
+
readonly favorabilityScore?: number;
|
|
184
|
+
readonly topRisks?: string[];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface SacResponseOutput {
|
|
188
|
+
readonly response: string;
|
|
189
|
+
readonly clauseCitations?: ClauseCitation[];
|
|
190
|
+
readonly followUpSuggestions?: string[];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface ClauseCitation {
|
|
194
|
+
readonly sectionName: string;
|
|
195
|
+
readonly clauseText: string;
|
|
196
|
+
readonly pageNumber?: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface RedlineOutput {
|
|
200
|
+
readonly redlinedDocxBase64: string;
|
|
201
|
+
readonly downloadUrl: string;
|
|
202
|
+
readonly changesCount: number;
|
|
203
|
+
readonly changesSummary: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface NegotiationEmailOutput {
|
|
207
|
+
readonly subject: string;
|
|
208
|
+
readonly body: string;
|
|
209
|
+
readonly keyPoints: string[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface ClauseExtractionOutput {
|
|
213
|
+
readonly clauseType: string;
|
|
214
|
+
readonly clauseText: string;
|
|
215
|
+
readonly riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
216
|
+
readonly riskAnalysis: string;
|
|
217
|
+
readonly suggestedImprovements: string[];
|
|
218
|
+
readonly marketComparison?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface PlaybookComparisonOutput {
|
|
222
|
+
readonly deviations: PlaybookDeviation[];
|
|
223
|
+
readonly complianceScore: number;
|
|
224
|
+
readonly requiredApprovals: string[];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface PlaybookDeviation {
|
|
228
|
+
readonly section: string;
|
|
229
|
+
readonly playbookRequirement: string;
|
|
230
|
+
readonly actualClause: string;
|
|
231
|
+
readonly severity: 'minor' | 'moderate' | 'major';
|
|
232
|
+
readonly recommendation: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
236
|
+
// INSTANT SWARM Output Types 'R_DVT_G_D_InstantSwarmOutputs' - Parallel Redlining Results
|
|
237
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* InstantSwarmOutput - Results from parallel N-section redlining
|
|
241
|
+
* D: Contains merged document + per-section analysis results
|
|
242
|
+
*
|
|
243
|
+
* TIR{ADVT}O Context:
|
|
244
|
+
* - Output from parallel SAC swarm execution
|
|
245
|
+
* - N agents for N sections (dynamic, not fixed)
|
|
246
|
+
* - Each section analyzed independently, then merged
|
|
247
|
+
* - Real OOXML Track Changes applied to original document
|
|
248
|
+
*/
|
|
249
|
+
export interface InstantSwarmOutput {
|
|
250
|
+
readonly success: boolean;
|
|
251
|
+
readonly totalSections: number; // Total sections analyzed (N sections = N agents)
|
|
252
|
+
readonly completedSections: number; // Successfully completed sections
|
|
253
|
+
readonly failedSections: number; // Sections that failed (errors)
|
|
254
|
+
readonly redlinedDocumentBase64?: string; // Merged redlined DOCX (base64 encoded)
|
|
255
|
+
readonly redlinedDocumentUrl?: string; // Download URL for redlined document
|
|
256
|
+
readonly sectionResults: InstantSwarmSectionResult[]; // Per-section breakdown
|
|
257
|
+
readonly totalRedlinesApplied: number; // Total Track Changes across all sections
|
|
258
|
+
readonly totalCommentsApplied: number; // Total margin comments added
|
|
259
|
+
readonly executionTimeMs: number; // Total execution time
|
|
260
|
+
readonly tokenUsage?: {
|
|
261
|
+
readonly inputTokens: number;
|
|
262
|
+
readonly outputTokens: number;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* InstantSwarmSectionResult - Results for a single BUBSA section
|
|
268
|
+
* D: Individual section analysis from the swarm
|
|
269
|
+
*/
|
|
270
|
+
export interface InstantSwarmSectionResult {
|
|
271
|
+
readonly sectionId: string; // BUBSA section ID (e.g., "ip_license", "liability")
|
|
272
|
+
readonly sectionName: string; // Human-readable name (e.g., "IP License Grant")
|
|
273
|
+
readonly success: boolean; // Did this section complete successfully?
|
|
274
|
+
readonly redlinesApplied: number; // Track Changes for this section
|
|
275
|
+
readonly commentsApplied: number; // Comments for this section
|
|
276
|
+
readonly keyChanges?: string[]; // Summary of major changes made
|
|
277
|
+
readonly error?: string; // Error message if failed
|
|
278
|
+
readonly executionTimeMs: number; // Time for this section
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* QuickScanOutput - Instant analysis results (5-10 seconds)
|
|
283
|
+
* D: Immediate risk assessment without full pipeline
|
|
284
|
+
*/
|
|
285
|
+
export interface QuickScanOutput {
|
|
286
|
+
readonly contractType: string; // "Master Service Agreement", "SaaS Agreement", etc.
|
|
287
|
+
readonly parties: {
|
|
288
|
+
readonly customer: string;
|
|
289
|
+
readonly vendor: string;
|
|
290
|
+
};
|
|
291
|
+
readonly favorabilityEstimate: number; // 0-100 score
|
|
292
|
+
readonly favorabilityLabel: 'Customer-Favorable' | 'Balanced' | 'Vendor-Favorable' | 'Heavily Vendor-Favorable';
|
|
293
|
+
readonly topConcerns: Array<{
|
|
294
|
+
readonly severity: 'critical' | 'high' | 'medium' | 'low';
|
|
295
|
+
readonly category: string; // "Liability", "IP", "Termination", etc.
|
|
296
|
+
readonly summary: string; // Brief description
|
|
297
|
+
}>;
|
|
298
|
+
readonly keyTerms: {
|
|
299
|
+
readonly term?: string; // "3 years, auto-renew"
|
|
300
|
+
readonly paymentTerms?: string; // "Net 30, annual prepay"
|
|
301
|
+
readonly liabilityCap?: string; // "$1M" or "Unlimited (CRITICAL)"
|
|
302
|
+
readonly terminationNotice?: string; // "90 days"
|
|
303
|
+
readonly governingLaw?: string; // "Delaware"
|
|
304
|
+
};
|
|
305
|
+
readonly missingSections: string[]; // BUBSA sections not found
|
|
306
|
+
readonly recommendation: string; // "Proceed with caution" / "Recommend full analysis"
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* AskClauseOutput - Instant clause Q&A response
|
|
311
|
+
* D: Direct answer about specific clauses
|
|
312
|
+
*/
|
|
313
|
+
export interface AskClauseOutput {
|
|
314
|
+
readonly answer: string; // Natural language answer
|
|
315
|
+
readonly clauseText?: string; // Extracted clause if found
|
|
316
|
+
readonly clauseLocation?: string; // "Section 8.2", "Page 12"
|
|
317
|
+
readonly riskAssessment?: {
|
|
318
|
+
readonly level: 'low' | 'medium' | 'high' | 'critical';
|
|
319
|
+
readonly explanation: string;
|
|
320
|
+
};
|
|
321
|
+
readonly suggestedFollowUp?: string[]; // Related questions to ask
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* CheckDealbreakersOutput - Quick compliance check results
|
|
326
|
+
* D: Fast identification of dealbreakers and missing requirements
|
|
327
|
+
*/
|
|
328
|
+
export interface CheckDealbreakersOutput {
|
|
329
|
+
readonly passesInitialScreen: boolean; // Quick go/no-go
|
|
330
|
+
readonly dealbreakers: Array<{
|
|
331
|
+
readonly issue: string;
|
|
332
|
+
readonly severity: 'blocker' | 'major' | 'minor';
|
|
333
|
+
readonly requirement: string; // What the playbook requires
|
|
334
|
+
readonly actual: string; // What the contract has
|
|
335
|
+
}>;
|
|
336
|
+
readonly missingRequirements: string[]; // Required clauses not found
|
|
337
|
+
readonly approvalsNeeded: string[]; // Who needs to sign off
|
|
338
|
+
readonly recommendation: 'proceed' | 'negotiate' | 'escalate' | 'reject';
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
342
|
+
// BitsBound SaaS API Types 'R_DVT_G_D_ApiTypes' - For calling the backend
|
|
343
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
344
|
+
|
|
345
|
+
export interface BitsBoundApiResponse<T> {
|
|
346
|
+
readonly success: boolean;
|
|
347
|
+
readonly data?: T;
|
|
348
|
+
readonly error?: string;
|
|
349
|
+
readonly tokenUsage?: number;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export interface StartAnalysisResponse {
|
|
353
|
+
readonly analysisId: string;
|
|
354
|
+
readonly status: string;
|
|
355
|
+
readonly estimatedMinutes: number;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface AnalysisProgressResponse {
|
|
359
|
+
readonly analysisId: string;
|
|
360
|
+
readonly status: string;
|
|
361
|
+
readonly progress: number;
|
|
362
|
+
readonly phase: string;
|
|
363
|
+
readonly phasesCompleted: string[];
|
|
364
|
+
readonly results?: AnalysisResults;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface AnalysisResults {
|
|
368
|
+
readonly favorabilityScore: number;
|
|
369
|
+
readonly topRisks: RiskItem[];
|
|
370
|
+
readonly sections: SectionAnalysis[];
|
|
371
|
+
readonly negotiationPriorities: string[];
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface RiskItem {
|
|
375
|
+
readonly section: string;
|
|
376
|
+
readonly risk: string;
|
|
377
|
+
readonly severity: 'low' | 'medium' | 'high' | 'critical';
|
|
378
|
+
readonly recommendation: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export interface SectionAnalysis {
|
|
382
|
+
readonly sectionName: string;
|
|
383
|
+
readonly favorability: number;
|
|
384
|
+
readonly issues: string[];
|
|
385
|
+
readonly suggestedChanges: string[];
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
389
|
+
// MCP Tool Definitions 'R_DVT_G_D_ToolDefs' - Tool schemas for MCP protocol
|
|
390
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
391
|
+
|
|
392
|
+
export const TOOL_DEFINITIONS = {
|
|
393
|
+
process_contract: {
|
|
394
|
+
name: 'process_contract',
|
|
395
|
+
description: 'Process a contract through the full 8-stage BitsBound pipeline: (1) Context Loading, (2) Data Extraction, (3) Party Identification, (4) Research, (5) AI Analysis with 18+ parallel analyzers, (6) Instant Swarm™ parallel redlining, (7) Negotiation Email Generation, (8) Synthesis. Returns a processing ID to track progress. Output includes: redlined DOCX with Track Changes, negotiation email, risk dashboard, and favorability scores. IMPORTANT: Provide EITHER filePath OR docxBase64 (not both). Using filePath is recommended.',
|
|
396
|
+
inputSchema: {
|
|
397
|
+
type: 'object',
|
|
398
|
+
properties: {
|
|
399
|
+
filePath: {
|
|
400
|
+
type: 'string',
|
|
401
|
+
description: 'RECOMMENDED: Absolute path to the DOCX file on disk (e.g., "/Users/john/Documents/contract.docx"). The server will read and encode the file automatically.'
|
|
402
|
+
},
|
|
403
|
+
docxBase64: {
|
|
404
|
+
type: 'string',
|
|
405
|
+
description: 'Alternative: The contract document already encoded as base64 string (DOCX format). Use filePath instead if possible.'
|
|
406
|
+
},
|
|
407
|
+
fileName: {
|
|
408
|
+
type: 'string',
|
|
409
|
+
description: 'Original filename of the document. If using filePath, this is extracted automatically.'
|
|
410
|
+
},
|
|
411
|
+
analysisDepth: {
|
|
412
|
+
type: 'string',
|
|
413
|
+
enum: ['quick', 'standard', 'deep'],
|
|
414
|
+
description: 'Analysis depth: quick (~5 min), standard (~15 min), deep (~30 min). Default: standard'
|
|
415
|
+
},
|
|
416
|
+
perspective: {
|
|
417
|
+
type: 'string',
|
|
418
|
+
enum: ['customer', 'vendor', 'neutral'],
|
|
419
|
+
description: 'Analyze from customer (buyer), vendor (seller), or neutral perspective. Default: customer'
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
required: []
|
|
423
|
+
},
|
|
424
|
+
annotations: {
|
|
425
|
+
readOnlyHint: false,
|
|
426
|
+
destructiveHint: false
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
get_analysis_status: {
|
|
431
|
+
name: 'get_analysis_status',
|
|
432
|
+
description: 'Check the status of a running or completed contract analysis. Returns progress through the 8-stage pipeline (Context→Extraction→Parties→Research→Analysis→Swarm→Email→Synthesis). When complete, returns deliverables including: (1) redlinedDocxDownloadUrl - URL to download the redlined DOCX with Track Changes, (2) negotiationEmailHtml/negotiationEmailPlainText - the generated negotiation email content.',
|
|
433
|
+
inputSchema: {
|
|
434
|
+
type: 'object',
|
|
435
|
+
properties: {
|
|
436
|
+
analysisId: {
|
|
437
|
+
type: 'string',
|
|
438
|
+
description: 'The processing ID returned from process_contract'
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
required: ['analysisId']
|
|
442
|
+
},
|
|
443
|
+
annotations: {
|
|
444
|
+
readOnlyHint: true
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
|
|
448
|
+
ask_sac: {
|
|
449
|
+
name: 'ask_sac',
|
|
450
|
+
description: 'Ask the Supreme AI Co-Counsel (SAC) questions about an analyzed contract. SAC has full context of the contract and all analysis results. Great for clarifying risks, understanding clauses, or getting negotiation advice.',
|
|
451
|
+
inputSchema: {
|
|
452
|
+
type: 'object',
|
|
453
|
+
properties: {
|
|
454
|
+
analysisId: {
|
|
455
|
+
type: 'string',
|
|
456
|
+
description: 'The analysis ID of a completed analysis'
|
|
457
|
+
},
|
|
458
|
+
question: {
|
|
459
|
+
type: 'string',
|
|
460
|
+
description: 'Your question about the contract'
|
|
461
|
+
},
|
|
462
|
+
includeClauseCitations: {
|
|
463
|
+
type: 'boolean',
|
|
464
|
+
description: 'Include specific clause citations in the response. Default: true'
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
required: ['analysisId', 'question']
|
|
468
|
+
},
|
|
469
|
+
annotations: {
|
|
470
|
+
readOnlyHint: true
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
|
|
474
|
+
generate_redline: {
|
|
475
|
+
name: 'generate_redline',
|
|
476
|
+
description: 'Generate a redlined Word document with real OOXML Track Changes (w:ins, w:del) applied directly to the original document. Returns the redlined DOCX as base64.',
|
|
477
|
+
inputSchema: {
|
|
478
|
+
type: 'object',
|
|
479
|
+
properties: {
|
|
480
|
+
analysisId: {
|
|
481
|
+
type: 'string',
|
|
482
|
+
description: 'The analysis ID of a completed analysis'
|
|
483
|
+
},
|
|
484
|
+
aggressiveness: {
|
|
485
|
+
type: 'number',
|
|
486
|
+
enum: [1, 2, 3, 4, 5],
|
|
487
|
+
description: 'How aggressive the redlines should be (1=conservative, 5=aggressive). Default: 3'
|
|
488
|
+
},
|
|
489
|
+
includeComments: {
|
|
490
|
+
type: 'boolean',
|
|
491
|
+
description: 'Include rationale comments in Word margins. Default: true'
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
required: ['analysisId']
|
|
495
|
+
},
|
|
496
|
+
annotations: {
|
|
497
|
+
readOnlyHint: false,
|
|
498
|
+
destructiveHint: false
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
|
|
502
|
+
generate_negotiation_email: {
|
|
503
|
+
name: 'generate_negotiation_email',
|
|
504
|
+
description: 'Generate a professional negotiation email to send to the counterparty, explaining requested changes and their rationale.',
|
|
505
|
+
inputSchema: {
|
|
506
|
+
type: 'object',
|
|
507
|
+
properties: {
|
|
508
|
+
analysisId: {
|
|
509
|
+
type: 'string',
|
|
510
|
+
description: 'The analysis ID of a completed analysis'
|
|
511
|
+
},
|
|
512
|
+
tone: {
|
|
513
|
+
type: 'string',
|
|
514
|
+
enum: ['collaborative', 'firm', 'aggressive'],
|
|
515
|
+
description: 'Tone of the email. Default: collaborative'
|
|
516
|
+
},
|
|
517
|
+
recipientRole: {
|
|
518
|
+
type: 'string',
|
|
519
|
+
description: 'Role of the recipient (e.g., "General Counsel", "Sales Rep", "Procurement"). Helps tailor the message.'
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
required: ['analysisId']
|
|
523
|
+
},
|
|
524
|
+
annotations: {
|
|
525
|
+
readOnlyHint: false,
|
|
526
|
+
destructiveHint: false
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
|
|
530
|
+
extract_clause: {
|
|
531
|
+
name: 'extract_clause',
|
|
532
|
+
description: 'Extract and analyze a specific clause type from an analyzed contract. Returns the clause text, risk analysis, and suggested improvements.',
|
|
533
|
+
inputSchema: {
|
|
534
|
+
type: 'object',
|
|
535
|
+
properties: {
|
|
536
|
+
analysisId: {
|
|
537
|
+
type: 'string',
|
|
538
|
+
description: 'The analysis ID of a completed analysis'
|
|
539
|
+
},
|
|
540
|
+
clauseType: {
|
|
541
|
+
type: 'string',
|
|
542
|
+
enum: ['indemnification', 'liability', 'ip', 'termination', 'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment'],
|
|
543
|
+
description: 'The type of clause to extract'
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
required: ['analysisId', 'clauseType']
|
|
547
|
+
},
|
|
548
|
+
annotations: {
|
|
549
|
+
readOnlyHint: true
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
|
|
553
|
+
compare_playbook: {
|
|
554
|
+
name: 'compare_playbook',
|
|
555
|
+
description: 'Compare an analyzed contract against a company playbook to identify deviations from pre-approved positions and required approvals.',
|
|
556
|
+
inputSchema: {
|
|
557
|
+
type: 'object',
|
|
558
|
+
properties: {
|
|
559
|
+
analysisId: {
|
|
560
|
+
type: 'string',
|
|
561
|
+
description: 'The analysis ID of a completed analysis'
|
|
562
|
+
},
|
|
563
|
+
playbookId: {
|
|
564
|
+
type: 'string',
|
|
565
|
+
description: 'The ID of the playbook to compare against'
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
required: ['analysisId', 'playbookId']
|
|
569
|
+
},
|
|
570
|
+
annotations: {
|
|
571
|
+
readOnlyHint: true
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
|
|
575
|
+
// ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
576
|
+
// INSTANT SWARM - Parallel N-Section Redlining (spawns N agents for N sections, max parallelization)
|
|
577
|
+
// ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
578
|
+
|
|
579
|
+
instant_swarm: {
|
|
580
|
+
name: 'instant_swarm',
|
|
581
|
+
description: 'PARALLEL REDLINING of entire contract. Spawns N independent SAC agents for N sections simultaneously - maximum parallelization with no lock contention. Each agent (IP, Liability, Indemnification, Payment, Term, etc.) independently analyzes and redlines its section, then all branches merge into a single DOCX with real Track Changes. Returns merged document + per-section results. Requires a completed analysis (use process_contract first). This is the flagship feature - full attorney-quality redlines across the entire contract in parallel.',
|
|
582
|
+
inputSchema: {
|
|
583
|
+
type: 'object',
|
|
584
|
+
properties: {
|
|
585
|
+
analysisId: {
|
|
586
|
+
type: 'string',
|
|
587
|
+
description: 'The analysis ID from a completed process_contract call. The analysis provides contract context for each section.'
|
|
588
|
+
},
|
|
589
|
+
aggressivenessLevel: {
|
|
590
|
+
type: 'number',
|
|
591
|
+
enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
592
|
+
description: 'How aggressive the redlines should be (1=conservative, 10=very aggressive). Recommended: 5-7 for balanced approach.'
|
|
593
|
+
},
|
|
594
|
+
partyPosition: {
|
|
595
|
+
type: 'string',
|
|
596
|
+
enum: ['customer', 'vendor'],
|
|
597
|
+
description: 'Which side are you on? "customer" = you are buying/receiving services. "vendor" = you are selling/providing services.'
|
|
598
|
+
},
|
|
599
|
+
ourPartyName: {
|
|
600
|
+
type: 'string',
|
|
601
|
+
description: 'Your company name as it should appear in redlines (e.g., "Acme Corp").'
|
|
602
|
+
},
|
|
603
|
+
counterpartyName: {
|
|
604
|
+
type: 'string',
|
|
605
|
+
description: 'The other party\'s name (e.g., "Vendor Inc").'
|
|
606
|
+
},
|
|
607
|
+
targetSections: {
|
|
608
|
+
type: 'array',
|
|
609
|
+
items: { type: 'string' },
|
|
610
|
+
description: 'Optional: specific BUBSA sections to analyze. If omitted, analyzes all 17 sections. Valid sections: parties, definitions, ip_license, payment, term_termination, confidentiality, data_privacy, reps_warranties, indemnification, liability, insurance, assignment, force_majeure, dispute_resolution, precedence, miscellaneous, sla'
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
required: ['analysisId', 'aggressivenessLevel', 'partyPosition']
|
|
614
|
+
},
|
|
615
|
+
annotations: {
|
|
616
|
+
readOnlyHint: false,
|
|
617
|
+
destructiveHint: false
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
|
|
621
|
+
// ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
622
|
+
// QUICK TOOLS - Immediate analysis without waiting for full pipeline
|
|
623
|
+
// ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
624
|
+
|
|
625
|
+
quick_scan: {
|
|
626
|
+
name: 'quick_scan',
|
|
627
|
+
description: 'INSTANT contract analysis (5-10 seconds). Get immediate risk assessment, contract classification, top concerns, and key terms WITHOUT waiting for the full 15-30 minute analysis. Perfect for initial triage or quick questions. Use this FIRST before deciding if a full analysis is needed.',
|
|
628
|
+
inputSchema: {
|
|
629
|
+
type: 'object',
|
|
630
|
+
properties: {
|
|
631
|
+
contractText: {
|
|
632
|
+
type: 'string',
|
|
633
|
+
description: 'The contract text (plain text or base64-encoded DOCX). For DOCX files, base64 encode the file contents.'
|
|
634
|
+
},
|
|
635
|
+
fileName: {
|
|
636
|
+
type: 'string',
|
|
637
|
+
description: 'Optional filename for context (e.g., "Acme_MSA_2024.docx")'
|
|
638
|
+
},
|
|
639
|
+
perspective: {
|
|
640
|
+
type: 'string',
|
|
641
|
+
enum: ['customer', 'vendor', 'neutral'],
|
|
642
|
+
description: 'Analyze from customer (buyer), vendor (seller), or neutral perspective. Default: customer'
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
required: ['contractText']
|
|
646
|
+
},
|
|
647
|
+
annotations: {
|
|
648
|
+
readOnlyHint: true
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
|
|
652
|
+
ask_clause: {
|
|
653
|
+
name: 'ask_clause',
|
|
654
|
+
description: 'INSTANT clause Q&A (2-5 seconds). Ask about specific clauses directly WITHOUT needing a prior analysis. Examples: "What does the indemnification clause say?", "Is there a limitation of liability?", "What are the termination terms?"',
|
|
655
|
+
inputSchema: {
|
|
656
|
+
type: 'object',
|
|
657
|
+
properties: {
|
|
658
|
+
contractText: {
|
|
659
|
+
type: 'string',
|
|
660
|
+
description: 'The contract text (plain text or base64-encoded DOCX)'
|
|
661
|
+
},
|
|
662
|
+
question: {
|
|
663
|
+
type: 'string',
|
|
664
|
+
description: 'Your question about the contract (e.g., "What is the liability cap?", "Is there an auto-renewal clause?")'
|
|
665
|
+
},
|
|
666
|
+
clauseType: {
|
|
667
|
+
type: 'string',
|
|
668
|
+
enum: ['indemnification', 'liability', 'ip', 'termination', 'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment', 'any'],
|
|
669
|
+
description: 'Optional: Focus on a specific clause type, or "any" to search the whole contract. Default: any'
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
required: ['contractText', 'question']
|
|
673
|
+
},
|
|
674
|
+
annotations: {
|
|
675
|
+
readOnlyHint: true
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
|
|
679
|
+
check_dealbreakers: {
|
|
680
|
+
name: 'check_dealbreakers',
|
|
681
|
+
description: 'INSTANT dealbreaker check (3-5 seconds). Quick pass/fail screen against your playbook rules. Identifies blockers, missing required clauses, and who needs to approve. Use before spending time on full analysis.',
|
|
682
|
+
inputSchema: {
|
|
683
|
+
type: 'object',
|
|
684
|
+
properties: {
|
|
685
|
+
contractText: {
|
|
686
|
+
type: 'string',
|
|
687
|
+
description: 'The contract text (plain text or base64-encoded DOCX)'
|
|
688
|
+
},
|
|
689
|
+
playbookId: {
|
|
690
|
+
type: 'string',
|
|
691
|
+
description: 'Optional: Specific playbook to check against. If not provided, uses your default company playbook.'
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
required: ['contractText']
|
|
695
|
+
},
|
|
696
|
+
annotations: {
|
|
697
|
+
readOnlyHint: true
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
|
|
701
|
+
download_file: {
|
|
702
|
+
name: 'download_file',
|
|
703
|
+
description: 'Download a file from BitsBound (e.g., the redlined DOCX with Track Changes). Returns the file as base64-encoded content that can be saved locally. The downloadUrl is provided by get_analysis_status when analysis is complete.',
|
|
704
|
+
inputSchema: {
|
|
705
|
+
type: 'object',
|
|
706
|
+
properties: {
|
|
707
|
+
downloadUrl: {
|
|
708
|
+
type: 'string',
|
|
709
|
+
description: 'The download URL from get_analysis_status deliverables (redlinedDocxDownloadUrl)'
|
|
710
|
+
},
|
|
711
|
+
saveToPath: {
|
|
712
|
+
type: 'string',
|
|
713
|
+
description: 'Optional: Local file path to save the downloaded file. If not provided, returns base64 content.'
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
required: ['downloadUrl']
|
|
717
|
+
},
|
|
718
|
+
annotations: {
|
|
719
|
+
readOnlyHint: true
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
} as const;
|
|
723
|
+
|
|
724
|
+
export type ToolName = keyof typeof TOOL_DEFINITIONS;
|
|
725
|
+
|
|
726
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
727
|
+
// MCP Resource Definitions 'R_DVT_G_D_ResourceDefs' - Resources AI can read
|
|
728
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
729
|
+
|
|
730
|
+
export const RESOURCE_DEFINITIONS = {
|
|
731
|
+
analysis: {
|
|
732
|
+
uriTemplate: 'bitsbound://analysis/{analysisId}',
|
|
733
|
+
name: 'Contract Analysis',
|
|
734
|
+
description: 'Full analysis results including all 17 analyzer outputs, risk scores, and recommendations',
|
|
735
|
+
mimeType: 'application/json'
|
|
736
|
+
},
|
|
737
|
+
playbook: {
|
|
738
|
+
uriTemplate: 'bitsbound://playbook/{playbookId}',
|
|
739
|
+
name: 'Company Playbook',
|
|
740
|
+
description: 'Pre-approved clause library and negotiation rules',
|
|
741
|
+
mimeType: 'application/json'
|
|
742
|
+
},
|
|
743
|
+
redline: {
|
|
744
|
+
uriTemplate: 'bitsbound://redline/{analysisId}',
|
|
745
|
+
name: 'Redlined Contract',
|
|
746
|
+
description: 'The redlined DOCX with Track Changes',
|
|
747
|
+
mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
748
|
+
}
|
|
749
|
+
} as const;
|
|
750
|
+
|
|
751
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
752
|
+
// MCP Prompt Definitions 'R_DVT_G_D_PromptDefs' - User-facing workflow templates
|
|
753
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* PROMPT_DEFINITIONS - MCP Prompts for guiding users through BitsBound workflows
|
|
757
|
+
* D: These appear in claude.ai's "Add from BitsBound" menu as actionable items
|
|
758
|
+
*
|
|
759
|
+
* TIR{ADVT}O Context:
|
|
760
|
+
* - T: User selects a prompt from the menu
|
|
761
|
+
* - I: Prompt template with optional arguments
|
|
762
|
+
* - R: Claude receives structured instructions to guide the workflow
|
|
763
|
+
* - O: User experiences a smooth, guided contract analysis flow
|
|
764
|
+
*/
|
|
765
|
+
export const PROMPT_DEFINITIONS = {
|
|
766
|
+
process_contract: {
|
|
767
|
+
name: 'process_contract',
|
|
768
|
+
description: '📄 Process Contract - Upload a DOCX and get partner-level redlines with Track Changes, risk analysis, and a negotiation email',
|
|
769
|
+
arguments: []
|
|
770
|
+
},
|
|
771
|
+
quick_scan: {
|
|
772
|
+
name: 'quick_scan',
|
|
773
|
+
description: '⚡ Quick Risk Scan - Get instant risk assessment in 5-10 seconds without waiting for full analysis',
|
|
774
|
+
arguments: []
|
|
775
|
+
},
|
|
776
|
+
ask_about_contract: {
|
|
777
|
+
name: 'ask_about_contract',
|
|
778
|
+
description: '💬 Ask About a Clause - Upload a contract and ask specific questions about any clause or term',
|
|
779
|
+
arguments: []
|
|
780
|
+
},
|
|
781
|
+
check_dealbreakers: {
|
|
782
|
+
name: 'check_dealbreakers',
|
|
783
|
+
description: '🚨 Check Dealbreakers - Quick pass/fail check against your playbook rules',
|
|
784
|
+
arguments: []
|
|
785
|
+
},
|
|
786
|
+
continue_analysis: {
|
|
787
|
+
name: 'continue_analysis',
|
|
788
|
+
description: '📊 Continue Previous Analysis - Resume working with a previously analyzed contract',
|
|
789
|
+
arguments: [
|
|
790
|
+
{
|
|
791
|
+
name: 'analysisId',
|
|
792
|
+
description: 'The analysis ID from a previous contract analysis',
|
|
793
|
+
required: true
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
}
|
|
797
|
+
} as const;
|
|
798
|
+
|
|
799
|
+
export type PromptName = keyof typeof PROMPT_DEFINITIONS;
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* PROMPT_MESSAGES - The actual prompt content sent to Claude when user selects a prompt
|
|
803
|
+
* D: These guide Claude to ask for the right inputs and call the right tools
|
|
804
|
+
* NOTE: MCP spec requires content to be { type: 'text', text: string } not plain string
|
|
805
|
+
*/
|
|
806
|
+
export const PROMPT_MESSAGES: Record<PromptName, { role: 'user'; content: { type: 'text'; text: string } }[]> = {
|
|
807
|
+
process_contract: [
|
|
808
|
+
{
|
|
809
|
+
role: 'user',
|
|
810
|
+
content: { type: 'text', text: `I want to analyze a contract using BitsBound.
|
|
811
|
+
|
|
812
|
+
Please help me by:
|
|
813
|
+
1. Asking me to upload the contract file (DOCX format)
|
|
814
|
+
2. Once I upload it, use the BitsBound 'process_contract' tool to analyze it
|
|
815
|
+
3. IMPORTANT: After starting, automatically check progress every 2-3 minutes using 'get_analysis_status' - do NOT stop or wait for me to ask. Keep polling until status is 'complete' or 'failed'. Show me brief progress updates each time.
|
|
816
|
+
4. When complete, show me:
|
|
817
|
+
- The favorability score (who the contract favors)
|
|
818
|
+
- Top 5 risks I should know about
|
|
819
|
+
- Recommended negotiation priorities
|
|
820
|
+
- Download link for the redlined DOCX (if available in deliverables)
|
|
821
|
+
- Summary of the negotiation email draft
|
|
822
|
+
|
|
823
|
+
The analysis typically takes 15-30 minutes. Keep checking automatically until done.` }
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
quick_scan: [
|
|
827
|
+
{
|
|
828
|
+
role: 'user',
|
|
829
|
+
content: { type: 'text', text: `I want a quick risk scan of a contract (5-10 seconds, not the full analysis).
|
|
830
|
+
|
|
831
|
+
Please help me by:
|
|
832
|
+
1. Asking me to upload or paste the contract
|
|
833
|
+
2. Use the BitsBound 'quick_scan' tool for instant analysis
|
|
834
|
+
3. Show me:
|
|
835
|
+
- Contract type and parties
|
|
836
|
+
- Favorability estimate
|
|
837
|
+
- Top concerns by severity
|
|
838
|
+
- Key terms (liability cap, term, payment, etc.)
|
|
839
|
+
- Whether I should do a full analysis
|
|
840
|
+
|
|
841
|
+
This is for initial triage - not a substitute for full attorney review.` }
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
ask_about_contract: [
|
|
845
|
+
{
|
|
846
|
+
role: 'user',
|
|
847
|
+
content: { type: 'text', text: `I want to ask questions about specific clauses in a contract.
|
|
848
|
+
|
|
849
|
+
Please help me by:
|
|
850
|
+
1. Asking me to upload or paste the contract (or relevant sections)
|
|
851
|
+
2. Ask what I want to know (e.g., "What is the liability cap?", "Is there an auto-renewal?")
|
|
852
|
+
3. Use the BitsBound 'ask_clause' tool for instant answers
|
|
853
|
+
4. Include the actual clause text and any risk assessment
|
|
854
|
+
|
|
855
|
+
I can ask multiple questions - this is a Q&A session about the contract.` }
|
|
856
|
+
}
|
|
857
|
+
],
|
|
858
|
+
check_dealbreakers: [
|
|
859
|
+
{
|
|
860
|
+
role: 'user',
|
|
861
|
+
content: { type: 'text', text: `I want to check a contract for dealbreakers against my company's playbook.
|
|
862
|
+
|
|
863
|
+
Please help me by:
|
|
864
|
+
1. Asking me to upload or paste the contract
|
|
865
|
+
2. Use the BitsBound 'check_dealbreakers' tool
|
|
866
|
+
3. Show me:
|
|
867
|
+
- Pass/fail result
|
|
868
|
+
- Any dealbreaker issues found
|
|
869
|
+
- Missing required clauses
|
|
870
|
+
- Who needs to approve if we proceed
|
|
871
|
+
|
|
872
|
+
This is a quick pre-screen before spending time on full analysis.` }
|
|
873
|
+
}
|
|
874
|
+
],
|
|
875
|
+
continue_analysis: [
|
|
876
|
+
{
|
|
877
|
+
role: 'user',
|
|
878
|
+
content: { type: 'text', text: `I want to continue working with a previously analyzed contract.
|
|
879
|
+
|
|
880
|
+
I have an analysis ID from a previous BitsBound analysis. Please:
|
|
881
|
+
1. Ask me for the analysis ID
|
|
882
|
+
2. Use 'get_analysis_status' to check if it's complete
|
|
883
|
+
3. If complete, I can:
|
|
884
|
+
- Ask questions with 'ask_sac' (SAC has full context)
|
|
885
|
+
- Generate a redlined document with 'generate_redline'
|
|
886
|
+
- Generate a negotiation email with 'generate_negotiation_email'
|
|
887
|
+
- Extract specific clauses with 'extract_clause'
|
|
888
|
+
- Compare against a playbook with 'compare_playbook'
|
|
889
|
+
|
|
890
|
+
What would you like to do with this analysis?` }
|
|
891
|
+
}
|
|
892
|
+
]
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
896
|
+
// OpenAPI Specification 'R_DVT_G_D_OpenAPI' - For ChatGPT Actions
|
|
897
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* OpenAPI 3.1 specification for BitsBound Contract Analysis API.
|
|
901
|
+
* Used by ChatGPT Custom GPT Actions to call the BitsBound MCP API endpoints.
|
|
902
|
+
*
|
|
903
|
+
* TIR{ADVT}O Context:
|
|
904
|
+
* - Definition: Complete API schema enabling ChatGPT to understand and call BitsBound endpoints
|
|
905
|
+
* - Validation: JSON Schema validation for all request/response bodies
|
|
906
|
+
* - Output: JSON object conforming to OpenAPI 3.1 specification
|
|
907
|
+
*/
|
|
908
|
+
export const OPENAPI_SPEC = {
|
|
909
|
+
openapi: '3.1.0',
|
|
910
|
+
info: {
|
|
911
|
+
title: 'BitsBound Contract Analysis API',
|
|
912
|
+
description: 'AI-powered contract analysis for legal professionals. Analyze contracts, generate redlines with real Track Changes, get clause-by-clause risk analysis, and draft negotiation emails.',
|
|
913
|
+
version: '1.0.0',
|
|
914
|
+
contact: {
|
|
915
|
+
name: 'BitsBound Support',
|
|
916
|
+
url: 'https://bitsbound.com',
|
|
917
|
+
email: 'support@bitsbound.com'
|
|
918
|
+
},
|
|
919
|
+
termsOfService: 'https://bitsbound.com/terms',
|
|
920
|
+
'x-logo': {
|
|
921
|
+
url: 'https://bitsbound.com/favicon.svg'
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
servers: [
|
|
925
|
+
{
|
|
926
|
+
url: 'https://bitsbound-saas-backend-mxb1.onrender.com',
|
|
927
|
+
description: 'Production server'
|
|
928
|
+
}
|
|
929
|
+
],
|
|
930
|
+
security: [
|
|
931
|
+
{ ApiKeyAuth: [] }
|
|
932
|
+
],
|
|
933
|
+
paths: {
|
|
934
|
+
'/api/v1/mcp/analyze': {
|
|
935
|
+
post: {
|
|
936
|
+
operationId: 'analyzeContract',
|
|
937
|
+
summary: 'Upload and analyze a contract',
|
|
938
|
+
description: 'Upload a contract (DOCX or PDF) for comprehensive AI analysis through an 8-stage pipeline: (1) Context Loading, (2) Data Extraction with 13 scripts, (3) Party Identification, (4) Research with 8 parallel analyzers, (5) AI Analysis with 18+ parallel analyzers, (6) Instant Swarm™ parallel redlining (optional), (7) Email Generation (optional), (8) Synthesis. Returns an analysis ID to track progress.',
|
|
939
|
+
tags: ['Contract Analysis'],
|
|
940
|
+
requestBody: {
|
|
941
|
+
required: true,
|
|
942
|
+
content: {
|
|
943
|
+
'application/json': {
|
|
944
|
+
schema: {
|
|
945
|
+
type: 'object',
|
|
946
|
+
required: ['contract_content', 'filename'],
|
|
947
|
+
properties: {
|
|
948
|
+
contract_content: {
|
|
949
|
+
type: 'string',
|
|
950
|
+
description: 'Base64-encoded contract file (DOCX or PDF)'
|
|
951
|
+
},
|
|
952
|
+
filename: {
|
|
953
|
+
type: 'string',
|
|
954
|
+
description: 'Original filename with extension (e.g., "msa.docx")'
|
|
955
|
+
},
|
|
956
|
+
analysis_type: {
|
|
957
|
+
type: 'string',
|
|
958
|
+
enum: ['quick', 'standard', 'full'],
|
|
959
|
+
default: 'full',
|
|
960
|
+
description: 'Analysis depth: quick (~5 min), standard (~15 min), full (~30 min)'
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
responses: {
|
|
968
|
+
'200': {
|
|
969
|
+
description: 'Analysis started successfully',
|
|
970
|
+
content: {
|
|
971
|
+
'application/json': {
|
|
972
|
+
schema: {
|
|
973
|
+
type: 'object',
|
|
974
|
+
properties: {
|
|
975
|
+
success: { type: 'boolean' },
|
|
976
|
+
analysisId: { type: 'string', description: 'Unique identifier for tracking this analysis' },
|
|
977
|
+
status: { type: 'string', enum: ['queued', 'processing'] },
|
|
978
|
+
estimatedTime: { type: 'string', description: 'Estimated completion time' },
|
|
979
|
+
message: { type: 'string' }
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
'400': { description: 'Invalid request - missing or malformed parameters' },
|
|
986
|
+
'401': { description: 'Invalid or missing API key' }
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
'/api/v1/mcp/analysis/{analysisId}/status': {
|
|
991
|
+
get: {
|
|
992
|
+
operationId: 'getAnalysisStatus',
|
|
993
|
+
summary: 'Check analysis progress',
|
|
994
|
+
description: 'Poll this endpoint to check the status of a running analysis through the 8-stage pipeline. Returns progress percentage, current phase (Loading Context → Extracting Data → Identifying Parties → Researching → AI Analysis → Instant Swarm™ → Generating Email → Synthesizing Results), and results when complete.',
|
|
995
|
+
tags: ['Contract Analysis'],
|
|
996
|
+
parameters: [
|
|
997
|
+
{
|
|
998
|
+
name: 'analysisId',
|
|
999
|
+
in: 'path',
|
|
1000
|
+
required: true,
|
|
1001
|
+
schema: { type: 'string' },
|
|
1002
|
+
description: 'The analysis ID returned from analyzeContract'
|
|
1003
|
+
}
|
|
1004
|
+
],
|
|
1005
|
+
responses: {
|
|
1006
|
+
'200': {
|
|
1007
|
+
description: 'Analysis status retrieved',
|
|
1008
|
+
content: {
|
|
1009
|
+
'application/json': {
|
|
1010
|
+
schema: {
|
|
1011
|
+
type: 'object',
|
|
1012
|
+
properties: {
|
|
1013
|
+
success: { type: 'boolean' },
|
|
1014
|
+
analysisId: { type: 'string' },
|
|
1015
|
+
status: { type: 'string', enum: ['queued', 'processing', 'completed', 'failed'] },
|
|
1016
|
+
progress: { type: 'number', description: 'Progress percentage (0-100)' },
|
|
1017
|
+
currentPhase: { type: 'string', description: 'Current analysis phase from the 8-stage pipeline' },
|
|
1018
|
+
phases: { type: 'array', items: { type: 'string' }, description: 'Completed phases: phase1_context, phase2_extraction, phase3_parties, phase4_research, phase5_analysis, phase6_instantswarm, phase7_email, phase8_synthesis' },
|
|
1019
|
+
createdAt: { type: 'string', format: 'date-time' },
|
|
1020
|
+
completedAt: { type: 'string', format: 'date-time' }
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
'404': { description: 'Analysis not found' }
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
},
|
|
1030
|
+
'/api/v1/mcp/analysis/{analysisId}/full': {
|
|
1031
|
+
get: {
|
|
1032
|
+
operationId: 'getFullAnalysis',
|
|
1033
|
+
summary: 'Get complete analysis results',
|
|
1034
|
+
description: 'Retrieve the full analysis results including all section analyses, risks, favorability scores, and recommendations. Only available after analysis completes.',
|
|
1035
|
+
tags: ['Contract Analysis'],
|
|
1036
|
+
parameters: [
|
|
1037
|
+
{
|
|
1038
|
+
name: 'analysisId',
|
|
1039
|
+
in: 'path',
|
|
1040
|
+
required: true,
|
|
1041
|
+
schema: { type: 'string' }
|
|
1042
|
+
}
|
|
1043
|
+
],
|
|
1044
|
+
responses: {
|
|
1045
|
+
'200': {
|
|
1046
|
+
description: 'Full analysis results',
|
|
1047
|
+
content: {
|
|
1048
|
+
'application/json': {
|
|
1049
|
+
schema: {
|
|
1050
|
+
type: 'object',
|
|
1051
|
+
properties: {
|
|
1052
|
+
success: { type: 'boolean' },
|
|
1053
|
+
analysisId: { type: 'string' },
|
|
1054
|
+
status: { type: 'string' },
|
|
1055
|
+
analysis: { type: 'object', description: 'Section-by-section analysis' },
|
|
1056
|
+
risks: { type: 'array', items: { type: 'object' }, description: 'Identified risks' },
|
|
1057
|
+
favorability: { type: 'object', description: 'Favorability scores' },
|
|
1058
|
+
recommendations: { type: 'array', items: { type: 'object' } }
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
'400': { description: 'Analysis not yet complete' },
|
|
1065
|
+
'404': { description: 'Analysis not found' }
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
'/api/v1/mcp/sac/chat': {
|
|
1070
|
+
post: {
|
|
1071
|
+
operationId: 'askSac',
|
|
1072
|
+
summary: 'Ask the Supreme AI Co-Counsel',
|
|
1073
|
+
description: 'Ask questions about an analyzed contract. SAC (Supreme AI Co-Counsel) has full context of the contract and all analysis results. Great for clarifying risks, understanding clauses, or getting negotiation advice.',
|
|
1074
|
+
tags: ['SAC Chat'],
|
|
1075
|
+
requestBody: {
|
|
1076
|
+
required: true,
|
|
1077
|
+
content: {
|
|
1078
|
+
'application/json': {
|
|
1079
|
+
schema: {
|
|
1080
|
+
type: 'object',
|
|
1081
|
+
required: ['analysis_id', 'question'],
|
|
1082
|
+
properties: {
|
|
1083
|
+
analysis_id: { type: 'string', description: 'Analysis ID from a completed analysis' },
|
|
1084
|
+
question: { type: 'string', description: 'Your question about the contract' },
|
|
1085
|
+
context: { type: 'string', description: 'Optional additional context for the question' }
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
responses: {
|
|
1092
|
+
'200': {
|
|
1093
|
+
description: 'SAC response',
|
|
1094
|
+
content: {
|
|
1095
|
+
'application/json': {
|
|
1096
|
+
schema: {
|
|
1097
|
+
type: 'object',
|
|
1098
|
+
properties: {
|
|
1099
|
+
success: { type: 'boolean' },
|
|
1100
|
+
answer: { type: 'string', description: 'SAC response to your question' },
|
|
1101
|
+
citations: { type: 'array', items: { type: 'string' }, description: 'Relevant clause citations' },
|
|
1102
|
+
confidence: { type: 'number', description: 'Confidence score (0-1)' },
|
|
1103
|
+
analysisContext: { type: 'object', description: 'Summary of analysis context used' }
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
'404': { description: 'Analysis not found' }
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
'/api/v1/mcp/redline/generate': {
|
|
1114
|
+
post: {
|
|
1115
|
+
operationId: 'generateRedline',
|
|
1116
|
+
summary: 'Generate redlined document',
|
|
1117
|
+
description: 'Generate a redlined Word document with real OOXML Track Changes (w:ins, w:del) applied directly to the original document. Returns a download URL for the redlined DOCX.',
|
|
1118
|
+
tags: ['Document Generation'],
|
|
1119
|
+
requestBody: {
|
|
1120
|
+
required: true,
|
|
1121
|
+
content: {
|
|
1122
|
+
'application/json': {
|
|
1123
|
+
schema: {
|
|
1124
|
+
type: 'object',
|
|
1125
|
+
required: ['analysis_id'],
|
|
1126
|
+
properties: {
|
|
1127
|
+
analysis_id: { type: 'string' },
|
|
1128
|
+
include_comments: { type: 'boolean', default: true, description: 'Include rationale comments in margins' },
|
|
1129
|
+
format: { type: 'string', enum: ['docx', 'pdf'], default: 'docx' }
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
responses: {
|
|
1136
|
+
'200': {
|
|
1137
|
+
description: 'Redline generated successfully',
|
|
1138
|
+
content: {
|
|
1139
|
+
'application/json': {
|
|
1140
|
+
schema: {
|
|
1141
|
+
type: 'object',
|
|
1142
|
+
properties: {
|
|
1143
|
+
success: { type: 'boolean' },
|
|
1144
|
+
analysisId: { type: 'string' },
|
|
1145
|
+
downloadUrl: { type: 'string', format: 'uri', description: 'URL to download the redlined document' },
|
|
1146
|
+
format: { type: 'string' },
|
|
1147
|
+
expiresAt: { type: 'string', format: 'date-time', description: 'URL expiration time' }
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
'404': { description: 'Analysis not found' }
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
'/api/v1/mcp/email/generate': {
|
|
1158
|
+
post: {
|
|
1159
|
+
operationId: 'generateNegotiationEmail',
|
|
1160
|
+
summary: 'Generate negotiation email',
|
|
1161
|
+
description: 'Generate a professional negotiation email to send to the counterparty, explaining requested changes and their rationale.',
|
|
1162
|
+
tags: ['Document Generation'],
|
|
1163
|
+
requestBody: {
|
|
1164
|
+
required: true,
|
|
1165
|
+
content: {
|
|
1166
|
+
'application/json': {
|
|
1167
|
+
schema: {
|
|
1168
|
+
type: 'object',
|
|
1169
|
+
required: ['analysis_id'],
|
|
1170
|
+
properties: {
|
|
1171
|
+
analysis_id: { type: 'string' },
|
|
1172
|
+
tone: { type: 'string', enum: ['professional', 'collaborative', 'firm'], default: 'professional' },
|
|
1173
|
+
recipient_name: { type: 'string', description: 'Name of the recipient' },
|
|
1174
|
+
sender_name: { type: 'string', description: 'Name of the sender' }
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
responses: {
|
|
1181
|
+
'200': {
|
|
1182
|
+
description: 'Email draft generated',
|
|
1183
|
+
content: {
|
|
1184
|
+
'application/json': {
|
|
1185
|
+
schema: {
|
|
1186
|
+
type: 'object',
|
|
1187
|
+
properties: {
|
|
1188
|
+
success: { type: 'boolean' },
|
|
1189
|
+
analysisId: { type: 'string' },
|
|
1190
|
+
email: {
|
|
1191
|
+
type: 'object',
|
|
1192
|
+
properties: {
|
|
1193
|
+
subject: { type: 'string' },
|
|
1194
|
+
body: { type: 'string' },
|
|
1195
|
+
keyPoints: { type: 'array', items: { type: 'string' } }
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
tone: { type: 'string' }
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
'404': { description: 'Analysis not found' }
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
'/api/v1/mcp/analysis/{analysisId}/clause/{clauseType}': {
|
|
1209
|
+
get: {
|
|
1210
|
+
operationId: 'extractClause',
|
|
1211
|
+
summary: 'Extract and analyze specific clause',
|
|
1212
|
+
description: 'Extract a specific clause type from an analyzed contract. Returns the clause text, risk analysis, and suggested improvements.',
|
|
1213
|
+
tags: ['Clause Extraction'],
|
|
1214
|
+
parameters: [
|
|
1215
|
+
{
|
|
1216
|
+
name: 'analysisId',
|
|
1217
|
+
in: 'path',
|
|
1218
|
+
required: true,
|
|
1219
|
+
schema: { type: 'string' }
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
name: 'clauseType',
|
|
1223
|
+
in: 'path',
|
|
1224
|
+
required: true,
|
|
1225
|
+
schema: {
|
|
1226
|
+
type: 'string',
|
|
1227
|
+
enum: ['indemnification', 'liability', 'limitation_of_liability', 'confidentiality', 'ip', 'intellectual_property', 'termination', 'term', 'payment', 'data_protection', 'privacy', 'warranty', 'warranties', 'force_majeure', 'assignment', 'insurance', 'sla', 'dpa']
|
|
1228
|
+
},
|
|
1229
|
+
description: 'Type of clause to extract'
|
|
1230
|
+
}
|
|
1231
|
+
],
|
|
1232
|
+
responses: {
|
|
1233
|
+
'200': {
|
|
1234
|
+
description: 'Clause extracted successfully',
|
|
1235
|
+
content: {
|
|
1236
|
+
'application/json': {
|
|
1237
|
+
schema: {
|
|
1238
|
+
type: 'object',
|
|
1239
|
+
properties: {
|
|
1240
|
+
success: { type: 'boolean' },
|
|
1241
|
+
analysisId: { type: 'string' },
|
|
1242
|
+
clauseType: { type: 'string' },
|
|
1243
|
+
clause: {
|
|
1244
|
+
type: 'object',
|
|
1245
|
+
properties: {
|
|
1246
|
+
text: { type: 'string' },
|
|
1247
|
+
analysis: { type: 'object' },
|
|
1248
|
+
favorability: { type: 'object' },
|
|
1249
|
+
risks: { type: 'array', items: { type: 'object' } },
|
|
1250
|
+
recommendations: { type: 'array', items: { type: 'string' } }
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
'404': { description: 'Analysis or clause not found' }
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
'/api/v1/mcp/playbook/compare': {
|
|
1263
|
+
post: {
|
|
1264
|
+
operationId: 'comparePlaybook',
|
|
1265
|
+
summary: 'Compare against playbook',
|
|
1266
|
+
description: 'Compare an analyzed contract against a company playbook to identify deviations from pre-approved positions.',
|
|
1267
|
+
tags: ['Playbook'],
|
|
1268
|
+
requestBody: {
|
|
1269
|
+
required: true,
|
|
1270
|
+
content: {
|
|
1271
|
+
'application/json': {
|
|
1272
|
+
schema: {
|
|
1273
|
+
type: 'object',
|
|
1274
|
+
required: ['analysis_id', 'playbook_id'],
|
|
1275
|
+
properties: {
|
|
1276
|
+
analysis_id: { type: 'string' },
|
|
1277
|
+
playbook_id: { type: 'string', description: 'ID of the playbook to compare against' }
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
responses: {
|
|
1284
|
+
'200': {
|
|
1285
|
+
description: 'Playbook comparison results',
|
|
1286
|
+
content: {
|
|
1287
|
+
'application/json': {
|
|
1288
|
+
schema: {
|
|
1289
|
+
type: 'object',
|
|
1290
|
+
properties: {
|
|
1291
|
+
success: { type: 'boolean' },
|
|
1292
|
+
analysisId: { type: 'string' },
|
|
1293
|
+
playbookId: { type: 'string' },
|
|
1294
|
+
playbookName: { type: 'string' },
|
|
1295
|
+
comparison: {
|
|
1296
|
+
type: 'object',
|
|
1297
|
+
properties: {
|
|
1298
|
+
complianceScore: { type: 'number' },
|
|
1299
|
+
deviations: { type: 'array', items: { type: 'object' } },
|
|
1300
|
+
totalRulesChecked: { type: 'integer' },
|
|
1301
|
+
passedRules: { type: 'integer' },
|
|
1302
|
+
failedRules: { type: 'integer' }
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
'404': { description: 'Analysis or playbook not found' }
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
'/api/v1/mcp/playbooks': {
|
|
1315
|
+
get: {
|
|
1316
|
+
operationId: 'listPlaybooks',
|
|
1317
|
+
summary: 'List available playbooks',
|
|
1318
|
+
description: 'Get a list of all playbooks available for the authenticated user.',
|
|
1319
|
+
tags: ['Playbook'],
|
|
1320
|
+
responses: {
|
|
1321
|
+
'200': {
|
|
1322
|
+
description: 'List of playbooks',
|
|
1323
|
+
content: {
|
|
1324
|
+
'application/json': {
|
|
1325
|
+
schema: {
|
|
1326
|
+
type: 'object',
|
|
1327
|
+
properties: {
|
|
1328
|
+
success: { type: 'boolean' },
|
|
1329
|
+
playbooks: {
|
|
1330
|
+
type: 'array',
|
|
1331
|
+
items: {
|
|
1332
|
+
type: 'object',
|
|
1333
|
+
properties: {
|
|
1334
|
+
id: { type: 'string' },
|
|
1335
|
+
name: { type: 'string' },
|
|
1336
|
+
description: { type: 'string' },
|
|
1337
|
+
createdAt: { type: 'string', format: 'date-time' }
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
count: { type: 'integer' }
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
'/api/v1/mcp/playbook/{playbookId}': {
|
|
1351
|
+
get: {
|
|
1352
|
+
operationId: 'getPlaybook',
|
|
1353
|
+
summary: 'Get playbook details',
|
|
1354
|
+
description: 'Retrieve full details of a specific playbook including all rules and sections.',
|
|
1355
|
+
tags: ['Playbook'],
|
|
1356
|
+
parameters: [
|
|
1357
|
+
{
|
|
1358
|
+
name: 'playbookId',
|
|
1359
|
+
in: 'path',
|
|
1360
|
+
required: true,
|
|
1361
|
+
schema: { type: 'string' }
|
|
1362
|
+
}
|
|
1363
|
+
],
|
|
1364
|
+
responses: {
|
|
1365
|
+
'200': {
|
|
1366
|
+
description: 'Playbook details',
|
|
1367
|
+
content: {
|
|
1368
|
+
'application/json': {
|
|
1369
|
+
schema: {
|
|
1370
|
+
type: 'object',
|
|
1371
|
+
properties: {
|
|
1372
|
+
success: { type: 'boolean' },
|
|
1373
|
+
playbook: {
|
|
1374
|
+
type: 'object',
|
|
1375
|
+
properties: {
|
|
1376
|
+
id: { type: 'string' },
|
|
1377
|
+
name: { type: 'string' },
|
|
1378
|
+
description: { type: 'string' },
|
|
1379
|
+
rules: { type: 'array', items: { type: 'object' } },
|
|
1380
|
+
sections: { type: 'array', items: { type: 'object' } },
|
|
1381
|
+
createdAt: { type: 'string', format: 'date-time' },
|
|
1382
|
+
updatedAt: { type: 'string', format: 'date-time' }
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
},
|
|
1390
|
+
'404': { description: 'Playbook not found' }
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
components: {
|
|
1396
|
+
securitySchemes: {
|
|
1397
|
+
ApiKeyAuth: {
|
|
1398
|
+
type: 'apiKey',
|
|
1399
|
+
in: 'header',
|
|
1400
|
+
name: 'x-api-key',
|
|
1401
|
+
description: 'BitsBound API key (format: sk_live_xxxxx). Get yours at https://account.bitsbound.com/api-keys'
|
|
1402
|
+
},
|
|
1403
|
+
BearerAuth: {
|
|
1404
|
+
type: 'http',
|
|
1405
|
+
scheme: 'bearer',
|
|
1406
|
+
description: 'Alternative: Authorization: Bearer sk_live_xxxxx'
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
tags: [
|
|
1411
|
+
{ name: 'Contract Analysis', description: 'Upload contracts and retrieve analysis results' },
|
|
1412
|
+
{ name: 'SAC Chat', description: 'Interactive Q&A with Supreme AI Co-Counsel' },
|
|
1413
|
+
{ name: 'Document Generation', description: 'Generate redlined documents and negotiation emails' },
|
|
1414
|
+
{ name: 'Clause Extraction', description: 'Extract and analyze specific contract clauses' },
|
|
1415
|
+
{ name: 'Playbook', description: 'Company playbook management and comparison' }
|
|
1416
|
+
]
|
|
1417
|
+
} as const;
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* Returns the OpenAPI spec as a JSON string, formatted for readability.
|
|
1421
|
+
*/
|
|
1422
|
+
export function getOpenApiSpecJson(): string {
|
|
1423
|
+
return JSON.stringify(OPENAPI_SPEC, null, 2);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
1427
|
+
// README Documentation 'R_DVT_G_D_README' - Comprehensive MCP Server Documentation
|
|
1428
|
+
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* BitsBound MCP Server - Comprehensive Documentation
|
|
1432
|
+
*
|
|
1433
|
+
* This documentation is exported as a constant to comply with NNF (No New Files) policy.
|
|
1434
|
+
* Access programmatically: `import { README_DOCUMENTATION } from './types/...Types.js'`
|
|
1435
|
+
*/
|
|
1436
|
+
export const README_DOCUMENTATION = `# BitsBound MCP Server
|
|
1437
|
+
|
|
1438
|
+
AI-powered contract analysis for Claude, ChatGPT, and other AI platforms via the Model Context Protocol (MCP).
|
|
1439
|
+
|
|
1440
|
+
## Overview
|
|
1441
|
+
|
|
1442
|
+
BitsBound MCP Server enables AI assistants to analyze contracts, generate redlined documents with real Track Changes,
|
|
1443
|
+
and provide clause-by-clause risk analysis. It connects AI platforms to BitsBound's 8-Stage TCA Pipeline:
|
|
1444
|
+
|
|
1445
|
+
1. **Loading Context** - Parsing deal context and contract structure
|
|
1446
|
+
2. **Extracting Data** - Running 13 deterministic extraction scripts
|
|
1447
|
+
3. **Identifying Parties** - AI identifying customer and vendor positions
|
|
1448
|
+
4. **Researching** - Running 8 parallel research analyzers
|
|
1449
|
+
5. **AI Analysis** - Running 18+ parallel AI analyzers (The Swarm)
|
|
1450
|
+
6. **Instant Swarm™** - Parallel redlining across all sections (optional)
|
|
1451
|
+
7. **Generating Email** - Drafting negotiation email with redline summary (optional)
|
|
1452
|
+
8. **Synthesizing Results** - Generating final recommendations and scores
|
|
1453
|
+
|
|
1454
|
+
## Quick Start
|
|
1455
|
+
|
|
1456
|
+
### For Claude Desktop (MCP Protocol)
|
|
1457
|
+
|
|
1458
|
+
Add to your Claude Desktop configuration (\`~/Library/Application Support/Claude/claude_desktop_config.json\`):
|
|
1459
|
+
|
|
1460
|
+
\`\`\`json
|
|
1461
|
+
{
|
|
1462
|
+
"mcpServers": {
|
|
1463
|
+
"bitsbound": {
|
|
1464
|
+
"command": "npx",
|
|
1465
|
+
"args": ["-y", "@bitsbound/mcp-server"],
|
|
1466
|
+
"env": {
|
|
1467
|
+
"BITSBOUND_API_KEY": "sk_live_your_api_key_here"
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
\`\`\`
|
|
1473
|
+
|
|
1474
|
+
### For ChatGPT (Custom GPT Actions)
|
|
1475
|
+
|
|
1476
|
+
1. Create a new Custom GPT at https://chat.openai.com/gpts/editor
|
|
1477
|
+
2. Go to "Configure" → "Create new action"
|
|
1478
|
+
3. Import OpenAPI schema from: \`https://bitsbound-saas-backend-mxb1.onrender.com/api/v1/mcp/openapi.json\`
|
|
1479
|
+
4. Set Authentication: API Key, Header name: \`x-api-key\`
|
|
1480
|
+
5. Enter your BitsBound API key
|
|
1481
|
+
|
|
1482
|
+
### For Other AI Platforms (REST API)
|
|
1483
|
+
|
|
1484
|
+
Use the REST API directly with your API key:
|
|
1485
|
+
|
|
1486
|
+
\`\`\`bash
|
|
1487
|
+
curl -X POST https://bitsbound-saas-backend-mxb1.onrender.com/api/v1/mcp/analyze \\
|
|
1488
|
+
-H "Content-Type: application/json" \\
|
|
1489
|
+
-H "x-api-key: sk_live_your_api_key_here" \\
|
|
1490
|
+
-d '{
|
|
1491
|
+
"contract_content": "<base64-encoded-docx>",
|
|
1492
|
+
"filename": "master-service-agreement.docx",
|
|
1493
|
+
"analysis_type": "full"
|
|
1494
|
+
}'
|
|
1495
|
+
\`\`\`
|
|
1496
|
+
|
|
1497
|
+
## Getting Your API Key
|
|
1498
|
+
|
|
1499
|
+
1. Sign up at https://account.bitsbound.com
|
|
1500
|
+
2. Subscribe to a plan (Starter: $25/mo, Professional: $125/mo, Team: $625/mo)
|
|
1501
|
+
3. Navigate to API Keys section
|
|
1502
|
+
4. Generate a new API key (format: \`sk_live_xxxxx\`)
|
|
1503
|
+
|
|
1504
|
+
## Available Tools
|
|
1505
|
+
|
|
1506
|
+
### process_contract
|
|
1507
|
+
Upload a contract (DOCX format, base64 encoded) for full 8-stage pipeline processing.
|
|
1508
|
+
|
|
1509
|
+
**Parameters:**
|
|
1510
|
+
- \`docxBase64\` (required): Base64-encoded DOCX file
|
|
1511
|
+
- \`fileName\` (required): Original filename
|
|
1512
|
+
- \`analysisDepth\`: 'quick' (~5 min), 'standard' (~15 min), 'deep' (~30 min)
|
|
1513
|
+
- \`perspective\`: 'customer', 'vendor', or 'neutral'
|
|
1514
|
+
|
|
1515
|
+
**Returns:** Analysis ID for tracking progress
|
|
1516
|
+
|
|
1517
|
+
### get_analysis_status
|
|
1518
|
+
Check the status of a running or completed analysis.
|
|
1519
|
+
|
|
1520
|
+
**Parameters:**
|
|
1521
|
+
- \`analysisId\` (required): The analysis ID from process_contract
|
|
1522
|
+
|
|
1523
|
+
**Returns:** Progress percentage, current phase, results when complete
|
|
1524
|
+
|
|
1525
|
+
### ask_sac
|
|
1526
|
+
Ask the Supreme AI Co-Counsel questions about an analyzed contract.
|
|
1527
|
+
|
|
1528
|
+
**Parameters:**
|
|
1529
|
+
- \`analysisId\` (required): Analysis ID of a completed analysis
|
|
1530
|
+
- \`question\` (required): Your question about the contract
|
|
1531
|
+
- \`includeClauseCitations\`: Include specific clause citations (default: true)
|
|
1532
|
+
|
|
1533
|
+
**Returns:** AI response with clause citations and follow-up suggestions
|
|
1534
|
+
|
|
1535
|
+
### generate_redline
|
|
1536
|
+
Generate a redlined Word document with real OOXML Track Changes.
|
|
1537
|
+
|
|
1538
|
+
**Parameters:**
|
|
1539
|
+
- \`analysisId\` (required): Analysis ID of a completed analysis
|
|
1540
|
+
- \`aggressiveness\`: 1-5 (1=conservative, 5=aggressive)
|
|
1541
|
+
- \`includeComments\`: Include rationale comments (default: true)
|
|
1542
|
+
|
|
1543
|
+
**Returns:** Base64-encoded redlined DOCX with download URL
|
|
1544
|
+
|
|
1545
|
+
### generate_negotiation_email
|
|
1546
|
+
Generate a professional negotiation email to send to counterparty.
|
|
1547
|
+
|
|
1548
|
+
**Parameters:**
|
|
1549
|
+
- \`analysisId\` (required): Analysis ID of a completed analysis
|
|
1550
|
+
- \`tone\`: 'collaborative', 'firm', or 'aggressive'
|
|
1551
|
+
- \`recipientRole\`: Role of the recipient (e.g., "General Counsel")
|
|
1552
|
+
|
|
1553
|
+
**Returns:** Subject line, email body, and key points
|
|
1554
|
+
|
|
1555
|
+
### extract_clause
|
|
1556
|
+
Extract and analyze a specific clause type from an analyzed contract.
|
|
1557
|
+
|
|
1558
|
+
**Parameters:**
|
|
1559
|
+
- \`analysisId\` (required): Analysis ID of a completed analysis
|
|
1560
|
+
- \`clauseType\` (required): One of: 'indemnification', 'liability', 'ip', 'termination',
|
|
1561
|
+
'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment'
|
|
1562
|
+
|
|
1563
|
+
**Returns:** Clause text, risk level, analysis, suggested improvements
|
|
1564
|
+
|
|
1565
|
+
### compare_playbook
|
|
1566
|
+
Compare an analyzed contract against a company playbook.
|
|
1567
|
+
|
|
1568
|
+
**Parameters:**
|
|
1569
|
+
- \`analysisId\` (required): Analysis ID of a completed analysis
|
|
1570
|
+
- \`playbookId\` (required): ID of the playbook to compare against
|
|
1571
|
+
|
|
1572
|
+
**Returns:** Deviations, compliance score, required approvals
|
|
1573
|
+
|
|
1574
|
+
## Example Workflow
|
|
1575
|
+
|
|
1576
|
+
\`\`\`
|
|
1577
|
+
User: "Analyze this Master Service Agreement and tell me the key risks"
|
|
1578
|
+
|
|
1579
|
+
Claude/ChatGPT:
|
|
1580
|
+
1. Calls process_contract with the uploaded DOCX (with Instant Swarm + Email enabled)
|
|
1581
|
+
2. Polls get_analysis_status to watch progress through 8 stages:
|
|
1582
|
+
- Loading Context → Extracting Data → Identifying Parties → Researching
|
|
1583
|
+
- AI Analysis → Instant Swarm™ → Generating Email → Synthesizing Results
|
|
1584
|
+
3. Reads results showing favorability score (e.g., 42% - Vendor Favorable)
|
|
1585
|
+
4. Identifies top risks: unlimited liability, broad IP assignment, weak SLA
|
|
1586
|
+
5. User can ask follow-up questions via ask_sac (SAC has full contract context)
|
|
1587
|
+
6. Downloads the redlined DOCX with real Track Changes (from Instant Swarm™)
|
|
1588
|
+
7. Reviews the auto-generated negotiation email (from Email Generator)
|
|
1589
|
+
\`\`\`
|
|
1590
|
+
|
|
1591
|
+
## Environment Variables
|
|
1592
|
+
|
|
1593
|
+
| Variable | Required | Description |
|
|
1594
|
+
|----------|----------|-------------|
|
|
1595
|
+
| BITSBOUND_API_KEY | Yes | Your API key (sk_live_xxxxx) |
|
|
1596
|
+
| BITSBOUND_API_URL | No | API URL (default: production server) |
|
|
1597
|
+
|
|
1598
|
+
## API Endpoints (REST)
|
|
1599
|
+
|
|
1600
|
+
All endpoints require \`x-api-key\` header or \`Authorization: Bearer <key>\` header.
|
|
1601
|
+
|
|
1602
|
+
| Method | Endpoint | Description |
|
|
1603
|
+
|--------|----------|-------------|
|
|
1604
|
+
| POST | /api/v1/mcp/analyze | Start contract analysis |
|
|
1605
|
+
| GET | /api/v1/mcp/analysis/:id/status | Get analysis status |
|
|
1606
|
+
| GET | /api/v1/mcp/analysis/:id/full | Get full analysis results |
|
|
1607
|
+
| POST | /api/v1/mcp/sac/chat | Ask SAC questions |
|
|
1608
|
+
| POST | /api/v1/mcp/redline/generate | Generate redlined DOCX |
|
|
1609
|
+
| POST | /api/v1/mcp/email/generate | Generate negotiation email |
|
|
1610
|
+
| GET | /api/v1/mcp/analysis/:id/clause/:type | Extract specific clause |
|
|
1611
|
+
| POST | /api/v1/mcp/playbook/compare | Compare against playbook |
|
|
1612
|
+
| GET | /api/v1/mcp/playbook/:id | Get playbook details |
|
|
1613
|
+
| GET | /api/v1/mcp/playbooks | List available playbooks |
|
|
1614
|
+
| GET | /api/v1/mcp/openapi.json | OpenAPI specification (public) |
|
|
1615
|
+
|
|
1616
|
+
## Pricing
|
|
1617
|
+
|
|
1618
|
+
BitsBound uses token-based pricing. Analysis costs vary by depth:
|
|
1619
|
+
- Quick analysis: ~100K tokens (~$2.50)
|
|
1620
|
+
- Standard analysis: ~500K tokens (~$12.50)
|
|
1621
|
+
- Deep analysis: ~1M tokens (~$25.00)
|
|
1622
|
+
|
|
1623
|
+
Subscription tiers include monthly token allocations:
|
|
1624
|
+
- Starter ($25/mo): 1M tokens
|
|
1625
|
+
- Professional ($125/mo): 5M tokens
|
|
1626
|
+
- Team ($625/mo): 25M tokens
|
|
1627
|
+
- Enterprise ($3,750/mo): 150M tokens
|
|
1628
|
+
|
|
1629
|
+
## Legal Disclaimer
|
|
1630
|
+
|
|
1631
|
+
BitsBound provides AI-assisted contract analysis tools for legal professionals. All outputs are
|
|
1632
|
+
preliminary drafts requiring attorney review and do not constitute legal advice. BitsBound is
|
|
1633
|
+
not a law firm and does not provide legal advice.
|
|
1634
|
+
|
|
1635
|
+
## Support
|
|
1636
|
+
|
|
1637
|
+
- Website: https://bitsbound.com
|
|
1638
|
+
- Documentation: https://bitsbound.com/docs
|
|
1639
|
+
- API Keys: https://account.bitsbound.com/api-keys
|
|
1640
|
+
- Support: support@bitsbound.com
|
|
1641
|
+
|
|
1642
|
+
## License
|
|
1643
|
+
|
|
1644
|
+
MIT License - see package.json for details.
|
|
1645
|
+
|
|
1646
|
+
---
|
|
1647
|
+
|
|
1648
|
+
Built by Rob Taylor, Esq. - Corporate attorney and full-stack AI engineer.
|
|
1649
|
+
` as const;
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Returns the README documentation for display or export.
|
|
1653
|
+
*/
|
|
1654
|
+
export function getReadmeDocumentation(): string {
|
|
1655
|
+
return README_DOCUMENTATION;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
/*
|
|
1660
|
+
######################################################################################################################################################################################################
|
|
1661
|
+
*/
|
|
1662
|
+
// #### LOCAL 'R_DVT_L', i.e. FUNCTION/PROVISION LEVEL DVTs
|
|
1663
|
+
/*
|
|
1664
|
+
######################################################################################################################################################################################################
|
|
1665
|
+
*/
|
|
1666
|
+
|
|
1667
|
+
// No local types needed - all types are global for MCP protocol
|