Skip to main content
Glama

xlwings Excel MCP Server

by hyunjae-labs

create_pivot_table

Generate pivot tables in Excel by specifying source data, row/column labels, values, and aggregation functions. Automate data summarization and analysis for improved insights directly within your worksheets.

Instructions

Create pivot table in worksheet.

Args: filepath: Path to Excel file sheet_name: Name of worksheet containing source data data_range: Source data range (e.g., "A1:E100" or "Sheet2!A1:E100") rows: Field names for row labels values: Field names for values columns: Field names for column labels (optional) agg_func: Aggregation function (sum, count, average, max, min) target_sheet: Target sheet for pivot table (optional, auto-created if not exists) target_cell: Target cell for pivot table (optional, finds empty area if not provided) pivot_name: Custom name for pivot table (optional, auto-generated if not provided)

Input Schema

NameRequiredDescriptionDefault
agg_funcNomean
columnsNo
data_rangeYes
filepathYes
pivot_nameNo
rowsYes
sheet_nameYes
target_cellNo
target_sheetNo
valuesYes

Input Schema (JSON Schema)

{ "properties": { "agg_func": { "default": "mean", "title": "Agg Func", "type": "string" }, "columns": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Columns" }, "data_range": { "title": "Data Range", "type": "string" }, "filepath": { "title": "Filepath", "type": "string" }, "pivot_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Pivot Name" }, "rows": { "items": { "type": "string" }, "title": "Rows", "type": "array" }, "sheet_name": { "title": "Sheet Name", "type": "string" }, "target_cell": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Target Cell" }, "target_sheet": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Target Sheet" }, "values": { "items": { "type": "string" }, "title": "Values", "type": "array" } }, "required": [ "filepath", "sheet_name", "data_range", "rows", "values" ], "title": "create_pivot_tableArguments", "type": "object" }

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/hyunjae-labs/xlwings-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server