Documentation Index
Fetch the complete documentation index at: https://docs.ledgerbox.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Contract model extracts and structures information from legal contracts, including parties, dates, jurisdictions, and key contract terms. The model is designed to handle various contract formats while maintaining flexibility for different date formats and party structures.
Model Details
- Model ID:
CONTRACT
- Supported Locales:
en-US
- Version: GA
- Release Date: November 30, 2024
Schema Structure
Root Level Fields
| Field | Type | Description |
|---|
Title | string | Contract title |
ContractId | string? | Contract identification code |
Parties | Party[] | List of legal parties |
ExecutionDate | string? | Date when agreement was fully signed |
EffectiveDate | string? | Date when contract starts to be in effect |
ExpirationDate | string? | Date when contract ends to be in effect |
ContractDuration | string? | Contract terms |
RenewalDate | string? | Date when contract needs to be renewed |
Jurisdictions | Jurisdiction[] | List of jurisdictions |
Party Fields
Each party in the Parties array contains:
| Field | Type | Description |
|---|
Name | string? | Name of legal party |
Address | Address? | Address of legal party |
ReferenceName | string? | Name used throughout the contract as reference |
Clause | string? | Full description of the party |
Jurisdiction Fields
Each jurisdiction in the Jurisdictions array contains:
| Field | Type | Description |
|---|
Clause | string? | Full description of the jurisdiction |
Region | string? | Court location |
Utility Functions
The model provides several utility functions for contract management:
getPrimaryParties
Returns the first two parties of the contract:
const getPrimaryParties = (contract: Contract): [Party, Party] | null
isContractValid
Checks if the contract is currently valid based on dates:
const isContractValid = (contract: Contract): boolean
needsRenewalSoon
Checks if contract needs renewal within 30 days:
const needsRenewalSoon = (contract: Contract): boolean
getPrimaryJurisdiction
Gets the first listed jurisdiction:
const getPrimaryJurisdiction = (contract: Contract): Jurisdiction | null
Formats party information for display:
const formatPartyClause = (party: Party): string
Example Usage
import { validateContract, contractUtils } from '@your-package/models';
// Example contract data
const contractData = {
title: "SERVICE AGREEMENT",
contractId: "AB12956",
parties: [{
name: "Contoso Corporation",
address: "1 Microsoft Way, Redmond, Washington, 98052",
referenceName: "Contoso",
clause: "Contoso Corporation (Contoso), a Washington corporation, having its principal place of business at 1 Microsoft Way, Redmond, Washington, 98052"
}],
executionDate: "2024-02-23",
effectiveDate: "2024-02-23",
contractDuration: "5 years",
jurisdictions: [{
clause: "This Agreement shall be governed by and construed in accordance with the internal laws of the State of Washington applicable to agreements made and to be performed entirely within such state.",
region: "Washington"
}]
};
// Validate the contract
const validatedContract = validateContract(contractData);
// Check contract validity
if (contractUtils.isContractValid(validatedContract)) {
console.log("Contract is currently valid");
}
// Check if renewal is needed
if (contractUtils.needsRenewalSoon(validatedContract)) {
console.log("Contract needs renewal soon");
}
// Get primary jurisdiction
const primaryJurisdiction = contractUtils.getPrimaryJurisdiction(validatedContract);
Date Handling
The model accepts dates in multiple formats:
- ISO 8601 datetime strings
- YYYY-MM-DD format strings
- Written form (e.g., “Twenty Third of February”)
All parseable dates are converted to ISO format during validation. Non-parseable dates are preserved as strings.
Type Definitions
import type {
Party,
Jurisdiction,
Contract,
ContractResponse,
StrictContractResponse
} from '@your-package/models';
Field Validation Rules
For basic validation:
- All fields are optional by default
- Parties and Jurisdictions default to empty arrays if not specified
For strict validation:
- Title is required
- ContractId is required
- ExecutionDate is required
- EffectiveDate is required
- At least one party is required
- For each party in strict mode, Name and ReferenceName are required
Best Practices
- Always validate contracts before processing:
const contract = validateContract(contractData);
- Check contract validity regularly:
if (!contractUtils.isContractValid(contract)) {
// Handle invalid contract
}
- Monitor contracts for upcoming renewals:
if (contractUtils.needsRenewalSoon(contract)) {
// Handle renewal notification
}
-
Preserve original legal language in clauses
-
Use referenceName for party aliases in contract processing
-
Store dates in ISO format while maintaining original text if not parseable