get_deal_details
Retrieve detailed information about a specific deal using its ID, with optional source specification, from the Bargainer MCP Server for accurate deal comparison and insights.
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:243-260 (registration)Tool registration definition including name, description, and input schema for the get_deal_details tool, returned by list tools handler.{ 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/server.ts:364-379 (handler)Primary handler function for the get_deal_details tool. Extracts dealId and optional source from args, calls aggregator to fetch details, and returns formatted JSON response.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/services/aggregator.ts:65-82 (helper)DealAggregator helper method that retrieves deal details by delegating to the specified provider or iterating through all providers if source is unspecified.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; }
- src/providers/slickdeals.ts:44-57 (helper)Slickdeals provider implementation of getDealDetails, fetching from Slickdeals API and transforming the response.async getDealDetails(dealId: string): Promise<Deal | null> { try { const response = await this.client.get(`/v2/deals/${dealId}`); if (response.data && response.data.deal) { return this.transformDeal(response.data.deal); } return null; } catch (error) { console.error('SlickDeals deal details error:', error); return null; } }
- src/providers/rapidapi.ts:57-70 (helper)RapidAPI provider implementation of getDealDetails, fetching from RapidAPI deals endpoint and transforming.async getDealDetails(dealId: string): Promise<Deal | null> { try { const response = await this.client.get(`/deal/${dealId}`); if (response.data) { return this.transformDeal(response.data); } return null; } catch (error) { console.error('RapidAPI deal details error:', error); return null; } }