excel_close_workbook
Close the current Excel workbook to save memory and prepare for opening or creating new financial spreadsheets.
Instructions
Close the current workbook
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/excel-tools.ts:477-498 (handler)Full tool definition for 'excel_close_workbook', including schema (empty input), handler that calls ExcelManager.closeWorkbook(), and error handling. This is the primary MCP tool implementation.{ name: "excel_close_workbook", description: "Close the current workbook", inputSchema: { type: "object", properties: {} }, handler: async (): Promise<ToolResult> => { try { excelManager.closeWorkbook(); return { success: true, message: "Workbook closed" }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
- src/excel/excel-manager.ts:444-447 (helper)ExcelManager.closeWorkbook() method implementation that resets the workbook instance and current file path, effectively closing the workbook session.closeWorkbook(): void { this.workbook = null; this.currentFile = null; }
- src/index.ts:32-44 (registration)Includes excelTools in the allTools array used for MCP server tool listing and execution handling.const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];
- src/tools/excel-tools.ts:6-6 (helper)Global ExcelManager instance used by all Excel tools, including the close_workbook handler.const excelManager = new ExcelManager();