excel_add_worksheet
Add a new worksheet to organize financial data, calculations, or reports within your Excel workbook for better analysis and tracking.
Instructions
Add a new worksheet to the current workbook
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/tools/excel-tools.ts:183-196 (handler)MCP tool handler function that calls ExcelManager.addWorksheet(args.name) and returns success/error response.handler: async (args: any): Promise<ToolResult> => { try { await excelManager.addWorksheet(args.name); return { success: true, message: `Added worksheet: ${args.name}` }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
- src/tools/excel-tools.ts:176-182 (schema)Input schema defining the required 'name' parameter as a string.inputSchema: { type: "object", properties: { name: { type: "string" } }, required: ["name"] },
- src/index.ts:8-44 (registration)Import of excelTools and inclusion in allTools array, which is used by MCP server for listing and calling tools.import { excelTools } from "./tools/excel-tools.js"; import { financialTools } from "./tools/financial-tools.js"; import { rentalTools } from "./tools/rental-tools.js"; import { expenseTools } from "./tools/expense-tools.js"; import { reportingTools } from "./tools/reporting-tools.js"; import { cashFlowTools } from "./tools/cash-flow-tools.js"; import { taxTools } from "./tools/tax-tools.js"; import { analyticsTools } from "./tools/analytics-tools.js"; import { chartTools } from "./tools/chart-tools.js"; import { complianceTools } from "./tools/compliance-tools.js"; import { propertyTools } from "./tools/property-tools-simple.js"; const server = new Server( { name: "excel-finance-mcp", version: "1.0.0", }, { capabilities: { tools: {}, }, } ); const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];
- src/excel/excel-manager.ts:166-172 (helper)ExcelManager.addWorksheet method implementation using underlying ExcelJS Workbook.addWorksheet.async addWorksheet(name: string): Promise<void> { if (!this.workbook) { throw new Error('No workbook is currently open'); } this.workbook.addWorksheet(name); }