get_contracts
Retrieve contract data from Simplicate business systems to access agreement details, terms, and associated information for business operations.
Instructions
Retrieve contracts
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"type": "number"
},
"offset": {
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/mcp/server-full.ts:325-334 (registration)Tool registration for 'get_contracts' including input schema definitionname: 'get_contracts', description: 'Retrieve contracts', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, offset: { type: 'number' }, }, }, },
- src/mcp/server-full.ts:530-536 (handler)MCP server handler for get_contracts tool call, delegates to SimplicateServiceExtended.getContracts with pagination paramscase 'get_contracts': { const data = await this.simplicateService.getContracts({ limit: (toolArgs.limit as number) || 10, offset: (toolArgs.offset as number) || 0, }); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }
- Core helper method implementing contract retrieval via Simplicate API endpoint /crm/contract, with error handling and paginationasync getContracts(params?: { limit?: number; offset?: number }): Promise<SimplicateContract[]> { try { const response = await this.client.get('/crm/contract', params); return response.data || []; } catch (error) { // Contracts endpoint may not be available or requires specific filters console.warn('getContracts: endpoint returned error, returning empty array'); return []; } }
- TypeScript interface defining the SimplicateContract return type structure used by getContractsexport interface SimplicateContract { id: string; contract_number: string; organization?: { id: string; name: string }; start_date: string; end_date?: string; status: string; }