@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.
@@ -48,12 +48,48 @@ export interface McpServerConfig {
48
48
  readonly BITSBOUND_API_KEY: string;
49
49
  }
50
50
 
51
- export const DEFAULT_API_URL = 'https://bitsbound-saas-backend-mxb1.onrender.com';
51
+ export const DEFAULT_API_URL = 'https://bitsbound-contract-backend.onrender.com';
52
52
 
53
53
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
54
54
  // Tool Input Schemas 'R_DVT_G_D_ToolInputs' - What AI platforms send to each tool
55
55
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
56
56
 
57
+ // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
58
+ // Contract Vertical Types 'R_DVT_G_D_ContractVerticals'
59
+ // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
60
+
61
+ /**
62
+ * ContractVertical - The type of contract being analyzed
63
+ * D: Each vertical has its own analyzer set and representing party options
64
+ *
65
+ * Verticals and their Representing Party options:
66
+ * - saas: Customer (Buyer) | Vendor (Seller)
67
+ * - ma: Buyer | Seller
68
+ * - vc: Investor | Founder/Company
69
+ * - employment: Employer | Employee
70
+ * - nda: Disclosing Party | Receiving Party
71
+ * - equipment-lease: Lessee | Lessor
72
+ * - equipment-financing: Debtor | Secured Party
73
+ * - security-agreement: Debtor | Secured Party
74
+ * - loan: Borrower | Lender
75
+ * - commercial-lease: Tenant | Landlord
76
+ * - professional-services: Client | Service Provider
77
+ * - miscellaneous: Party A | Party B (let AI decide best classification)
78
+ */
79
+ export type ContractVertical =
80
+ | 'saas' // MSA, SaaS Agreement, Subscription Agreement
81
+ | 'ma' // APA, SPA, Merger Agreement
82
+ | 'vc' // SAFE, Convertible Note, Series A/B/C
83
+ | 'employment' // Offer Letter, Employment Agreement
84
+ | 'nda' // Mutual NDA, Unilateral NDA
85
+ | 'equipment-lease' // Equipment Lease (lessee/lessor)
86
+ | 'equipment-financing' // Equipment Financing (debtor/secured-party)
87
+ | 'security-agreement' // Security Agreement (debtor/secured-party)
88
+ | 'loan' // Loan Agreement (borrower/lender)
89
+ | 'commercial-lease' // Commercial Lease, Office Lease
90
+ | 'professional-services' // SOW, Consulting Agreement
91
+ | 'miscellaneous'; // Unknown/other (AI classifies)
92
+
57
93
  export interface AnalyzeContractInput {
58
94
  readonly filePath?: string; // RECOMMENDED: Absolute path to DOCX file on disk
59
95
  readonly docxBase64?: string; // Alternative: Base64-encoded DOCX content
@@ -61,10 +97,15 @@ export interface AnalyzeContractInput {
61
97
  readonly analysisDepth?: 'quick' | 'standard' | 'deep';
62
98
  readonly perspective?: 'customer' | 'vendor' | 'neutral'; // DEPRECATED: Use representingParty
63
99
 
100
+ // ════════════════════════════════════════════════════════════════════════════
101
+ // CONTRACT TYPE (determines analyzer set and representing party options)
102
+ // ════════════════════════════════════════════════════════════════════════════
103
+ readonly contractVertical?: ContractVertical; // What type of contract? (REQUIRED)
104
+
64
105
  // ════════════════════════════════════════════════════════════════════════════
65
106
  // DEAL CONTEXT (matches Customer Account dashboard Start Analysis form)
66
107
  // ════════════════════════════════════════════════════════════════════════════
67
- readonly representingParty?: 'customer' | 'vendor' | 'neutral'; // Who is the AI representing? (REQUIRED)
108
+ readonly representingParty?: string; // Who is the AI representing? (contextual per vertical)
68
109
  readonly dealValue?: number; // Estimated deal value / ACV in specified currency
69
110
  readonly dealValueCurrency?: 'USD' | 'EUR' | 'GBP' | 'CAD' | 'AUD'; // Currency (default: USD)
70
111
  readonly industry?: string; // Industry: technology, healthcare, financial, retail, manufacturing, professional, media, education, government, other
@@ -382,7 +423,7 @@ export interface CheckDealbreakersOutput {
382
423
  }
383
424
 
384
425
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
385
- // BitsBound SaaS API Types 'R_DVT_G_D_ApiTypes' - For calling the backend
426
+ // BitsBound API Types 'R_DVT_G_D_ApiTypes' - For calling the backend
386
427
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
387
428
 
388
429
  export interface BitsBoundApiResponse<T> {
@@ -433,129 +474,83 @@ export interface SectionAnalysis {
433
474
  // ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
434
475
 
435
476
  export const TOOL_DEFINITIONS = {
477
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
478
+ // CORE TOOLS - Simplified 3-tool interface for Claude Code Plugin Marketplace
479
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
480
+
436
481
  process_contract: {
437
482
  name: 'process_contract',
438
- description: `Process a contract through the full 8-stage BitsBound pipeline.
439
-
440
- ⚠️ BEFORE CALLING THIS TOOL: You MUST gather the following information from the user:
441
-
442
- **REQUIRED - Ask the user:**
443
- 1. representingParty: "Are you representing the Customer (buyer) or Vendor (seller)?"
444
- 2. aggressivenessLevel: "On a scale of 1-10, how aggressive should the redlines be? (1=very conciliatory, 5=balanced, 10=very aggressive)"
483
+ description: `Process a contract through BitsBound's full analysis pipeline. Returns partner-level redlined DOCX with Track Changes, negotiation email, and risk analysis.
445
484
 
446
- **RECOMMENDED - Ask if not obvious:**
447
- 3. paperOwnership: "Did the counterparty draft this contract (their paper) or did you draft it (our paper)?"
448
- 4. dealValue + dealValueCurrency: "What's the estimated deal value?"
449
- 5. industry: "What industry is this contract for?"
450
- 6. additionalContext: "Any special context about this deal or relationship I should know?"
485
+ **REQUIRED INPUTS (ask the user):**
486
+ 1. File path to the DOCX contract
487
+ 2. Contract type: saas, ma, vc, employment, nda, equipment, commercial-lease, professional-services, or miscellaneous
488
+ 3. Who you represent: customer/vendor (saas), buyer/seller (ma), investor/founder (vc), etc.
489
+ 4. Aggressiveness level: 1-10 (1=conciliatory, 5=balanced, 10=aggressive)
451
490
 
452
- **FOR EMAIL GENERATION - Ask:**
453
- 7. emailRecipient: "Should I generate a negotiation email to send to the counterparty?"
454
- 8. If yes: recipientName, senderName (your name), any additionalContext for the email tone
491
+ **OPTIONAL:** dealValue, additionalContext, emailRecipient info
455
492
 
456
- After gathering this context, call the tool. The response includes "importantNote" with when to check back (~45 min).
457
-
458
- 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.`,
493
+ Analysis takes ~25-35 minutes. Response includes 'checkBackTime' for when to check status.`,
459
494
  inputSchema: {
460
495
  type: 'object',
461
496
  properties: {
462
- // ══════════════════════════════════════════════════════════════════════
463
- // FILE INPUT (one required)
464
- // ══════════════════════════════════════════════════════════════════════
465
497
  filePath: {
466
498
  type: 'string',
467
- 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.'
499
+ description: 'RECOMMENDED: Absolute path to DOCX file (e.g., "/Users/john/Documents/contract.docx"). Server reads file directly.'
468
500
  },
469
501
  docxBase64: {
470
502
  type: 'string',
471
- description: 'Alternative: The contract document already encoded as base64 string (DOCX format). Use filePath instead if possible.'
503
+ description: 'Alternative: Base64-encoded DOCX content. Use filePath instead when possible.'
472
504
  },
473
505
  fileName: {
474
506
  type: 'string',
475
- description: 'Original filename of the document. If using filePath, this is extracted automatically.'
507
+ description: 'Original filename. Auto-extracted if using filePath.'
508
+ },
509
+ contractVertical: {
510
+ type: 'string',
511
+ enum: ['saas', 'ma', 'vc', 'employment', 'nda', 'equipment-lease', 'equipment-financing', 'security-agreement', 'loan', 'commercial-lease', 'professional-services', 'miscellaneous'],
512
+ description: 'Contract type. Determines analyzers and party options.'
476
513
  },
477
-
478
- // ══════════════════════════════════════════════════════════════════════
479
- // DEAL CONTEXT (ask user for these!)
480
- // ══════════════════════════════════════════════════════════════════════
481
514
  representingParty: {
482
515
  type: 'string',
483
- enum: ['customer', 'vendor', 'neutral'],
484
- description: 'REQUIRED: Who are you representing? customer=buyer, vendor=seller, neutral=balanced review'
516
+ 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)'
517
+ },
518
+ aggressivenessLevel: {
519
+ type: 'number',
520
+ minimum: 1,
521
+ maximum: 10,
522
+ description: 'Redline aggressiveness 1-10. Default: 5'
485
523
  },
486
524
  dealValue: {
487
525
  type: 'number',
488
- description: 'Estimated deal value / annual contract value (ACV). Helps calibrate risk thresholds.'
526
+ description: 'Optional: Deal value for risk calibration'
489
527
  },
490
528
  dealValueCurrency: {
491
529
  type: 'string',
492
530
  enum: ['USD', 'EUR', 'GBP', 'CAD', 'AUD'],
493
- description: 'Currency for deal value. Default: USD'
494
- },
495
- industry: {
496
- type: 'string',
497
- enum: ['technology', 'healthcare', 'financial', 'retail', 'manufacturing', 'professional', 'media', 'education', 'government', 'other'],
498
- description: 'Industry context for analysis. Affects regulatory considerations and benchmarks.'
531
+ description: 'Currency. Default: USD'
499
532
  },
500
533
  additionalContext: {
501
534
  type: 'string',
502
- description: 'Free-form context about the deal: relationship history, priorities, concerns, red lines, etc.'
535
+ description: 'Optional: Deal context, priorities, relationship notes'
503
536
  },
504
537
  paperOwnership: {
505
538
  type: 'string',
506
539
  enum: ['their-paper', 'our-paper'],
507
- description: 'Who drafted the contract? their-paper=counterparty drafted (default, full analysis), our-paper=we drafted (review their markup only)'
540
+ description: 'Who drafted? their-paper=counterparty (default), our-paper=we drafted'
508
541
  },
509
-
510
- // ══════════════════════════════════════════════════════════════════════
511
- // SAC/REDLINE SETTINGS
512
- // ══════════════════════════════════════════════════════════════════════
513
- aggressivenessLevel: {
514
- type: 'number',
515
- minimum: 1,
516
- maximum: 10,
517
- description: 'IMPORTANT: Redline aggressiveness 1-10. 1=very conciliatory (accept most terms), 5=balanced (default), 10=very aggressive (push hard on everything)'
518
- },
519
- enableAutoSwarm: {
520
- type: 'boolean',
521
- description: 'Enable parallel 17-section SAC analysis for comprehensive redlines. Default: true'
522
- },
523
- analysisDepth: {
524
- type: 'string',
525
- enum: ['quick', 'standard', 'deep'],
526
- description: 'Analysis depth: quick (~10 min), standard (~30 min), deep (~45 min). Default: standard'
527
- },
528
-
529
- // ══════════════════════════════════════════════════════════════════════
530
- // EMAIL GENERATION
531
- // ══════════════════════════════════════════════════════════════════════
532
542
  enableEmailGenerator: {
533
543
  type: 'boolean',
534
- description: 'Generate a negotiation email summarizing redlines? Default: true'
535
- },
536
- emailRecipient: {
537
- type: 'string',
538
- enum: ['client', 'counterparty', 'none'],
539
- description: 'Who should the email be addressed to? counterparty=send to other side, client=internal summary, none=skip email'
544
+ description: 'Generate negotiation email? Default: true'
540
545
  },
541
546
  emailContext: {
542
547
  type: 'object',
543
- description: 'Additional context for email generation',
548
+ description: 'Email context',
544
549
  properties: {
545
- recipientName: { type: 'string', description: 'Name of email recipient (e.g., "John Smith")' },
546
- recipientEmail: { type: 'string', description: 'Email address of recipient' },
547
- senderName: { type: 'string', description: 'Your name (the sender)' },
548
- additionalContext: { type: 'string', description: 'Tone/relationship notes for the email (e.g., "We have a good relationship with this vendor")' }
550
+ recipientName: { type: 'string' },
551
+ senderName: { type: 'string' },
552
+ additionalContext: { type: 'string' }
549
553
  }
550
- },
551
-
552
- // ══════════════════════════════════════════════════════════════════════
553
- // DEPRECATED (use representingParty instead)
554
- // ══════════════════════════════════════════════════════════════════════
555
- perspective: {
556
- type: 'string',
557
- enum: ['customer', 'vendor', 'neutral'],
558
- description: 'DEPRECATED: Use representingParty instead'
559
554
  }
560
555
  },
561
556
  required: []
@@ -568,270 +563,22 @@ Pipeline: (1) Context Loading, (2) Data Extraction, (3) Party Identification, (4
568
563
 
569
564
  get_analysis_status: {
570
565
  name: 'get_analysis_status',
571
- 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.',
572
- inputSchema: {
573
- type: 'object',
574
- properties: {
575
- analysisId: {
576
- type: 'string',
577
- description: 'The processing ID returned from process_contract'
578
- }
579
- },
580
- required: ['analysisId']
581
- },
582
- annotations: {
583
- readOnlyHint: true
584
- }
585
- },
566
+ description: `Check analysis progress. When complete, returns:
567
+ - redlinedDocxDownloadUrl: Presigned URL to download redlined DOCX (valid 1 hour)
568
+ - negotiationEmailHtml/PlainText: Ready-to-send negotiation email
569
+ - favorabilityScore, topRisks, negotiationPriorities
586
570
 
587
- ask_sac: {
588
- name: 'ask_sac',
589
- 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.',
571
+ ALWAYS display download URLs as clickable links when analysis completes.`,
590
572
  inputSchema: {
591
573
  type: 'object',
592
574
  properties: {
593
575
  analysisId: {
594
576
  type: 'string',
595
- description: 'The analysis ID of a completed analysis'
596
- },
597
- question: {
598
- type: 'string',
599
- description: 'Your question about the contract'
600
- },
601
- includeClauseCitations: {
602
- type: 'boolean',
603
- description: 'Include specific clause citations in the response. Default: true'
604
- }
605
- },
606
- required: ['analysisId', 'question']
607
- },
608
- annotations: {
609
- readOnlyHint: true
610
- }
611
- },
612
-
613
- generate_redline: {
614
- name: 'generate_redline',
615
- 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.',
616
- inputSchema: {
617
- type: 'object',
618
- properties: {
619
- analysisId: {
620
- type: 'string',
621
- description: 'The analysis ID of a completed analysis'
622
- },
623
- aggressiveness: {
624
- type: 'number',
625
- enum: [1, 2, 3, 4, 5],
626
- description: 'How aggressive the redlines should be (1=conservative, 5=aggressive). Default: 3'
627
- },
628
- includeComments: {
629
- type: 'boolean',
630
- description: 'Include rationale comments in Word margins. Default: true'
631
- }
632
- },
633
- required: ['analysisId']
634
- },
635
- annotations: {
636
- readOnlyHint: false,
637
- destructiveHint: false
638
- }
639
- },
640
-
641
- generate_negotiation_email: {
642
- name: 'generate_negotiation_email',
643
- description: 'Generate a professional negotiation email to send to the counterparty, explaining requested changes and their rationale.',
644
- inputSchema: {
645
- type: 'object',
646
- properties: {
647
- analysisId: {
648
- type: 'string',
649
- description: 'The analysis ID of a completed analysis'
650
- },
651
- tone: {
652
- type: 'string',
653
- enum: ['collaborative', 'firm', 'aggressive'],
654
- description: 'Tone of the email. Default: collaborative'
655
- },
656
- recipientRole: {
657
- type: 'string',
658
- description: 'Role of the recipient (e.g., "General Counsel", "Sales Rep", "Procurement"). Helps tailor the message.'
577
+ description: 'Analysis ID from process_contract'
659
578
  }
660
579
  },
661
580
  required: ['analysisId']
662
581
  },
663
- annotations: {
664
- readOnlyHint: false,
665
- destructiveHint: false
666
- }
667
- },
668
-
669
- extract_clause: {
670
- name: 'extract_clause',
671
- description: 'Extract and analyze a specific clause type from an analyzed contract. Returns the clause text, risk analysis, and suggested improvements.',
672
- inputSchema: {
673
- type: 'object',
674
- properties: {
675
- analysisId: {
676
- type: 'string',
677
- description: 'The analysis ID of a completed analysis'
678
- },
679
- clauseType: {
680
- type: 'string',
681
- enum: ['indemnification', 'liability', 'ip', 'termination', 'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment'],
682
- description: 'The type of clause to extract'
683
- }
684
- },
685
- required: ['analysisId', 'clauseType']
686
- },
687
- annotations: {
688
- readOnlyHint: true
689
- }
690
- },
691
-
692
- compare_playbook: {
693
- name: 'compare_playbook',
694
- description: 'Compare an analyzed contract against a company playbook to identify deviations from pre-approved positions and required approvals.',
695
- inputSchema: {
696
- type: 'object',
697
- properties: {
698
- analysisId: {
699
- type: 'string',
700
- description: 'The analysis ID of a completed analysis'
701
- },
702
- playbookId: {
703
- type: 'string',
704
- description: 'The ID of the playbook to compare against'
705
- }
706
- },
707
- required: ['analysisId', 'playbookId']
708
- },
709
- annotations: {
710
- readOnlyHint: true
711
- }
712
- },
713
-
714
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
715
- // INSTANT SWARM - Parallel N-Section Redlining (spawns N agents for N sections, max parallelization)
716
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
717
-
718
- instant_swarm: {
719
- name: 'instant_swarm',
720
- 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.',
721
- inputSchema: {
722
- type: 'object',
723
- properties: {
724
- analysisId: {
725
- type: 'string',
726
- description: 'The analysis ID from a completed process_contract call. The analysis provides contract context for each section.'
727
- },
728
- aggressivenessLevel: {
729
- type: 'number',
730
- enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
731
- description: 'How aggressive the redlines should be (1=conservative, 10=very aggressive). Recommended: 5-7 for balanced approach.'
732
- },
733
- partyPosition: {
734
- type: 'string',
735
- enum: ['customer', 'vendor'],
736
- description: 'Which side are you on? "customer" = you are buying/receiving services. "vendor" = you are selling/providing services.'
737
- },
738
- ourPartyName: {
739
- type: 'string',
740
- description: 'Your company name as it should appear in redlines (e.g., "Acme Corp").'
741
- },
742
- counterpartyName: {
743
- type: 'string',
744
- description: 'The other party\'s name (e.g., "Vendor Inc").'
745
- },
746
- targetSections: {
747
- type: 'array',
748
- items: { type: 'string' },
749
- 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'
750
- }
751
- },
752
- required: ['analysisId', 'aggressivenessLevel', 'partyPosition']
753
- },
754
- annotations: {
755
- readOnlyHint: false,
756
- destructiveHint: false
757
- }
758
- },
759
-
760
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
761
- // QUICK TOOLS - Immediate analysis without waiting for full pipeline
762
- // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
763
-
764
- quick_scan: {
765
- name: 'quick_scan',
766
- 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.',
767
- inputSchema: {
768
- type: 'object',
769
- properties: {
770
- contractText: {
771
- type: 'string',
772
- description: 'The contract text (plain text or base64-encoded DOCX). For DOCX files, base64 encode the file contents.'
773
- },
774
- fileName: {
775
- type: 'string',
776
- description: 'Optional filename for context (e.g., "Acme_MSA_2024.docx")'
777
- },
778
- perspective: {
779
- type: 'string',
780
- enum: ['customer', 'vendor', 'neutral'],
781
- description: 'Analyze from customer (buyer), vendor (seller), or neutral perspective. Default: customer'
782
- }
783
- },
784
- required: ['contractText']
785
- },
786
- annotations: {
787
- readOnlyHint: true
788
- }
789
- },
790
-
791
- ask_clause: {
792
- name: 'ask_clause',
793
- 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?"',
794
- inputSchema: {
795
- type: 'object',
796
- properties: {
797
- contractText: {
798
- type: 'string',
799
- description: 'The contract text (plain text or base64-encoded DOCX)'
800
- },
801
- question: {
802
- type: 'string',
803
- description: 'Your question about the contract (e.g., "What is the liability cap?", "Is there an auto-renewal clause?")'
804
- },
805
- clauseType: {
806
- type: 'string',
807
- enum: ['indemnification', 'liability', 'ip', 'termination', 'payment', 'confidentiality', 'data_privacy', 'sla', 'force_majeure', 'assignment', 'any'],
808
- description: 'Optional: Focus on a specific clause type, or "any" to search the whole contract. Default: any'
809
- }
810
- },
811
- required: ['contractText', 'question']
812
- },
813
- annotations: {
814
- readOnlyHint: true
815
- }
816
- },
817
-
818
- check_dealbreakers: {
819
- name: 'check_dealbreakers',
820
- 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.',
821
- inputSchema: {
822
- type: 'object',
823
- properties: {
824
- contractText: {
825
- type: 'string',
826
- description: 'The contract text (plain text or base64-encoded DOCX)'
827
- },
828
- playbookId: {
829
- type: 'string',
830
- description: 'Optional: Specific playbook to check against. If not provided, uses your default company playbook.'
831
- }
832
- },
833
- required: ['contractText']
834
- },
835
582
  annotations: {
836
583
  readOnlyHint: true
837
584
  }
@@ -839,17 +586,17 @@ Pipeline: (1) Context Loading, (2) Data Extraction, (3) Party Identification, (4
839
586
 
840
587
  download_file: {
841
588
  name: 'download_file',
842
- 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.',
589
+ description: 'Download a file from BitsBound (redlined DOCX, analysis JSON). Returns base64 content or saves to local path.',
843
590
  inputSchema: {
844
591
  type: 'object',
845
592
  properties: {
846
593
  downloadUrl: {
847
594
  type: 'string',
848
- description: 'The download URL from get_analysis_status deliverables (redlinedDocxDownloadUrl)'
595
+ description: 'Download URL from get_analysis_status deliverables'
849
596
  },
850
597
  saveToPath: {
851
598
  type: 'string',
852
- description: 'Optional: Local file path to save the downloaded file. If not provided, returns base64 content.'
599
+ description: 'Optional: Local path to save file. If omitted, returns base64.'
853
600
  }
854
601
  },
855
602
  required: ['downloadUrl']
@@ -870,7 +617,7 @@ export const RESOURCE_DEFINITIONS = {
870
617
  analysis: {
871
618
  uriTemplate: 'bitsbound://analysis/{analysisId}',
872
619
  name: 'Contract Analysis',
873
- description: 'Full analysis results including all 17 analyzer outputs, risk scores, and recommendations',
620
+ description: 'Full analysis results including all analyzer outputs (varies by contract type), risk scores, and recommendations',
874
621
  mimeType: 'application/json'
875
622
  },
876
623
  playbook: {
@@ -902,33 +649,22 @@ export const RESOURCE_DEFINITIONS = {
902
649
  * - O: User experiences a smooth, guided contract analysis flow
903
650
  */
904
651
  export const PROMPT_DEFINITIONS = {
652
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
653
+ // CORE PROMPTS - Simplified 2-prompt interface matching 3-tool architecture
654
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
655
+
905
656
  process_contract: {
906
657
  name: 'process_contract',
907
- description: '📄 Process Contract - Upload a DOCX and get partner-level redlines with Track Changes, risk analysis, and a negotiation email',
908
- arguments: []
909
- },
910
- quick_scan: {
911
- name: 'quick_scan',
912
- description: '⚡ Quick Risk Scan - Get instant risk assessment in 5-10 seconds without waiting for full analysis',
913
- arguments: []
914
- },
915
- ask_about_contract: {
916
- name: 'ask_about_contract',
917
- description: '💬 Ask About a Clause - Upload a contract and ask specific questions about any clause or term',
918
- arguments: []
919
- },
920
- check_dealbreakers: {
921
- name: 'check_dealbreakers',
922
- description: '🚨 Check Dealbreakers - Quick pass/fail check against your playbook rules',
658
+ description: 'Analyze Contract - Upload a DOCX and get partner-level redlines with Track Changes, risk analysis, and a negotiation email',
923
659
  arguments: []
924
660
  },
925
- continue_analysis: {
926
- name: 'continue_analysis',
927
- description: '📊 Continue Previous Analysis - Resume working with a previously analyzed contract',
661
+ check_analysis: {
662
+ name: 'check_analysis',
663
+ description: 'Check Analysis Status - Check progress or download results from a running/completed analysis',
928
664
  arguments: [
929
665
  {
930
666
  name: 'analysisId',
931
- description: 'The analysis ID from a previous contract analysis',
667
+ description: 'The analysis ID from process_contract',
932
668
  required: true
933
669
  }
934
670
  ]
@@ -943,94 +679,55 @@ export type PromptName = keyof typeof PROMPT_DEFINITIONS;
943
679
  * NOTE: MCP spec requires content to be { type: 'text', text: string } not plain string
944
680
  */
945
681
  export const PROMPT_MESSAGES: Record<PromptName, { role: 'user'; content: { type: 'text'; text: string } }[]> = {
682
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
683
+ // CORE PROMPT MESSAGES - Simplified to match 3-tool architecture
684
+ // ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
685
+
946
686
  process_contract: [
947
687
  {
948
688
  role: 'user',
949
689
  content: { type: 'text', text: `I want to analyze a contract using BitsBound.
950
690
 
951
- Please help me by:
952
- 1. Ask me for the contract file. I will provide EITHER:
953
- - A full file path (e.g., /Users/john/Documents/contract.docx)
954
- - An uploaded DOCX file
955
- 2. IMPORTANT FILE PATH HANDLING:
956
- - 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.
957
- - If I upload a file: Use the base64 content with 'docxBase64' parameter.
958
- 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.
959
- 4. When I ask you to check status (using 'get_analysis_status'), show me:
960
- - Current progress percentage
961
- - If complete, ALWAYS provide these clickable links (they work directly in browser):
962
- * REDLINED DOCX: Display the 'redlinedDocxUrl' as a clickable download link
963
- * NEGOTIATION EMAIL: Display the 'negotiationEmailUrl' as a clickable link to view in browser
964
- - Also show: favorability score, top 5 risks, negotiation priorities
965
-
966
- The analysis typically takes ~25 minutes. Wait for me to ask you to check - do not poll automatically.` }
967
- }
968
- ],
969
- quick_scan: [
970
- {
971
- role: 'user',
972
- content: { type: 'text', text: `I want a quick risk scan of a contract (5-10 seconds, not the full analysis).
973
-
974
- Please help me by:
975
- 1. Asking me to upload or paste the contract
976
- 2. Use the BitsBound 'quick_scan' tool for instant analysis
977
- 3. Show me:
978
- - Contract type and parties
979
- - Favorability estimate
980
- - Top concerns by severity
981
- - Key terms (liability cap, term, payment, etc.)
982
- - Whether I should do a full analysis
983
-
984
- This is for initial triage - not a substitute for full attorney review.` }
985
- }
986
- ],
987
- ask_about_contract: [
988
- {
989
- role: 'user',
990
- content: { type: 'text', text: `I want to ask questions about specific clauses in a contract.
691
+ Please help me by gathering this information:
991
692
 
992
- Please help me by:
993
- 1. Asking me to upload or paste the contract (or relevant sections)
994
- 2. Ask what I want to know (e.g., "What is the liability cap?", "Is there an auto-renewal?")
995
- 3. Use the BitsBound 'ask_clause' tool for instant answers
996
- 4. Include the actual clause text and any risk assessment
693
+ 1. CONTRACT TYPE:
694
+ - saas, ma, vc, employment, nda, equipment, commercial-lease, professional-services, or miscellaneous
997
695
 
998
- I can ask multiple questions - this is a Q&A session about the contract.` }
999
- }
1000
- ],
1001
- check_dealbreakers: [
1002
- {
1003
- role: 'user',
1004
- content: { type: 'text', text: `I want to check a contract for dealbreakers against my company's playbook.
1005
-
1006
- Please help me by:
1007
- 1. Asking me to upload or paste the contract
1008
- 2. Use the BitsBound 'check_dealbreakers' tool
1009
- 3. Show me:
1010
- - Pass/fail result
1011
- - Any dealbreaker issues found
1012
- - Missing required clauses
1013
- - Who needs to approve if we proceed
1014
-
1015
- This is a quick pre-screen before spending time on full analysis.` }
696
+ 2. CONTRACT FILE:
697
+ - File path (e.g., /Users/john/Documents/contract.docx) - preferred
698
+ - Or upload the DOCX directly
699
+
700
+ 3. WHO I REPRESENT:
701
+ - saas: customer or vendor
702
+ - ma: buyer or seller
703
+ - vc: investor or founder
704
+ - (etc. based on contract type)
705
+
706
+ 4. AGGRESSIVENESS (1-10):
707
+ - 1 = very conciliatory, 5 = balanced, 10 = very aggressive
708
+
709
+ Then call the 'process_contract' tool. Analysis takes ~25-35 minutes.
710
+ The response includes 'checkBackTime' - tell me when to check back.
711
+ Do NOT poll automatically - wait for me to ask.` }
1016
712
  }
1017
713
  ],
1018
- continue_analysis: [
714
+ check_analysis: [
1019
715
  {
1020
716
  role: 'user',
1021
- content: { type: 'text', text: `I want to continue working with a previously analyzed contract.
1022
-
1023
- I have an analysis ID from a previous BitsBound analysis. Please:
1024
- 1. Ask me for the analysis ID
1025
- 2. Use 'get_analysis_status' to check if it's complete
1026
- 3. If complete, I can:
1027
- - Ask questions with 'ask_sac' (SAC has full context)
1028
- - Generate a redlined document with 'generate_redline'
1029
- - Generate a negotiation email with 'generate_negotiation_email'
1030
- - Extract specific clauses with 'extract_clause'
1031
- - Compare against a playbook with 'compare_playbook'
1032
-
1033
- What would you like to do with this analysis?` }
717
+ content: { type: 'text', text: `I want to check on a contract analysis.
718
+
719
+ Analysis ID: {analysisId}
720
+
721
+ Please use 'get_analysis_status' and show me:
722
+ - Current progress percentage
723
+ - If complete, provide:
724
+ * CLICKABLE download link for the redlined DOCX
725
+ * Negotiation email content
726
+ * Favorability score
727
+ * Top risks
728
+ * Negotiation priorities
729
+
730
+ If I need to download the file, use 'download_file' with the URL from the status response.` }
1034
731
  }
1035
732
  ]
1036
733
  };
@@ -1066,7 +763,7 @@ export const OPENAPI_SPEC = {
1066
763
  },
1067
764
  servers: [
1068
765
  {
1069
- url: 'https://bitsbound-saas-backend-mxb1.onrender.com',
766
+ url: 'https://bitsbound-contract-backend.onrender.com',
1070
767
  description: 'Production server'
1071
768
  }
1072
769
  ],
@@ -1618,7 +1315,7 @@ Add to your Claude Desktop configuration (\`~/Library/Application Support/Claude
1618
1315
 
1619
1316
  1. Create a new Custom GPT at https://chat.openai.com/gpts/editor
1620
1317
  2. Go to "Configure" → "Create new action"
1621
- 3. Import OpenAPI schema from: \`https://bitsbound-saas-backend-mxb1.onrender.com/api/v1/mcp/openapi.json\`
1318
+ 3. Import OpenAPI schema from: \`https://bitsbound-contract-backend.onrender.com/api/v1/mcp/openapi.json\`
1622
1319
  4. Set Authentication: API Key, Header name: \`x-api-key\`
1623
1320
  5. Enter your BitsBound API key
1624
1321
 
@@ -1627,7 +1324,7 @@ Add to your Claude Desktop configuration (\`~/Library/Application Support/Claude
1627
1324
  Use the REST API directly with your API key:
1628
1325
 
1629
1326
  \`\`\`bash
1630
- curl -X POST https://bitsbound-saas-backend-mxb1.onrender.com/api/v1/mcp/analyze \\
1327
+ curl -X POST https://bitsbound-contract-backend.onrender.com/api/v1/mcp/analyze \\
1631
1328
  -H "Content-Type: application/json" \\
1632
1329
  -H "x-api-key: sk_live_your_api_key_here" \\
1633
1330
  -d '{
@@ -1717,18 +1414,19 @@ Compare an analyzed contract against a company playbook.
1717
1414
  ## Example Workflow
1718
1415
 
1719
1416
  \`\`\`
1720
- User: "Analyze this Master Service Agreement and tell me the key risks"
1417
+ User: "Analyze this contract and tell me the key risks"
1721
1418
 
1722
1419
  Claude/ChatGPT:
1723
- 1. Calls process_contract with the uploaded DOCX (with Instant Swarm + Email enabled)
1724
- 2. Polls get_analysis_status to watch progress through 8 stages:
1420
+ 1. Identifies the contract type (MSA, M&A, VC term sheet, employment, NDA, etc.)
1421
+ 2. Calls process_contract with the uploaded DOCX (with Instant Swarm + Email enabled)
1422
+ 3. Polls get_analysis_status to watch progress through 8 stages:
1725
1423
  - Loading Context → Extracting Data → Identifying Parties → Researching
1726
1424
  - AI Analysis → Instant Swarm™ → Generating Email → Synthesizing Results
1727
- 3. Reads results showing favorability score (e.g., 42% - Vendor Favorable)
1728
- 4. Identifies top risks: unlimited liability, broad IP assignment, weak SLA
1729
- 5. User can ask follow-up questions via ask_sac (SAC has full contract context)
1730
- 6. Downloads the redlined DOCX with real Track Changes (from Instant Swarm™)
1731
- 7. Reviews the auto-generated negotiation email (from Email Generator)
1425
+ 4. Reads results showing favorability score (e.g., 42% - Vendor Favorable)
1426
+ 5. Identifies top risks based on contract type and activated analyzers
1427
+ 6. User can ask follow-up questions via ask_sac (SAC has full contract context)
1428
+ 7. Downloads the redlined DOCX with real Track Changes (from Instant Swarm™)
1429
+ 8. Reviews the auto-generated negotiation email (from Email Generator)
1732
1430
  \`\`\`
1733
1431
 
1734
1432
  ## Environment Variables