Skip to main content
Glama
marekrost

mcp-server-spreadsheet

insert_columns

Add blank columns to spreadsheets by specifying position and quantity, shifting existing columns right to organize data.

Instructions

Insert one or more blank columns, shifting existing columns right.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath to the spreadsheet file
columnYes1-based column index where new columns will be inserted (e.g. 1 = A, 2 = B). Existing columns at and to the right shift right.
countNoNumber of blank columns to insert
sheetNoSheet name. Defaults to the first sheet if omitted.

Implementation Reference

  • The 'insert_columns' tool handler implemented in src/mcp_server_spreadsheet/server.py.
    def insert_columns(
        file: Annotated[str, Field(description="Path to the spreadsheet file")],
        column: Annotated[int, Field(description="1-based column index where new columns will be inserted (e.g. 1 = A, 2 = B). Existing columns at and to the right shift right.")],
        count: Annotated[int, Field(description="Number of blank columns to insert")] = 1,
        sheet: Annotated[str | None, Field(description="Sheet name. Defaults to the first sheet if omitted.")] = None,
    ) -> str:
        """Insert one or more blank columns, shifting existing columns right."""
        wb = load_workbook(file)
        ws = _resolve_sheet(wb, sheet)
        ws.insert_cols(column, count)
        wb.save(file)
        return f"Inserted {count} columns at column {column}"

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