summary_get_period
Retrieve financial summary statistics for a specified date range to analyze spending, income, and trends within Money Manager.
Instructions
Retrieves financial summary statistics for a date range.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | Yes | Start date (YYYY-MM-DD) | |
| endDate | Yes | End date (YYYY-MM-DD) |
Implementation Reference
- src/tools/handlers.ts:318-341 (handler)The primary handler function implementing the logic for the 'summary_get_period' tool. Validates input schema, calls the Money Manager API '/getSummaryDataByPeriod' endpoint with startDate and endDate parameters, and transforms the raw response into a structured SummaryResponse object containing overall summary, income by category, and expense by category breakdowns./** * Handler for summary_get_period tool * Retrieves financial summary statistics for a date range */ export async function handleSummaryGetPeriod( httpClient: HttpClient, input: unknown, ): Promise<SummaryResponse> { const validated = SummaryGetPeriodInputSchema.parse(input); const rawResponse = await httpClient.get<RawSummaryResponse>( "/getSummaryDataByPeriod", { startDate: validated.startDate, endDate: validated.endDate, }, ); return { summary: rawResponse.summary, incomeByCategory: rawResponse.income || [], expenseByCategory: rawResponse.outcome || [], }; }
- src/schemas/index.ts:165-173 (schema)Zod schema defining the input validation for the summary_get_period tool, requiring 'startDate' and 'endDate' fields validated against the DateSchema (YYYY-MM-DD format). Includes TypeScript type inference./** * Input schema for summary_get_period tool */ export const SummaryGetPeriodInputSchema = z.object({ startDate: DateSchema, endDate: DateSchema, }); export type SummaryGetPeriodInput = z.infer<typeof SummaryGetPeriodInputSchema>;
- src/tools/handlers.ts:802-803 (registration)Registration of the summary_get_period handler function in the central toolHandlers registry object, which maps tool names to their executor functions.// Summary summary_get_period: handleSummaryGetPeriod,
- src/index.ts:176-186 (registration)MCP tool registration in the TOOL_DEFINITIONS array, defining the tool name, description, and JSON schema for input validation exposed to the Model Context Protocol server.name: "summary_get_period", description: "Retrieves financial summary statistics for a date range.", inputSchema: { type: "object" as const, properties: { startDate: { type: "string", description: "Start date (YYYY-MM-DD)" }, endDate: { type: "string", description: "End date (YYYY-MM-DD)" }, }, required: ["startDate", "endDate"], }, },
- src/schemas/index.ts:384-385 (schema)Registration of the SummaryGetPeriodInputSchema in the central ToolSchemas registry, used for runtime input validation across all tools.// Summary summary_get_period: SummaryGetPeriodInputSchema,