Skip to main content
Glama

excel_create_named_range

Define named ranges in Excel workbooks to simplify financial formulas, improve formula readability, and streamline financial modeling workflows.

Instructions

Create a named range in the workbook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
rangeYes
worksheetNameNo

Implementation Reference

  • Core handler method in ExcelManager class that creates the named range using ExcelJS workbook.definedNames.add()
    async createNamedRange(name: string, range: string, worksheetName?: string): Promise<void> { if (!this.workbook) { throw new Error('No workbook is currently open'); } const fullRange = worksheetName ? `${worksheetName}!${range}` : range; this.workbook.definedNames.add(name, fullRange); }
  • Tool object definition including name, description, input schema, and thin wrapper handler that calls ExcelManager.createNamedRange and handles ToolResult
    { name: "excel_create_named_range", description: "Create a named range in the workbook", inputSchema: { type: "object", properties: { name: { type: "string" }, range: { type: "string" }, worksheetName: { type: "string" } }, required: ["name", "range"] }, handler: async (args: any): Promise<ToolResult> => { try { await excelManager.createNamedRange(args.name, args.range, args.worksheetName); return { success: true, message: `Created named range: ${args.name}` }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },
  • src/index.ts:32-44 (registration)
    Main MCP server aggregates excelTools (containing excel_create_named_range) into allTools list used for tool listing and execution
    const allTools = [ ...excelTools, ...financialTools, ...rentalTools, ...expenseTools, ...reportingTools, ...cashFlowTools, ...taxTools, ...analyticsTools, ...chartTools, ...complianceTools, ...propertyTools, ];
  • Input schema defining parameters for the excel_create_named_range tool: name (string, required), range (string, required), worksheetName (string, optional)
    inputSchema: { type: "object", properties: { name: { type: "string" }, range: { type: "string" }, worksheetName: { type: "string" } }, required: ["name", "range"] },

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/jeremycharlesgillespie/excel-mcp'

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