Tool reference

All 28 MCP tools organized by category.

Session management

create_session

Create a new workbook session. Returns a session ID for subsequent calls.

close_session

Close a session and release all associated resources.

Parameters:
session_idstring— Session to close

session_status

Get session info including open workbook count.

Parameters:
session_idstring— Session to query

Workbook operations

create_workbook

Create a new .xlsx workbook within a session.

Parameters:
session_idstring— Target session

open_workbook

Open an existing .xlsx file from disk.

Parameters:
session_idstring— Target session
file_pathstring— Path to .xlsx file

save_workbook

Save workbook to disk.

Parameters:
session_idstring— Target session
workbook_idstring— Workbook to save
file_pathstring— Output path

close_workbook

Close a workbook within a session.

Parameters:
session_idstring— Target session
workbook_idstring— Workbook to close

Sheet management

add_sheet

Add a new worksheet to a workbook.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring— Name for the new sheet

list_sheets

List all sheets in a workbook.

Parameters:
session_idstring—
workbook_idstring—

rename_sheet

Rename a worksheet.

Parameters:
session_idstring—
workbook_idstring—
old_namestring— Current name
new_namestring— New name

Cell & range

write_cell

Write a value to a single cell.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
cell_referencestring— e.g. A1
valueany— string, number, boolean, or date

read_cell

Read a value from a single cell.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
cell_referencestring— e.g. A1

write_range

Write values to a cell range (2D array).

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring— e.g. A1:C10
valuesunknown[][]— 2D array of values

read_range

Read values from a cell range.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring— e.g. A1:C10

Formatting

apply_format

Apply font, fill, border, and alignment to a range.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring—
formatobject— Format options

set_column_width

Set column width.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
columnstring— Column letter
widthnumber— Width in characters

set_row_height

Set row height.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rownumber— Row number
heightnumber— Height in points

merge_cells

Merge a cell range.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring—

unmerge_cells

Unmerge a cell range.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring—

Formulas

set_formula

Set a formula on a cell.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
cell_referencestring—
formulastring— e.g. SUM(A1:A10)

get_formula

Read the formula text from a cell.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
cell_referencestring—

calculate

Trigger formula recalculation.

Parameters:
session_idstring—
workbook_idstring—

Data validation

add_data_validation

Add a validation rule to a range.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring—
validation_typestring— list, number, date, custom
criteriaobject— Validation criteria

remove_data_validation

Remove validation from a range.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
rangestring—

Charts

add_chart

Add a chart to a sheet.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
chart_typestring— bar, line, pie, scatter
data_rangestring— Range containing data
titlestring— Chart title

list_charts

List all charts in a sheet.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—

remove_chart

Remove a chart from a sheet.

Parameters:
session_idstring—
workbook_idstring—
sheet_namestring—
chart_idstring— Chart to remove