get_deal_details
Retrieve comprehensive details for a specific deal by providing its ID, enabling users to access pricing, terms, and source information for comparison.
Instructions
Get detailed information about a specific deal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dealId | Yes | The ID of the deal to get details for | |
| source | No | The source of the deal (optional) |
Implementation Reference
- src/server.ts:364-379 (handler)Primary handler for the 'get_deal_details' tool. Parses args, calls aggregator.getDealDetails, and returns formatted JSON response with deal details.private async handleGetDealDetails(args: any) { const { dealId, source } = args; const deal = await this.aggregator.getDealDetails(dealId, source); return { content: [ { type: 'text', text: JSON.stringify({ success: deal !== null, deal: deal }, null, 2), }, ], }; }
- src/server.ts:246-259 (schema)JSON schema defining input parameters for the get_deal_details tool: required dealId (string), optional source (string).inputSchema: { type: 'object', properties: { dealId: { type: 'string', description: 'The ID of the deal to get details for', }, source: { type: 'string', description: 'The source of the deal (optional)', }, }, required: ['dealId'], },
- src/server.ts:243-260 (registration)Tool registration in getAvailableTools() method, returned by listTools handler. Includes name, description, and input schema.{ name: 'get_deal_details', description: 'Get detailed information about a specific deal', inputSchema: { type: 'object', properties: { dealId: { type: 'string', description: 'The ID of the deal to get details for', }, source: { type: 'string', description: 'The source of the deal (optional)', }, }, required: ['dealId'], }, },
- src/services/aggregator.ts:65-82 (helper)Aggregator method that handles getDealDetails logic by delegating to specific provider if source provided, or trying all providers sequentially.async getDealDetails(dealId: string, source?: string): Promise<Deal | null> { if (source && this.providers.has(source)) { const provider = this.providers.get(source); return provider ? await provider.getDealDetails(dealId) : null; } // Try all providers if source not specified for (const provider of this.providers.values()) { try { const deal = await provider.getDealDetails(dealId); if (deal) return deal; } catch (error) { console.error(`Error getting deal details from ${provider.getSourceName()}:`, error); } } return null; }