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;
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals important behavioral traits: the server returns HTML-based Excel format, auto-correction of .xlsx to .xls with warnings, and file saving behavior. However, it doesn't disclose whether this is a read-only operation, what permissions are required, whether it's destructive, rate limits, or what happens if the output path already exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with three sentences that each add value: core functionality, format clarification, and compatibility guidance. It's front-loaded with the main purpose, though the second sentence about HTML-based format could potentially be integrated more smoothly. No wasted words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter export tool with no annotations and no output schema, the description provides adequate but incomplete context. It covers the core functionality and format details well, but lacks information about the return value (beyond format type), error conditions, authentication requirements, or how the exported data relates to other tools. Given the complexity and lack of structured metadata, more behavioral context would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema - it only reinforces the .xls extension recommendation for outputPath that's already in the schema. No additional parameter semantics, constraints, or relationships are explained in the description beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Exports transaction data to Excel file.' It specifies the resource (transaction data) and action (export to Excel), but doesn't distinguish it from potential sibling tools like summary_get_period or transaction_list that might also retrieve transaction data. The mention of HTML-based Excel format adds specificity but doesn't create clear differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. While it mentions file extension compatibility details, it doesn't explain when to choose this export tool over other data retrieval tools like summary_get_period or transaction_list, nor does it mention prerequisites or specific use cases for Excel export versus other formats.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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