@bitsbound/mcp-server 1.0.13 → 1.1.1

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.
@@ -3,130 +3,87 @@
3
3
  ////////////////////////////////////////
4
4
  // NO NEW FILES!!!!!!!!!
5
5
  ////////////////////////////////////////
6
- export const DEFAULT_API_URL = 'https://bitsbound-saas-backend-mxb1.onrender.com';
6
+ export const DEFAULT_API_URL = 'https://bitsbound-contract-backend.onrender.com';
7
7
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
8
8
  // MCP Tool Definitions 'R_DVT_G_D_ToolDefs' - Tool schemas for MCP protocol
9
9
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
10
10
  export const TOOL_DEFINITIONS = {
11
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
12
+ // CORE TOOLS - Simplified 3-tool interface for Claude Code Plugin Marketplace
13
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
11
14
  process_contract: {
12
15
  name: 'process_contract',
13
- description: `Process a contract through the full 8-stage BitsBound pipeline.
14
-
15
- ⚠️ BEFORE CALLING THIS TOOL: You MUST gather the following information from the user:
16
-
17
- **REQUIRED - Ask the user:**
18
- 1. representingParty: "Are you representing the Customer (buyer) or Vendor (seller)?"
19
- 2. aggressivenessLevel: "On a scale of 1-10, how aggressive should the redlines be? (1=very conciliatory, 5=balanced, 10=very aggressive)"
16
+ description: `Process a contract through BitsBound's full analysis pipeline. Returns partner-level redlined DOCX with Track Changes, negotiation email, and risk analysis.
20
17
 
21
- **RECOMMENDED - Ask if not obvious:**
22
- 3. paperOwnership: "Did the counterparty draft this contract (their paper) or did you draft it (our paper)?"
23
- 4. dealValue + dealValueCurrency: "What's the estimated deal value?"
24
- 5. industry: "What industry is this contract for?"
25
- 6. additionalContext: "Any special context about this deal or relationship I should know?"
18
+ **REQUIRED INPUTS (ask the user):**
19
+ 1. File path to the DOCX contract
20
+ 2. Contract type: saas, ma, vc, employment, nda, equipment, commercial-lease, professional-services, or miscellaneous
21
+ 3. Who you represent: customer/vendor (saas), buyer/seller (ma), investor/founder (vc), etc.
22
+ 4. Aggressiveness level: 1-10 (1=conciliatory, 5=balanced, 10=aggressive)
26
23
 
27
- **FOR EMAIL GENERATION - Ask:**
28
- 7. emailRecipient: "Should I generate a negotiation email to send to the counterparty?"
29
- 8. If yes: recipientName, senderName (your name), any additionalContext for the email tone
24
+ **OPTIONAL:** dealValue, additionalContext, emailRecipient info
30
25
 
31
- After gathering this context, call the tool. The response includes "importantNote" with when to check back (~45 min).
32
-
33
- Pipeline: (1) Context Loading, (2) Data Extraction, (3) Party Identification, (4) Research, (5) AI Analysis with 18+ analyzers, (6) Instant Swarm™ redlining, (7) Email Generation, (8) Synthesis.`,
26
+ Analysis takes ~25-35 minutes. Response includes 'checkBackTime' for when to check status.`,
34
27
  inputSchema: {
35
28
  type: 'object',
36
29
  properties: {
37
- // ══════════════════════════════════════════════════════════════════════
38
- // FILE INPUT (one required)
39
- // ══════════════════════════════════════════════════════════════════════
40
30
  filePath: {
41
31
  type: 'string',
42
- 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.'
32
+ description: 'RECOMMENDED: Absolute path to DOCX file (e.g., "/Users/john/Documents/contract.docx"). Server reads file directly.'
43
33
  },
44
34
  docxBase64: {
45
35
  type: 'string',
46
- description: 'Alternative: The contract document already encoded as base64 string (DOCX format). Use filePath instead if possible.'
36
+ description: 'Alternative: Base64-encoded DOCX content. Use filePath instead when possible.'
47
37
  },
48
38
  fileName: {
49
39
  type: 'string',
50
- description: 'Original filename of the document. If using filePath, this is extracted automatically.'
40
+ description: 'Original filename. Auto-extracted if using filePath.'
41
+ },
42
+ contractVertical: {
43
+ type: 'string',
44
+ enum: ['saas', 'ma', 'vc', 'employment', 'nda', 'equipment-lease', 'equipment-financing', 'security-agreement', 'loan', 'commercial-lease', 'professional-services', 'miscellaneous'],
45
+ description: 'Contract type. Determines analyzers and party options.'
51
46
  },
52
- // ══════════════════════════════════════════════════════════════════════
53
- // DEAL CONTEXT (ask user for these!)
54
- // ══════════════════════════════════════════════════════════════════════
55
47
  representingParty: {
56
48
  type: 'string',
57
- enum: ['customer', 'vendor', 'neutral'],
58
- description: 'REQUIRED: Who are you representing? customer=buyer, vendor=seller, neutral=balanced review'
49
+ description: 'Who you represent: saas(customer/vendor), ma(buyer/seller), vc(investor/founder), employment(employer/employee), nda(disclosing-party/receiving-party), equipment-lease(lessee/lessor), equipment-financing(debtor/secured-party), security-agreement(debtor/secured-party), commercial-lease(tenant/landlord), professional-services(client/service-provider), loan(borrower/lender)'
50
+ },
51
+ aggressivenessLevel: {
52
+ type: 'number',
53
+ minimum: 1,
54
+ maximum: 10,
55
+ description: 'Redline aggressiveness 1-10. Default: 5'
59
56
  },
60
57
  dealValue: {
61
58
  type: 'number',
62
- description: 'Estimated deal value / annual contract value (ACV). Helps calibrate risk thresholds.'
59
+ description: 'Optional: Deal value for risk calibration'
63
60
  },
64
61
  dealValueCurrency: {
65
62
  type: 'string',
66
63
  enum: ['USD', 'EUR', 'GBP', 'CAD', 'AUD'],
67
- description: 'Currency for deal value. Default: USD'
68
- },
69
- industry: {
70
- type: 'string',
71
- enum: ['technology', 'healthcare', 'financial', 'retail', 'manufacturing', 'professional', 'media', 'education', 'government', 'other'],
72
- description: 'Industry context for analysis. Affects regulatory considerations and benchmarks.'
64
+ description: 'Currency. Default: USD'
73
65
  },
74
66
  additionalContext: {
75
67
  type: 'string',
76
- description: 'Free-form context about the deal: relationship history, priorities, concerns, red lines, etc.'
68
+ description: 'Optional: Deal context, priorities, relationship notes'
77
69
  },
78
70
  paperOwnership: {
79
71
  type: 'string',
80
72
  enum: ['their-paper', 'our-paper'],
81
- description: 'Who drafted the contract? their-paper=counterparty drafted (default, full analysis), our-paper=we drafted (review their markup only)'
73
+ description: 'Who drafted? their-paper=counterparty (default), our-paper=we drafted'
82
74
  },
83
- // ══════════════════════════════════════════════════════════════════════
84
- // SAC/REDLINE SETTINGS
85
- // ══════════════════════════════════════════════════════════════════════
86
- aggressivenessLevel: {
87
- type: 'number',
88
- minimum: 1,
89
- maximum: 10,
90
- description: 'IMPORTANT: Redline aggressiveness 1-10. 1=very conciliatory (accept most terms), 5=balanced (default), 10=very aggressive (push hard on everything)'
91
- },
92
- enableAutoSwarm: {
93
- type: 'boolean',
94
- description: 'Enable parallel 17-section SAC analysis for comprehensive redlines. Default: true'
95
- },
96
- analysisDepth: {
97
- type: 'string',
98
- enum: ['quick', 'standard', 'deep'],
99
- description: 'Analysis depth: quick (~10 min), standard (~30 min), deep (~45 min). Default: standard'
100
- },
101
- // ══════════════════════════════════════════════════════════════════════
102
- // EMAIL GENERATION
103
- // ══════════════════════════════════════════════════════════════════════
104
75
  enableEmailGenerator: {
105
76
  type: 'boolean',
106
- description: 'Generate a negotiation email summarizing redlines? Default: true'
107
- },
108
- emailRecipient: {
109
- type: 'string',
110
- enum: ['client', 'counterparty', 'none'],
111
- description: 'Who should the email be addressed to? counterparty=send to other side, client=internal summary, none=skip email'
77
+ description: 'Generate negotiation email? Default: true'
112
78
  },
113
79
  emailContext: {
114
80
  type: 'object',
115
- description: 'Additional context for email generation',
81
+ description: 'Email context',
116
82
  properties: {
117
- recipientName: { type: 'string', description: 'Name of email recipient (e.g., "John Smith")' },
118
- recipientEmail: { type: 'string', description: 'Email address of recipient' },
119
- senderName: { type: 'string', description: 'Your name (the sender)' },
120
- additionalContext: { type: 'string', description: 'Tone/relationship notes for the email (e.g., "We have a good relationship with this vendor")' }
83
+ recipientName: { type: 'string' },
84
+ senderName: { type: 'string' },
85
+ additionalContext: { type: 'string' }
121
86
  }
122
- },
123
- // ══════════════════════════════════════════════════════════════════════
124
- // DEPRECATED (use representingParty instead)
125
- // ══════════════════════════════════════════════════════════════════════
126
- perspective: {
127
- type: 'string',
128
- enum: ['customer', 'vendor', 'neutral'],
129
- description: 'DEPRECATED: Use representingParty instead'
130
87
  }
131
88
  },
132
89
  required: []
@@ -138,276 +95,39 @@ Pipeline: (1) Context Loading, (2) Data Extraction, (3) Party Identification, (4
138
95
  },
139
96
  get_analysis_status: {
140
97
  name: 'get_analysis_status',
141
- 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 with CLICKABLE BROWSER LINKS: (1) redlinedDocxUrl - presigned URL to download the redlined DOCX (works directly in browser, valid 1 hour), (2) negotiationEmailUrl - URL to view the negotiation email in browser. ALWAYS display both URLs to the user as clickable links.',
142
- inputSchema: {
143
- type: 'object',
144
- properties: {
145
- analysisId: {
146
- type: 'string',
147
- description: 'The processing ID returned from process_contract'
148
- }
149
- },
150
- required: ['analysisId']
151
- },
152
- annotations: {
153
- readOnlyHint: true
154
- }
155
- },
156
- ask_sac: {
157
- name: 'ask_sac',
158
- 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.',
159
- inputSchema: {
160
- type: 'object',
161
- properties: {
162
- analysisId: {
163
- type: 'string',
164
- description: 'The analysis ID of a completed analysis'
165
- },
166
- question: {
167
- type: 'string',
168
- description: 'Your question about the contract'
169
- },
170
- includeClauseCitations: {
171
- type: 'boolean',
172
- description: 'Include specific clause citations in the response. Default: true'
173
- }
174
- },
175
- required: ['analysisId', 'question']
176
- },
177
- annotations: {
178
- readOnlyHint: true
179
- }
180
- },
181
- generate_redline: {
182
- name: 'generate_redline',
183
- 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.',
184
- inputSchema: {
185
- type: 'object',
186
- properties: {
187
- analysisId: {
188
- type: 'string',
189
- description: 'The analysis ID of a completed analysis'
190
- },
191
- aggressiveness: {
192
- type: 'number',
193
- enum: [1, 2, 3, 4, 5],
194
- description: 'How aggressive the redlines should be (1=conservative, 5=aggressive). Default: 3'
195
- },
196
- includeComments: {
197
- type: 'boolean',
198
- description: 'Include rationale comments in Word margins. Default: true'
199
- }
200
- },
201
- required: ['analysisId']
202
- },
203
- annotations: {
204
- readOnlyHint: false,
205
- destructiveHint: false
206
- }
207
- },
208
- generate_negotiation_email: {
209
- name: 'generate_negotiation_email',
210
- description: 'Generate a professional negotiation email to send to the counterparty, explaining requested changes and their rationale.',
98
+ description: `Check analysis progress. When complete, returns:
99
+ - redlinedDocxDownloadUrl: Presigned URL to download redlined DOCX (valid 1 hour)
100
+ - negotiationEmailHtml/PlainText: Ready-to-send negotiation email
101
+ - favorabilityScore, topRisks, negotiationPriorities
102
+
103
+ ALWAYS display download URLs as clickable links when analysis completes.`,
211
104
  inputSchema: {
212
105
  type: 'object',
213
106
  properties: {
214
107
  analysisId: {
215
108
  type: 'string',
216
- description: 'The analysis ID of a completed analysis'
217
- },
218
- tone: {
219
- type: 'string',
220
- enum: ['collaborative', 'firm', 'aggressive'],
221
- description: 'Tone of the email. Default: collaborative'
222
- },
223
- recipientRole: {
224
- type: 'string',
225
- description: 'Role of the recipient (e.g., "General Counsel", "Sales Rep", "Procurement"). Helps tailor the message.'
109
+ description: 'Analysis ID from process_contract'
226
110
  }
227
111
  },
228
112
  required: ['analysisId']
229
113
  },
230
- annotations: {
231
- readOnlyHint: false,
232
- destructiveHint: false
233
- }
234
- },
235
- extract_clause: {
236
- name: 'extract_clause',
237
- description: 'Extract and analyze a specific clause type from an analyzed contract. Returns the clause text, risk analysis, and suggested improvements.',
238
- inputSchema: {
239
- type: 'object',
240
- properties: {
241
- analysisId: {
242
- type: 'string',
243
- description: 'The analysis ID of a completed analysis'
244
- },
245
- clauseType: {
246
- type: 'string',
247
- enum: ['indemnification', 'liability', 'ip', 'termination', 'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment'],
248
- description: 'The type of clause to extract'
249
- }
250
- },
251
- required: ['analysisId', 'clauseType']
252
- },
253
- annotations: {
254
- readOnlyHint: true
255
- }
256
- },
257
- compare_playbook: {
258
- name: 'compare_playbook',
259
- description: 'Compare an analyzed contract against a company playbook to identify deviations from pre-approved positions and required approvals.',
260
- inputSchema: {
261
- type: 'object',
262
- properties: {
263
- analysisId: {
264
- type: 'string',
265
- description: 'The analysis ID of a completed analysis'
266
- },
267
- playbookId: {
268
- type: 'string',
269
- description: 'The ID of the playbook to compare against'
270
- }
271
- },
272
- required: ['analysisId', 'playbookId']
273
- },
274
- annotations: {
275
- readOnlyHint: true
276
- }
277
- },
278
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
279
- // INSTANT SWARM - Parallel N-Section Redlining (spawns N agents for N sections, max parallelization)
280
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
281
- instant_swarm: {
282
- name: 'instant_swarm',
283
- 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.',
284
- inputSchema: {
285
- type: 'object',
286
- properties: {
287
- analysisId: {
288
- type: 'string',
289
- description: 'The analysis ID from a completed process_contract call. The analysis provides contract context for each section.'
290
- },
291
- aggressivenessLevel: {
292
- type: 'number',
293
- enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
294
- description: 'How aggressive the redlines should be (1=conservative, 10=very aggressive). Recommended: 5-7 for balanced approach.'
295
- },
296
- partyPosition: {
297
- type: 'string',
298
- enum: ['customer', 'vendor'],
299
- description: 'Which side are you on? "customer" = you are buying/receiving services. "vendor" = you are selling/providing services.'
300
- },
301
- ourPartyName: {
302
- type: 'string',
303
- description: 'Your company name as it should appear in redlines (e.g., "Acme Corp").'
304
- },
305
- counterpartyName: {
306
- type: 'string',
307
- description: 'The other party\'s name (e.g., "Vendor Inc").'
308
- },
309
- targetSections: {
310
- type: 'array',
311
- items: { type: 'string' },
312
- 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'
313
- }
314
- },
315
- required: ['analysisId', 'aggressivenessLevel', 'partyPosition']
316
- },
317
- annotations: {
318
- readOnlyHint: false,
319
- destructiveHint: false
320
- }
321
- },
322
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
323
- // QUICK TOOLS - Immediate analysis without waiting for full pipeline
324
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
325
- quick_scan: {
326
- name: 'quick_scan',
327
- 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.',
328
- inputSchema: {
329
- type: 'object',
330
- properties: {
331
- contractText: {
332
- type: 'string',
333
- description: 'The contract text (plain text or base64-encoded DOCX). For DOCX files, base64 encode the file contents.'
334
- },
335
- fileName: {
336
- type: 'string',
337
- description: 'Optional filename for context (e.g., "Acme_MSA_2024.docx")'
338
- },
339
- perspective: {
340
- type: 'string',
341
- enum: ['customer', 'vendor', 'neutral'],
342
- description: 'Analyze from customer (buyer), vendor (seller), or neutral perspective. Default: customer'
343
- }
344
- },
345
- required: ['contractText']
346
- },
347
- annotations: {
348
- readOnlyHint: true
349
- }
350
- },
351
- ask_clause: {
352
- name: 'ask_clause',
353
- 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?"',
354
- inputSchema: {
355
- type: 'object',
356
- properties: {
357
- contractText: {
358
- type: 'string',
359
- description: 'The contract text (plain text or base64-encoded DOCX)'
360
- },
361
- question: {
362
- type: 'string',
363
- description: 'Your question about the contract (e.g., "What is the liability cap?", "Is there an auto-renewal clause?")'
364
- },
365
- clauseType: {
366
- type: 'string',
367
- enum: ['indemnification', 'liability', 'ip', 'termination', 'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment', 'any'],
368
- description: 'Optional: Focus on a specific clause type, or "any" to search the whole contract. Default: any'
369
- }
370
- },
371
- required: ['contractText', 'question']
372
- },
373
- annotations: {
374
- readOnlyHint: true
375
- }
376
- },
377
- check_dealbreakers: {
378
- name: 'check_dealbreakers',
379
- 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.',
380
- inputSchema: {
381
- type: 'object',
382
- properties: {
383
- contractText: {
384
- type: 'string',
385
- description: 'The contract text (plain text or base64-encoded DOCX)'
386
- },
387
- playbookId: {
388
- type: 'string',
389
- description: 'Optional: Specific playbook to check against. If not provided, uses your default company playbook.'
390
- }
391
- },
392
- required: ['contractText']
393
- },
394
114
  annotations: {
395
115
  readOnlyHint: true
396
116
  }
397
117
  },
398
118
  download_file: {
399
119
  name: 'download_file',
400
- 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.',
120
+ description: 'Download a file from BitsBound (redlined DOCX, analysis JSON). Returns base64 content or saves to local path.',
401
121
  inputSchema: {
402
122
  type: 'object',
403
123
  properties: {
404
124
  downloadUrl: {
405
125
  type: 'string',
406
- description: 'The download URL from get_analysis_status deliverables (redlinedDocxDownloadUrl)'
126
+ description: 'Download URL from get_analysis_status deliverables'
407
127
  },
408
128
  saveToPath: {
409
129
  type: 'string',
410
- description: 'Optional: Local file path to save the downloaded file. If not provided, returns base64 content.'
130
+ description: 'Optional: Local path to save file. If omitted, returns base64.'
411
131
  }
412
132
  },
413
133
  required: ['downloadUrl']
@@ -424,7 +144,7 @@ export const RESOURCE_DEFINITIONS = {
424
144
  analysis: {
425
145
  uriTemplate: 'bitsbound://analysis/{analysisId}',
426
146
  name: 'Contract Analysis',
427
- description: 'Full analysis results including all 17 analyzer outputs, risk scores, and recommendations',
147
+ description: 'Full analysis results including all analyzer outputs (varies by contract type), risk scores, and recommendations',
428
148
  mimeType: 'application/json'
429
149
  },
430
150
  playbook: {
@@ -454,33 +174,21 @@ export const RESOURCE_DEFINITIONS = {
454
174
  * - O: User experiences a smooth, guided contract analysis flow
455
175
  */
456
176
  export const PROMPT_DEFINITIONS = {
177
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
178
+ // CORE PROMPTS - Simplified 2-prompt interface matching 3-tool architecture
179
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
457
180
  process_contract: {
458
181
  name: 'process_contract',
459
- description: '📄 Process Contract - Upload a DOCX and get partner-level redlines with Track Changes, risk analysis, and a negotiation email',
182
+ description: 'Analyze Contract - Upload a DOCX and get partner-level redlines with Track Changes, risk analysis, and a negotiation email',
460
183
  arguments: []
461
184
  },
462
- quick_scan: {
463
- name: 'quick_scan',
464
- description: ' Quick Risk Scan - Get instant risk assessment in 5-10 seconds without waiting for full analysis',
465
- arguments: []
466
- },
467
- ask_about_contract: {
468
- name: 'ask_about_contract',
469
- description: '💬 Ask About a Clause - Upload a contract and ask specific questions about any clause or term',
470
- arguments: []
471
- },
472
- check_dealbreakers: {
473
- name: 'check_dealbreakers',
474
- description: '🚨 Check Dealbreakers - Quick pass/fail check against your playbook rules',
475
- arguments: []
476
- },
477
- continue_analysis: {
478
- name: 'continue_analysis',
479
- description: '📊 Continue Previous Analysis - Resume working with a previously analyzed contract',
185
+ check_analysis: {
186
+ name: 'check_analysis',
187
+ description: 'Check Analysis Status - Check progress or download results from a running/completed analysis',
480
188
  arguments: [
481
189
  {
482
190
  name: 'analysisId',
483
- description: 'The analysis ID from a previous contract analysis',
191
+ description: 'The analysis ID from process_contract',
484
192
  required: true
485
193
  }
486
194
  ]
@@ -492,94 +200,54 @@ export const PROMPT_DEFINITIONS = {
492
200
  * NOTE: MCP spec requires content to be { type: 'text', text: string } not plain string
493
201
  */
494
202
  export const PROMPT_MESSAGES = {
203
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
204
+ // CORE PROMPT MESSAGES - Simplified to match 3-tool architecture
205
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
495
206
  process_contract: [
496
207
  {
497
208
  role: 'user',
498
209
  content: { type: 'text', text: `I want to analyze a contract using BitsBound.
499
210
 
500
- Please help me by:
501
- 1. Ask me for the contract file. I will provide EITHER:
502
- - A full file path (e.g., /Users/john/Documents/contract.docx)
503
- - An uploaded DOCX file
504
- 2. IMPORTANT FILE PATH HANDLING:
505
- - If I provide a FILE PATH: Pass the path DIRECTLY to the 'process_contract' tool's 'filePath' parameter. Do NOT use copy_file_user_to_claude or any other file operations - the MCP server reads the file directly from the path.
506
- - If I upload a file: Use the base64 content with 'docxBase64' parameter.
507
- 3. CRITICAL: After starting the analysis, DO NOT POLL AUTOMATICALLY. The response will include 'checkBackTime' and 'importantNote' - tell me exactly when to come back and ask you to check the status. I will manually ask you to check when I'm ready.
508
- 4. When I ask you to check status (using 'get_analysis_status'), show me:
509
- - Current progress percentage
510
- - If complete, ALWAYS provide these clickable links (they work directly in browser):
511
- * REDLINED DOCX: Display the 'redlinedDocxUrl' as a clickable download link
512
- * NEGOTIATION EMAIL: Display the 'negotiationEmailUrl' as a clickable link to view in browser
513
- - Also show: favorability score, top 5 risks, negotiation priorities
514
-
515
- The analysis typically takes ~25 minutes. Wait for me to ask you to check - do not poll automatically.` }
516
- }
517
- ],
518
- quick_scan: [
519
- {
520
- role: 'user',
521
- content: { type: 'text', text: `I want a quick risk scan of a contract (5-10 seconds, not the full analysis).
522
-
523
- Please help me by:
524
- 1. Asking me to upload or paste the contract
525
- 2. Use the BitsBound 'quick_scan' tool for instant analysis
526
- 3. Show me:
527
- - Contract type and parties
528
- - Favorability estimate
529
- - Top concerns by severity
530
- - Key terms (liability cap, term, payment, etc.)
531
- - Whether I should do a full analysis
532
-
533
- This is for initial triage - not a substitute for full attorney review.` }
534
- }
535
- ],
536
- ask_about_contract: [
537
- {
538
- role: 'user',
539
- content: { type: 'text', text: `I want to ask questions about specific clauses in a contract.
211
+ Please help me by gathering this information:
540
212
 
541
- Please help me by:
542
- 1. Asking me to upload or paste the contract (or relevant sections)
543
- 2. Ask what I want to know (e.g., "What is the liability cap?", "Is there an auto-renewal?")
544
- 3. Use the BitsBound 'ask_clause' tool for instant answers
545
- 4. Include the actual clause text and any risk assessment
213
+ 1. CONTRACT TYPE:
214
+ - saas, ma, vc, employment, nda, equipment, commercial-lease, professional-services, or miscellaneous
546
215
 
547
- I can ask multiple questions - this is a Q&A session about the contract.` }
548
- }
549
- ],
550
- check_dealbreakers: [
551
- {
552
- role: 'user',
553
- content: { type: 'text', text: `I want to check a contract for dealbreakers against my company's playbook.
554
-
555
- Please help me by:
556
- 1. Asking me to upload or paste the contract
557
- 2. Use the BitsBound 'check_dealbreakers' tool
558
- 3. Show me:
559
- - Pass/fail result
560
- - Any dealbreaker issues found
561
- - Missing required clauses
562
- - Who needs to approve if we proceed
563
-
564
- This is a quick pre-screen before spending time on full analysis.` }
216
+ 2. CONTRACT FILE:
217
+ - File path (e.g., /Users/john/Documents/contract.docx) - preferred
218
+ - Or upload the DOCX directly
219
+
220
+ 3. WHO I REPRESENT:
221
+ - saas: customer or vendor
222
+ - ma: buyer or seller
223
+ - vc: investor or founder
224
+ - (etc. based on contract type)
225
+
226
+ 4. AGGRESSIVENESS (1-10):
227
+ - 1 = very conciliatory, 5 = balanced, 10 = very aggressive
228
+
229
+ Then call the 'process_contract' tool. Analysis takes ~25-35 minutes.
230
+ The response includes 'checkBackTime' - tell me when to check back.
231
+ Do NOT poll automatically - wait for me to ask.` }
565
232
  }
566
233
  ],
567
- continue_analysis: [
234
+ check_analysis: [
568
235
  {
569
236
  role: 'user',
570
- content: { type: 'text', text: `I want to continue working with a previously analyzed contract.
571
-
572
- I have an analysis ID from a previous BitsBound analysis. Please:
573
- 1. Ask me for the analysis ID
574
- 2. Use 'get_analysis_status' to check if it's complete
575
- 3. If complete, I can:
576
- - Ask questions with 'ask_sac' (SAC has full context)
577
- - Generate a redlined document with 'generate_redline'
578
- - Generate a negotiation email with 'generate_negotiation_email'
579
- - Extract specific clauses with 'extract_clause'
580
- - Compare against a playbook with 'compare_playbook'
581
-
582
- What would you like to do with this analysis?` }
237
+ content: { type: 'text', text: `I want to check on a contract analysis.
238
+
239
+ Analysis ID: {analysisId}
240
+
241
+ Please use 'get_analysis_status' and show me:
242
+ - Current progress percentage
243
+ - If complete, provide:
244
+ * CLICKABLE download link for the redlined DOCX
245
+ * Negotiation email content
246
+ * Favorability score
247
+ * Top risks
248
+ * Negotiation priorities
249
+
250
+ If I need to download the file, use 'download_file' with the URL from the status response.` }
583
251
  }
584
252
  ]
585
253
  };
@@ -613,7 +281,7 @@ export const OPENAPI_SPEC = {
613
281
  },
614
282
  servers: [
615
283
  {
616
- url: 'https://bitsbound-saas-backend-mxb1.onrender.com',
284
+ url: 'https://bitsbound-contract-backend.onrender.com',
617
285
  description: 'Production server'
618
286
  }
619
287
  ],
@@ -1162,7 +830,7 @@ Add to your Claude Desktop configuration (\`~/Library/Application Support/Claude
1162
830
 
1163
831
  1. Create a new Custom GPT at https://chat.openai.com/gpts/editor
1164
832
  2. Go to "Configure" → "Create new action"
1165
- 3. Import OpenAPI schema from: \`https://bitsbound-saas-backend-mxb1.onrender.com/api/v1/mcp/openapi.json\`
833
+ 3. Import OpenAPI schema from: \`https://bitsbound-contract-backend.onrender.com/api/v1/mcp/openapi.json\`
1166
834
  4. Set Authentication: API Key, Header name: \`x-api-key\`
1167
835
  5. Enter your BitsBound API key
1168
836
 
@@ -1171,7 +839,7 @@ Add to your Claude Desktop configuration (\`~/Library/Application Support/Claude
1171
839
  Use the REST API directly with your API key:
1172
840
 
1173
841
  \`\`\`bash
1174
- curl -X POST https://bitsbound-saas-backend-mxb1.onrender.com/api/v1/mcp/analyze \\
842
+ curl -X POST https://bitsbound-contract-backend.onrender.com/api/v1/mcp/analyze \\
1175
843
  -H "Content-Type: application/json" \\
1176
844
  -H "x-api-key: sk_live_your_api_key_here" \\
1177
845
  -d '{
@@ -1261,18 +929,19 @@ Compare an analyzed contract against a company playbook.
1261
929
  ## Example Workflow
1262
930
 
1263
931
  \`\`\`
1264
- User: "Analyze this Master Service Agreement and tell me the key risks"
932
+ User: "Analyze this contract and tell me the key risks"
1265
933
 
1266
934
  Claude/ChatGPT:
1267
- 1. Calls process_contract with the uploaded DOCX (with Instant Swarm + Email enabled)
1268
- 2. Polls get_analysis_status to watch progress through 8 stages:
935
+ 1. Identifies the contract type (MSA, M&A, VC term sheet, employment, NDA, etc.)
936
+ 2. Calls process_contract with the uploaded DOCX (with Instant Swarm + Email enabled)
937
+ 3. Polls get_analysis_status to watch progress through 8 stages:
1269
938
  - Loading Context → Extracting Data → Identifying Parties → Researching
1270
939
  - AI Analysis → Instant Swarm™ → Generating Email → Synthesizing Results
1271
- 3. Reads results showing favorability score (e.g., 42% - Vendor Favorable)
1272
- 4. Identifies top risks: unlimited liability, broad IP assignment, weak SLA
1273
- 5. User can ask follow-up questions via ask_sac (SAC has full contract context)
1274
- 6. Downloads the redlined DOCX with real Track Changes (from Instant Swarm™)
1275
- 7. Reviews the auto-generated negotiation email (from Email Generator)
940
+ 4. Reads results showing favorability score (e.g., 42% - Vendor Favorable)
941
+ 5. Identifies top risks based on contract type and activated analyzers
942
+ 6. User can ask follow-up questions via ask_sac (SAC has full contract context)
943
+ 7. Downloads the redlined DOCX with real Track Changes (from Instant Swarm™)
944
+ 8. Reviews the auto-generated negotiation email (from Email Generator)
1276
945
  \`\`\`
1277
946
 
1278
947
  ## Environment Variables