Skip to main content
Glama
shahlaukik

Money Manager MCP Server

by shahlaukik

summary_export_excel

Export transaction data to Excel for financial analysis by specifying date range and account, generating formatted reports for review.

Instructions

Exports transaction data to Excel file. The server returns an HTML-based Excel format. Use .xls extension for best compatibility (if .xlsx is provided, it will be auto-corrected to .xls with a warning).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date (YYYY-MM-DD)
endDateYesEnd date (YYYY-MM-DD)
mbidYesMoney book ID
assetIdNoOptional: Filter by asset ID
inOutTypeNoOptional: Filter by transaction type
outputPathYesLocal path to save the Excel file (use .xls extension for best compatibility)

Implementation Reference

  • The main execution handler for the 'summary_export_excel' tool. Validates input using SummaryExportExcelInputSchema, auto-corrects .xlsx to .xls extension, downloads the Excel file via the Money Manager API's /getExcelFile endpoint using httpClient.downloadFile, and returns a success response with file path, size, and message.
    export async function handleSummaryExportExcel( httpClient: HttpClient, input: unknown, ): Promise<ExcelExportResponse> { const validated = SummaryExportExcelInputSchema.parse(input); // Auto-correct .xlsx extension to .xls since API returns HTML-based Excel format let outputPath = validated.outputPath; let extensionCorrected = false; if (outputPath.toLowerCase().endsWith(".xlsx")) { outputPath = outputPath.slice(0, -5) + ".xls"; extensionCorrected = true; } try { const result = await httpClient.downloadFile("/getExcelFile", outputPath, { startDate: validated.startDate, endDate: validated.endDate, mbid: validated.mbid, assetId: validated.assetId || "", inOutType: validated.inOutType || "", }); let message = `Excel file exported successfully to ${result.filePath}`; if (extensionCorrected) { message += ` (Note: Extension was changed from .xlsx to .xls because the server returns HTML-based Excel format which requires .xls extension for proper compatibility)`; } return { success: true, filePath: result.filePath, fileSize: result.fileSize, message, }; } catch (error) { if (error instanceof Error) { throw FileError.writeFailed(outputPath, error.message); } throw wrapError(error); } }
  • Zod schema definition for input validation of the summary_export_excel tool, including required startDate, endDate, mbid, outputPath, and optional assetId, inOutType.
    * Input schema for summary_export_excel tool */ export const SummaryExportExcelInputSchema = z.object({ startDate: DateSchema, endDate: DateSchema, mbid: MbidSchema, assetId: z.string().optional(), inOutType: z.string().optional(), outputPath: NonEmptyString, }); export type SummaryExportExcelInput = z.infer< typeof SummaryExportExcelInputSchema >;
  • Registration of the handleSummaryExportExcel handler function in the toolHandlers object, mapping the tool name 'summary_export_excel' to its handler.
    export const toolHandlers = { // Initialization init_get_data: handleInitGetData, // Transactions transaction_list: handleTransactionList, transaction_create: handleTransactionCreate, transaction_update: handleTransactionUpdate, transaction_delete: handleTransactionDelete, // Summary summary_get_period: handleSummaryGetPeriod, summary_export_excel: handleSummaryExportExcel, // Assets asset_list: handleAssetList, asset_create: handleAssetCreate, asset_update: handleAssetUpdate, asset_delete: handleAssetDelete, // Credit Cards card_list: handleCardList, card_create: handleCardCreate, card_update: handleCardUpdate, // Transfers transfer_create: handleTransferCreate, transfer_update: handleTransferUpdate, // Dashboard dashboard_get_overview: handleDashboardGetOverview, dashboard_get_asset_chart: handleDashboardGetAssetChart, // Backup backup_download: handleBackupDownload, backup_restore: handleBackupRestore, } as const;
  • src/index.ts:187-213 (registration)
    MCP tool registration in the TOOL_DEFINITIONS array, defining the name, description, and JSON inputSchema for the summary_export_excel tool.
    { name: "summary_export_excel", description: "Exports transaction data to Excel file. The server returns an HTML-based Excel format. Use .xls extension for best compatibility (if .xlsx is provided, it will be auto-corrected to .xls with a warning).", inputSchema: { type: "object" as const, properties: { startDate: { type: "string", description: "Start date (YYYY-MM-DD)" }, endDate: { type: "string", description: "End date (YYYY-MM-DD)" }, mbid: { type: "string", description: "Money book ID" }, assetId: { type: "string", description: "Optional: Filter by asset ID", }, inOutType: { type: "string", description: "Optional: Filter by transaction type", }, outputPath: { type: "string", description: "Local path to save the Excel file (use .xls extension for best compatibility)", }, }, required: ["startDate", "endDate", "mbid", "outputPath"], }, },
  • Registration of the SummaryExportExcelInputSchema in the ToolSchemas registry object, allowing lookup and validation by tool name.
    export const ToolSchemas = { // Initialization init_get_data: InitGetDataInputSchema, // Transactions transaction_list: TransactionListInputSchema, transaction_create: TransactionCreateInputSchema, transaction_update: TransactionUpdateInputSchema, transaction_delete: TransactionDeleteInputSchema, // Summary summary_get_period: SummaryGetPeriodInputSchema, summary_export_excel: SummaryExportExcelInputSchema, // Assets asset_list: AssetListInputSchema, asset_create: AssetCreateInputSchema, asset_update: AssetUpdateInputSchema, asset_delete: AssetDeleteInputSchema, // Credit Cards card_list: CardListInputSchema, card_create: CardCreateInputSchema, card_update: CardUpdateInputSchema, // Transfers transfer_create: TransferCreateInputSchema, transfer_update: TransferUpdateInputSchema, // Dashboard dashboard_get_overview: DashboardGetOverviewInputSchema, dashboard_get_asset_chart: DashboardGetAssetChartInputSchema, // Backup backup_download: BackupDownloadInputSchema, backup_restore: BackupRestoreInputSchema, } as const;

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