Skip to main content
Glama
marekrost

mcp-server-spreadsheet

rename_sheet

Change the name of a sheet in a spreadsheet file by specifying the current name and desired new name.

Instructions

Rename an existing sheet in the workbook.

Returns the new sheet name on success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
old_nameYesCurrent name of the sheet to rename
new_nameYesNew name for the sheet

Implementation Reference

  • Handler function for the rename_sheet tool which renames a sheet in a workbook.
    def rename_sheet(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        old_name: Annotated[str, Field(description="Current name of the sheet to rename")],
        new_name: Annotated[str, Field(description="New name for the sheet")],
    ) -> str:
        """Rename an existing sheet in the workbook.
    
        Returns the new sheet name on success.
        """
        wb = load_workbook(file)
        ws = wb.get_sheet(old_name)
        ws.title = new_name
        wb.save(file)
        return new_name

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/marekrost/mcp-server-spreadsheet'

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