Skip to main content
Glama
marekrost

mcp-server-spreadsheet

read_cell

Extract a single cell's value from spreadsheet files. Returns numbers as integers/floats, text as strings, and empty cells as null.

Instructions

Read the value of a single cell.

Returns the cell's value: numbers as int/float, text as string, and empty cells as null.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
cellYesCell reference in A1 notation, e.g. 'B3' or '$B$3'
sheetNoSheet name. Defaults to the first sheet if omitted.

Implementation Reference

  • The implementation of the 'read_cell' tool, which uses 'load_workbook' and 'parse_cell' to retrieve a cell's value.
    @mcp.tool()
    def read_cell(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        cell: Annotated[str, Field(description="Cell reference in A1 notation, e.g. 'B3' or '$B$3'")],
        sheet: Annotated[str | None, Field(description="Sheet name. Defaults to the first sheet if omitted.")] = None,
    ):
        """Read the value of a single cell.
    
        Returns the cell's value: numbers as int/float, text as string,
        and empty cells as null.
        """
        wb = load_workbook(file)
        ws = _resolve_sheet(wb, sheet)
        row, col = parse_cell(cell)
        return ws.cell_value(row, col)

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