Excel File and Data Operations
Contents
[
Hide
]
Excel File and Data Operations
Manage Excel files and data operations with AI-powered automation. Create Excel workbooks, manage worksheets, and perform Excel data read/write operations.
Available Tools
create_workbook
- Create new Excel workbooks with AI Excel automationcreate_worksheet
- Add Excel worksheets to existing Excel workbooksget_workbook_info
- Get Excel workbook metadata and informationread_data_from_excel
- Read data from Excel worksheets with AI-powered precisionwrite_data_to_excel
- Write data to Excel worksheets through Excel MCP
Create Excel Workbooks
Create Basic Workbook
{
"tool": "create_workbook",
"parameters": {
"filepath": "reports/sales-report.xlsx"
}
}
Create Workbook with Custom Sheet
{
"tool": "create_workbook",
"parameters": {
"filepath": "reports/financial-report.xlsx",
"sheet_name": "Financial Data"
}
}
Manage Worksheets
Add New Worksheet
{
"tool": "create_worksheet",
"parameters": {
"filepath": "reports/sales-report.xlsx",
"sheet_name": "Summary Report"
}
}
Get Workbook Information
{
"tool": "get_workbook_info",
"parameters": {
"filepath": "reports/sales-report.xlsx"
}
}
Write Excel Data
Write Headers and Data
{
"tool": "write_data_to_excel",
"parameters": {
"filepath": "reports/sales-report.xlsx",
"sheet_name": "Sales Data",
"data": [
["Product", "Category", "Unit Price", "Quantity", "Total", "Status"],
["Laptop Pro", "Electronics", 1299.99, 5, "", "In Stock"],
["Wireless Mouse", "Electronics", 89.99, 15, "", "In Stock"],
["Office Chair", "Furniture", 299.99, 8, "", "Low Stock"]
]
}
}
Write Data to Custom Position
{
"tool": "write_data_to_excel",
"parameters": {
"filepath": "reports/analysis.xlsx",
"sheet_name": "Data Analysis",
"start_cell": "C3",
"data": [
["Name", "Score", "Grade", "Double Score", "Bonus"],
["Alice", 95, "A", "", ""],
["Bob", 87, "B", "", ""],
["Charlie", 92, "A", "", ""]
]
}
}
Read Excel Data
Read Full Used Range
{
"tool": "read_data_from_excel",
"parameters": {
"filepath": "reports/sales-report.xlsx",
"sheet_name": "Sales Data"
}
}
Read Specific Range
{
"tool": "read_data_from_excel",
"parameters": {
"filepath": "reports/analysis.xlsx",
"sheet_name": "Data Analysis",
"start_cell": "C3",
"end_cell": "G6"
}
}
Read from Default Position
{
"tool": "read_data_from_excel",
"parameters": {
"filepath": "reports/basic-data.xlsx",
"sheet_name": "Sheet1",
"start_cell": "A1"
}
}
Complete Workflow Example
1. Create Your First Excel Report
{
"tool": "create_workbook",
"parameters": {
"filepath": "reports/monthly-report.xlsx",
"sheet_name": "Monthly Sales"
}
}
2. Add Summary Sheet
{
"tool": "create_worksheet",
"parameters": {
"filepath": "reports/monthly-report.xlsx",
"sheet_name": "Summary"
}
}
3. Write Sales Data
{
"tool": "write_data_to_excel",
"parameters": {
"filepath": "reports/monthly-report.xlsx",
"sheet_name": "Monthly Sales",
"data": [
["Month", "Product", "Sales", "Target", "Variance"],
["January", "Product A", 5000, 4500, ""],
["January", "Product B", 3200, 3000, ""],
["February", "Product A", 5500, 4500, ""],
["February", "Product B", 3400, 3000, ""]
]
}
}
4. Verify Data
{
"tool": "read_data_from_excel",
"parameters": {
"filepath": "reports/monthly-report.xlsx",
"sheet_name": "Monthly Sales",
"start_cell": "A1",
"end_cell": "E5"
}
}
5. Check Workbook Structure
{
"tool": "get_workbook_info",
"parameters": {
"filepath": "reports/monthly-report.xlsx"
}
}
Best Practices
- File Paths: Use relative paths for better portability
- Sheet Names: Use descriptive names for worksheets
- Data Structure: Organize data with clear headers
- Range Reading: Specify ranges for large datasets
- Error Handling: Verify file existence before operations
Common Patterns
Data Import Pattern
- Create workbook
- Write raw data
- Read back to verify
- Process with formulas
Multi-Sheet Reports
- Create workbook with main sheet
- Add summary/analysis sheets
- Write data to each sheet
- Link sheets with formulas
Data Validation
- Write data
- Read back specific ranges
- Verify data integrity
- Handle missing values