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