Skip to main content
Glama
marekrost

mcp-server-spreadsheet

delete_sheet

Remove a specific sheet from a spreadsheet file to delete its data permanently. Works with .xlsx and .ods formats.

Instructions

Delete a sheet by name from the workbook.

All data in the sheet is permanently removed. Not supported for CSV files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
nameYesName of the sheet to delete

Implementation Reference

  • The MCP tool handler for 'delete_sheet', which loads the workbook, deletes the sheet using the backend's delete_sheet method, saves the changes, and returns a confirmation string.
    def delete_sheet(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        name: Annotated[str, Field(description="Name of the sheet to delete")],
    ) -> str:
        """Delete a sheet by name from the workbook.
    
        All data in the sheet is permanently removed. Not supported for CSV files.
        """
        wb = load_workbook(file)
        wb.delete_sheet(name)
        wb.save(file)
        return f"Deleted sheet {name!r}"

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