mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 22:31:46 +00:00
feat(mcp): include full budget items and packing list in trip summary
Expand get_trip_summary to return full budget line items and full packing list (with checked status) instead of totals/stats only. Update tool description to accurately reflect all returned data including todos, files, and collab poll/message counts.
This commit is contained in:
@@ -131,7 +131,7 @@ export function registerTripTools(server: McpServer, userId: number): void {
|
|||||||
server.registerTool(
|
server.registerTool(
|
||||||
'get_trip_summary',
|
'get_trip_summary',
|
||||||
{
|
{
|
||||||
description: 'Get a full denormalized summary of a trip in a single call: metadata, members, days with assignments and notes, accommodations, budget totals, packing stats, reservations, and collab notes. Use this as a context loader before planning or modifying a trip.',
|
description: 'Get a full denormalized summary of a trip in a single call: metadata, members, days with assignments and notes, accommodations, full budget line items with totals, full packing list with checked status, reservations, collab notes, to-do items, files, and collab poll/message counts. Use this as a context loader before planning or modifying a trip.',
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
tripId: z.number().int().positive(),
|
tripId: z.number().int().positive(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -600,6 +600,7 @@ export function getTripSummary(tripId: number) {
|
|||||||
|
|
||||||
const budgetItems = listBudgetItems(tripId);
|
const budgetItems = listBudgetItems(tripId);
|
||||||
const budget = {
|
const budget = {
|
||||||
|
items: budgetItems,
|
||||||
item_count: budgetItems.length,
|
item_count: budgetItems.length,
|
||||||
total: budgetItems.reduce((sum, i) => sum + (i.total_price || 0), 0),
|
total: budgetItems.reduce((sum, i) => sum + (i.total_price || 0), 0),
|
||||||
currency: trip.currency,
|
currency: trip.currency,
|
||||||
@@ -607,6 +608,7 @@ export function getTripSummary(tripId: number) {
|
|||||||
|
|
||||||
const packingItems = listPackingItems(tripId);
|
const packingItems = listPackingItems(tripId);
|
||||||
const packing = {
|
const packing = {
|
||||||
|
items: packingItems,
|
||||||
total: packingItems.length,
|
total: packingItems.length,
|
||||||
checked: (packingItems as { checked: number }[]).filter(i => i.checked).length,
|
checked: (packingItems as { checked: number }[]).filter(i => i.checked).length,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user