expense_summary_report
Generate categorized expense reports from Excel data by date range to analyze spending patterns and support financial decision-making.
Instructions
Generate expense summary report
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | Yes | ||
| groupBy | No | category | |
| startDate | Yes |
Implementation Reference
- src/tools/expense-tools.ts:112-126 (handler)The async handler function for the 'expense_summary_report' tool. It calls the Python ExpenseTracker.get_expense_summary function via pythonBridge with the provided date range and grouping.handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'expense_tracking', function: 'ExpenseTracker.get_expense_summary', args: [args.startDate, args.endDate, args.groupBy || 'category'] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
- src/tools/expense-tools.ts:99-111 (schema)Input schema defining required startDate and endDate parameters, with optional groupBy (category, vendor, cost_center, or month).inputSchema: { type: "object", properties: { startDate: { type: "string", format: "date" }, endDate: { type: "string", format: "date" }, groupBy: { type: "string", enum: ["category", "vendor", "cost_center", "month"], default: "category" } }, required: ["startDate", "endDate"] },
- src/tools/expense-tools.ts:96-127 (registration)The complete Tool object definition for 'expense_summary_report' within the exported expenseTools array.{ name: "expense_summary_report", description: "Generate expense summary report", inputSchema: { type: "object", properties: { startDate: { type: "string", format: "date" }, endDate: { type: "string", format: "date" }, groupBy: { type: "string", enum: ["category", "vendor", "cost_center", "month"], default: "category" } }, required: ["startDate", "endDate"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'expense_tracking', function: 'ExpenseTracker.get_expense_summary', args: [args.startDate, args.endDate, args.groupBy || 'category'] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
- src/index.ts:32-44 (registration)Main allTools array registration, spreading expenseTools (line 36) which includes the expense_summary_report tool, used by MCP server handlers for listTools and callTool.const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];