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_idstringSession to close

session_status

Get session info including open workbook count.

Parameters:
session_idstringSession to query

Workbook operations

create_workbook

Create a new .xlsx workbook within a session.

Parameters:
session_idstringTarget session

open_workbook

Open an existing .xlsx file from disk.

Parameters:
session_idstringTarget session
file_pathstringPath to .xlsx file

save_workbook

Save workbook to disk.

Parameters:
session_idstringTarget session
workbook_idstringWorkbook to save
file_pathstringOutput path

close_workbook

Close a workbook within a session.

Parameters:
session_idstringTarget session
workbook_idstringWorkbook to close

Sheet management

add_sheet

Add a new worksheet to a workbook.

Parameters:
session_idstring
workbook_idstring
sheet_namestringName 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_namestringCurrent name
new_namestringNew name

Cell & range

write_cell

Write a value to a single cell.

Parameters:
session_idstring
workbook_idstring
sheet_namestring
cell_referencestringe.g. A1
valueanystring, number, boolean, or date

read_cell

Read a value from a single cell.

Parameters:
session_idstring
workbook_idstring
sheet_namestring
cell_referencestringe.g. A1

write_range

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

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

read_range

Read values from a cell range.

Parameters:
session_idstring
workbook_idstring
sheet_namestring
rangestringe.g. A1:C10

Formatting

apply_format

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

Parameters:
session_idstring
workbook_idstring
sheet_namestring
rangestring
formatobjectFormat options

set_column_width

Set column width.

Parameters:
session_idstring
workbook_idstring
sheet_namestring
columnstringColumn letter
widthnumberWidth in characters

set_row_height

Set row height.

Parameters:
session_idstring
workbook_idstring
sheet_namestring
rownumberRow number
heightnumberHeight 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
formulastringe.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_typestringlist, number, date, custom
criteriaobjectValidation 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_typestringbar, line, pie, scatter
data_rangestringRange containing data
titlestringChart 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_idstringChart to remove