Skip to main content
Glama
shahlaukik

Money Manager MCP Server

by shahlaukik

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
NameRequiredDescriptionDefault
startDateYesStart date (YYYY-MM-DD)
endDateYesEnd date (YYYY-MM-DD)

Implementation Reference

  • 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 || [],
      };
    }
  • 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>;
  • 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"],
      },
    },
  • Registration of the SummaryGetPeriodInputSchema in the central ToolSchemas registry, used for runtime input validation across all tools.
    // Summary
    summary_get_period: SummaryGetPeriodInputSchema,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shahlaukik/money-manager-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server