Skip to main content
Glama
marekrost

mcp-server-spreadsheet

list_sheets

Retrieve all sheet names from a spreadsheet file to identify available worksheets for data processing or analysis.

Instructions

List all sheet names in a workbook, in workbook order.

Returns a list of sheet name strings. CSV files always return a single sheet named 'default'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file

Implementation Reference

  • The handler function for the 'list_sheets' tool, which uses 'load_workbook' to open the file and return its sheet names.
    @mcp.tool()
    def list_sheets(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
    ) -> list[str]:
        """List all sheet names in a workbook, in workbook order.
    
        Returns a list of sheet name strings. CSV files always return
        a single sheet named 'default'.
        """
        wb = load_workbook(file)
        return wb.sheetnames

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