# Excel

Microsoft Excel is a powerful spreadsheet application for data analysis, calculations, and visualization, enabling users to organize and process data with formulas, charts, and pivot tables

- **Category:** spreadsheets
- **Auth:** OAUTH2
- **Composio Managed App Available?** Yes
- **Tools:** 52
- **Triggers:** 0
- **Slug:** `EXCEL`
- **Version:** 20260323_00

## Tools

### Add Chart

**Slug:** `EXCEL_ADD_CHART`

Add a chart to a worksheet using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `type` | string | Yes | The type of chart to add (e.g., 'ColumnClustered'). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. If not provided, uses 'me/drive' (requires delegated auth). For application auth (s2s_oauth), provide the drive ID. |
| `seriesby` | string | Yes | How the series are by (e.g., 'Auto'). |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |
| `sourcedata` | string | Yes | The range of source data for the chart (e.g., 'A1:C4'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add SharePoint Worksheet

**Slug:** `EXCEL_ADD_SHAREPOINT_WORKSHEET`

Add a new worksheet to a SharePoint Excel workbook using Microsoft Graph Sites API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The name of the new worksheet to add. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) to add a worksheet to. |
| `site_id` | string | Yes | The ID of the SharePoint site containing the Excel file. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Table

**Slug:** `EXCEL_ADD_TABLE`

Create a new table in a worksheet using the Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | string | Yes | The range address for the table. If worksheet is specified, use a range like 'A1:D4'. If worksheet is omitted, include the sheet name (e.g., 'Sheet1!A1:D4'). |
| `item_id` | string | Yes | The ID of the Excel workbook (drive item) where the table will be created. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `worksheet` | string | No | Worksheet name or ID. When provided, the table is created on this worksheet and the address should be a range like 'A1:D4'. When omitted, the table is created at the workbook level and the address must include the sheet name prefix (e.g., 'Sheet1!A1:D4'). |
| `hasHeaders` | boolean | Yes | Whether the first row of the range contains column headers (True) or not (False). |
| `session_id` | string | No | Workbook session ID controlling persistence. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Table Column

**Slug:** `EXCEL_ADD_TABLE_COLUMN`

Add a column to a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `index` | integer | Yes | The index at which to insert the column. |
| `values` | array | Yes | The values for the new column. MUST include exactly one value for each row in the table, including the header row. Use list table rows to get the correct number of values needed. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, defaults to 'me' for delegated auth or must be provided for application-only auth. |
| `table_id` | string | Yes | The ID of the table to add a column to. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Table Row

**Slug:** `EXCEL_ADD_TABLE_ROW`

Add a row to a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `index` | integer | No | The 0-based index at which to insert the row. Use null or omit to append to the end (recommended). |
| `values` | array | Yes | A 2D array of values for the new row(s). Each inner array represents one row and MUST have the same number of elements as the table has columns. Use List Table Columns action to verify the table structure first. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. Use 'me' for the user's default OneDrive (delegated auth), or provide a specific drive ID for SharePoint sites or when using application permissions. |
| `table_id` | string | Yes | The ID of the table to add a row to. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Workbook Permission

**Slug:** `EXCEL_ADD_WORKBOOK_PERMISSION`

Tool to grant access to a workbook via invite. Use when you need to share a specific workbook file with designated recipients and roles.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `roles` | array | Yes | Roles to grant: read or write. |
| `item_id` | string | Yes | The ID of the drive item (Excel file) to share. |
| `message` | string | No | Plain-text message included in the invitation (max 2000 characters). |
| `site_id` | string | No | The ID of the SharePoint site containing the Excel file. Required for application-level auth when the file is not in the root site. |
| `drive_id` | string | No | The ID of the document library (drive) containing the Excel file. If not provided, the site's default drive is used. |
| `password` | string | No | Password for the invite (OneDrive Personal only). |
| `recipients` | array | Yes | Collection of recipients to grant access and send the invitation. |
| `requireSignIn` | boolean | No | If true, recipients must sign in to view the shared item. |
| `sendInvitation` | boolean | No | If true, sends an email invitation; otherwise grants permission silently. |
| `expirationDateTime` | string | No | DateTime when the granted permission will expire (ISO 8601). |
| `retainInheritedPermissions` | boolean | No | If true, existing inherited permissions remain; if false, existing permissions are removed on first share. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Add Worksheet

**Slug:** `EXCEL_ADD_WORKSHEET`

Add a new worksheet to an Excel workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | The name of the new worksheet to add. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) to add a worksheet to. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, will attempt to use 'me' for delegated permissions. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Apply Table Filter

**Slug:** `EXCEL_APPLY_TABLE_FILTER`

Apply a filter to a table column using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `criteria` | object | Yes | The filter criteria as a dictionary. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. Use 'me' for the user's default OneDrive, or provide a specific drive ID for SharePoint sites or app-only auth. |
| `table_id` | string | Yes | The ID of the table. |
| `column_id` | string | Yes | The ID of the column to filter. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Apply Table Sort

**Slug:** `EXCEL_APPLY_TABLE_SORT`

Apply a sort to a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | Yes | List of sort fields (e.g., [{ 'key': 0, 'ascending': true }]). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. Required when using application permissions (not /me). Use the drive ID where the Excel file is located. |
| `table_id` | string | Yes | The ID of the table to sort. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Clear Range

**Slug:** `EXCEL_CLEAR_RANGE`

Tool to clear values, formats, or contents in a specified worksheet range. Use when you need to reset cells before adding new data.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | string | Yes | The A1-style address of the range to clear (e.g., 'A1:B2'). |
| `applyTo` | string ("All" | "Formats" | "Contents") | No | Optional. The type of clear action. Possible values: All, Formats, Contents. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `site_id` | string | No | Optional. The SharePoint site ID (format: hostname,site-collection-id,site-id). Required when using application permissions (s2s_oauth) with SharePoint files. Not needed for OneDrive files with delegated permissions. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth) with OneDrive files. If not provided, falls back to site_id or /me/drive endpoint. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `session_id` | string | No | Optional. The workbook session ID for persistent changes. Must be obtained from EXCEL_GET_SESSION (createSession API) - do not construct manually. Format starts with 'cluster=' followed by session data. Invalid or expired sessions will cause API errors. |
| `worksheet_id` | string | Yes | The name or ID of the worksheet (URL-encoded if necessary). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Clear Table Filter

**Slug:** `EXCEL_CLEAR_TABLE_FILTER`

Clear a filter from a table column using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `table_id` | string | Yes | The ID of the table. |
| `column_id` | string | Yes | The ID of the column to clear filter from. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Close Excel Session

**Slug:** `EXCEL_CLOSE_SESSION`

Tool to close an existing Excel workbook session. Use when you need to explicitly end a persistent session to release workbook locks. Note: The Microsoft Graph closeSession API is idempotent - it returns 204 for both active and already-closed sessions. This action validates the session first and returns an error for invalid or already-closed sessions to provide clearer user feedback. The validation uses refreshSession which is the only API endpoint that can detect closed sessions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) to close the session for. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. |
| `session_id` | string | Yes | The workbook session ID to close. Must be a valid session ID format obtained from EXCEL_GET_SESSION. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Convert Table To Range

**Slug:** `EXCEL_CONVERT_TABLE_TO_RANGE`

Convert a table to a range using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `table_id` | string | Yes | The ID of the table to convert to a range. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Workbook

**Slug:** `EXCEL_CREATE_WORKBOOK`

Tool to create a new Excel workbook file at a specified drive path. Generates a new .xlsx file with specified worksheets and data, then uploads it to OneDrive.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `path` | string | Yes | Path including folder structure and file name, ending with .xlsx, e.g., 'Documents/newWorkbook.xlsx' |
| `drive_id` | string | No | ID of the drive (use 'me' for the user's default drive) |
| `worksheet_data` | object | No | Data to populate worksheets. Dict mapping worksheet names to lists of rows (each row is a list of cell values). Example: {'Sheet1': [['Name', 'Points'], ['LeBron', 40000], ['Jordan', 32292]]} |
| `worksheet_names` | array | No | List of worksheet names to create in the workbook. If not provided, a single worksheet named 'Sheet1' will be created. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Table Column

**Slug:** `EXCEL_DELETE_TABLE_COLUMN`

Delete a column from a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, defaults to 'me' for delegated auth or must be provided for application-only auth. |
| `table_id` | string | Yes | The ID of the table to delete a column from. |
| `column_id` | string | Yes | The ID of the column to delete. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Table Row

**Slug:** `EXCEL_DELETE_TABLE_ROW`

Delete a row from a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. Use 'me' for the user's default OneDrive, or provide a specific drive ID for SharePoint sites. |
| `table_id` | string | Yes | The ID of the table to delete a row from. |
| `row_index` | integer | Yes | The index of the row to delete. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Worksheet

**Slug:** `EXCEL_DELETE_WORKSHEET`

Tool to delete a worksheet from the workbook. Use when cleaning up unused or temporary sheets after verifying no dependencies exist. Example: "Delete 'Sheet2' after review."

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, defaults to 'me' for delegated auth or must be provided for application-only auth. |
| `worksheet` | string | Yes | The name or ID of the worksheet to delete. If using ID, it must be URL-encoded. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Export Workbook to PDF

**Slug:** `EXCEL_EXPORT_WORKBOOK_TO_PDF`

Tool to export an Excel workbook to PDF via Microsoft Graph's format conversion. Use when you need a PDF version of an Excel file for sending, storing, or attaching.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | ID of the Excel file (DriveItem) to convert to PDF. |
| `drive_id` | string | No | Required when drive_scope is 'drives' or 'sites'. The drive ID or site ID. |
| `drive_scope` | string ("me" | "drives" | "sites") | No | The drive scope type: 'me' for user's OneDrive, 'drives' for specific drive ID, 'sites' for SharePoint site. |
| `save_pdf_to_path` | string | No | Optional path where the converted PDF should be uploaded back to Drive (e.g., 'Documents/invoice.pdf'). If provided, the tool downloads the PDF and uploads it to this location. |
| `return_download_url_only` | boolean | No | If true, only return the preauthenticated download URL. If false, fetch additional metadata about the source item. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Chart Axis

**Slug:** `EXCEL_GET_CHART_AXIS`

Tool to retrieve a specific axis from a chart. Use when you need properties like min, max, interval, and formatting of the chart axis.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `expand` | string | No | OData $expand query option to expand related entities (format). |
| `select` | string | No | OData $select query option to specify which properties to return. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the workbook. |
| `drive_id` | string | No | Optional drive ID. If provided, uses /drives/{drive_id}/items/{item_id} endpoint (required for application permissions). If not provided, uses /me/drive/items/{item_id} endpoint (for delegated permissions). |
| `axis_type` | string ("valueAxis" | "seriesAxis" | "categoryAxis") | Yes | The type of axis to retrieve. Allowed values: 'valueAxis', 'seriesAxis', 'categoryAxis'. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `chart_name` | string | Yes | The name or ID of the chart (must be URL-encoded). |
| `session_id` | string | No | Optional workbook session ID. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Chart Data Labels

**Slug:** `EXCEL_GET_CHART_DATA_LABELS`

Tool to retrieve the data labels object of a chart. Use when you need to inspect label settings like position, separator, and visibility flags after creating or updating a chart.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the workbook. |
| `chart_id` | string | Yes | The ID or name of the chart (must be URL-encoded if using special characters). |
| `drive_id` | string | No | Optional drive ID. If not provided, defaults to 'me' (user's default drive). |
| `session_id` | string | No | Optional workbook session ID. If provided, will be sent in the headers to maintain session state. |
| `worksheet_id` | string | Yes | The ID or name of the worksheet (must be URL-encoded if using special characters). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Chart Legend

**Slug:** `EXCEL_GET_CHART_LEGEND`

Tool to retrieve the legend object of a chart. Use after creating or updating a chart when you need to inspect legend visibility and formatting.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `expand` | string | No | OData $expand query option to expand related entities, such as format. |
| `select` | string | No | OData $select query option to specify which properties to return (comma-separated). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the workbook. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `chart_name` | string | Yes | The name or ID of the chart (URL-encoded if necessary). |
| `session_id` | string | No | Optional workbook session ID. If provided, will be sent in the headers to maintain session state. |
| `worksheet_id` | string | Yes | The ID or name of the worksheet (URL-encoded if necessary). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Range

**Slug:** `EXCEL_GET_RANGE`

Get a range from a worksheet using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | string | Yes | Valid Excel range address or named range. Cell ranges: A1, A1:B2, A:A, Sheet1!A1:B2. Named ranges: must start with letter/underscore, no spaces (use underscores: Sales_Tax not Sales Tax). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. If provided, uses /drives/{drive_id}/items/{item_id} endpoint (required for application permissions). If not provided, uses /me/drive/items/{item_id} endpoint (for delegated permissions). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |
| `worksheet_id` | string | Yes | The ID or name of the worksheet (required, cannot be empty). Provide the sheet name (e.g., 'Sheet1') or its unique ID. Use the list worksheets action if you need to find available worksheet names or IDs. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Excel Session

**Slug:** `EXCEL_GET_SESSION`

Create a session for an Excel workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The OneDrive drive item ID of the Excel file (.xlsx). Valid OneDrive item IDs are alphanumeric strings at least 10 characters long (e.g., '01LLJYZ3EAWWGPCTABGZALJJUKANV2PRLI'). Get valid item IDs from the EXCEL_LIST_FILES action. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. |
| `persist_changes` | boolean | No | Whether changes should be persisted after the session. If false, a nonpersistent session is created. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get SharePoint Range

**Slug:** `EXCEL_GET_SHAREPOINT_RANGE`

Get a range from a worksheet in SharePoint using Microsoft Graph Sites API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `address` | string | Yes | The address of the range (e.g., 'A1:B2'). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `site_id` | string | Yes | The ID of the SharePoint site containing the Excel file. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |
| `worksheet_id` | string | Yes | The ID of the worksheet. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get SharePoint Worksheet

**Slug:** `EXCEL_GET_SHAREPOINT_WORKSHEET`

Get a worksheet by name or ID from a SharePoint Excel workbook using Microsoft Graph Sites API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) to get the worksheet from. |
| `site_id` | string | Yes | The ID of the SharePoint site containing the Excel file. |
| `worksheet` | string | Yes | The name or ID of the worksheet to retrieve. If using ID, it must be URL-encoded. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get table column

**Slug:** `EXCEL_GET_TABLE_COLUMN`

Tool to retrieve a specific column from a workbook table. Use when you need to fetch column properties and data by its ID or name.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `site_id` | string | No | Optional SharePoint site ID. Required when using application permissions (s2s_oauth). Format: 'hostname,spSiteId,spWebId' |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth) with OneDrive files. If not provided, falls back to site_id or /me/drive endpoint. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `table_id` | string | Yes | The ID or name of the table containing the column. |
| `column_id` | string | Yes | The ID or name of the column to retrieve. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get workbook

**Slug:** `EXCEL_GET_WORKBOOK`

Tool to retrieve the properties and relationships of a workbook. Use when you need to inspect comments, names, tables, or worksheets.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `expand` | array | No | OData relationships to expand in the response. |
| `item_id` | string | Yes | Graph API item ID (e.g., '01RWIO2VKO5Q4ECCKUL5BYFHITS5UOQPBH') or file path (e.g., 'Budget.xlsx' or 'Documents/Budget.xlsx'). Item IDs are opaque alphanumeric strings obtained from list/search operations. If a path is provided (containing .xlsx or /), path-based addressing will be used. |
| `drive_id` | string | Yes | ID of the drive (use 'me' for the user's default drive). |
| `session_id` | string | No | Optional workbook session ID. If provided, will be sent in headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Worksheet

**Slug:** `EXCEL_GET_WORKSHEET`

Get a worksheet by name or ID from an Excel workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) to get the worksheet from. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. Required for SharePoint files or when using app-only authentication. Use 'me' for delegated auth with user's OneDrive, or provide the specific drive ID for SharePoint sites. |
| `worksheet` | string | Yes | The name or ID of the worksheet to retrieve. If using ID, it must be URL-encoded. |
| `session_id` | string | No | Optional workbook session ID. Must be a valid session ID obtained from the EXCEL_GET_SESSION (createSession) action. Do NOT pass arbitrary strings - only use session IDs returned by createSession. If you don't have a valid session ID, leave this empty. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Worksheet Used Range

**Slug:** `EXCEL_GET_WORKSHEET_USED_RANGE`

Tool to retrieve a worksheet's used range (active data region) without specifying a fixed range address. Use when you need to read all data from a sheet but don't know the exact range. The valuesOnly option helps filter out formatting-only cells.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | Yes | The ID of the drive (e.g., 'me' for the user's default OneDrive, or a specific drive ID for SharePoint). |
| `session_id` | string | No | Optional workbook session ID. If provided, will be sent in the workbook-session-id header. Must be a valid session ID obtained from the createSession action. |
| `values_only` | boolean | No | If true, only returns cells with values (ignores formatting-only cells). Maps to valuesOnly parameter in the API. |
| `worksheet_id` | string | Yes | The ID or name of the worksheet. Can be the worksheet name (e.g., 'Sheet1') or its unique ID. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Insert Range

**Slug:** `EXCEL_INSERT_RANGE`

Tool to insert a new cell range into a worksheet, shifting existing cells down or right. Use when you need to create space for new content without overwriting.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `shift` | string ("Down" | "Right") | Yes | Direction to shift cells to make space: 'Down' or 'Right'. |
| `address` | string | Yes | The address of the range (e.g., 'A1:B2'). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, defaults to 'me' for delegated auth or must be provided for application-only auth. |
| `session_id` | string | No | Optional workbook session ID. If provided, changes persist in that session. |
| `worksheet_id` | string | Yes | The ID or name of the worksheet. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Charts

**Slug:** `EXCEL_LIST_CHARTS`

List charts in a worksheet using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `worksheet` | string | Yes | The name or ID of the worksheet. Do not include surrounding quotes - provide the plain worksheet name (e.g., 'Sheet1' not "'Sheet1'"). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Chart Series

**Slug:** `EXCEL_LIST_CHART_SERIES`

Tool to list all data series in a chart. Use when you need to enumerate chart series for further analysis.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `chart_name` | string | Yes | The name or ID of the chart (must be URL-encoded). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Comments

**Slug:** `EXCEL_LIST_COMMENTS`

Tool to list comments in an Excel workbook. Use when you need to retrieve all workbook comments via Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) to list comments for. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, will attempt to use 'me' for delegated permissions. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Drive Item Children

**Slug:** `EXCEL_LIST_DRIVE_ITEM_CHILDREN`

Tool to list immediate children (files/folders) of a folder DriveItem using driveId and itemId. Returns an array of child DriveItems with stable identifiers and pagination support.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | Graph API item ID of the folder DriveItem whose children to enumerate. Must be an opaque alphanumeric identifier obtained from list/search operations or shares resolution. |
| `drive_id` | string | Yes | ID of the drive containing the folder (use 'me' for the user's default drive). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Drive Files

**Slug:** `EXCEL_LIST_FILES`

List files and folders in a drive root or specified path.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `path` | string | No | Optional folder path under root to list. E.g., 'Documents' |
| `drive_id` | string | No | ID of the drive (use 'me' for the user's default drive) |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Named Items

**Slug:** `EXCEL_LIST_NAMED_ITEMS`

List named items in a workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the workbook. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `session_id` | string | No | Optional session ID for the workbook. If not provided, a new session will be created automatically. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List SharePoint Tables

**Slug:** `EXCEL_LIST_SHAREPOINT_TABLES`

List tables in a SharePoint worksheet using Microsoft Graph Sites API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `site_id` | string | Yes | The ID of the SharePoint site containing the Excel file. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List SharePoint Worksheets

**Slug:** `EXCEL_LIST_SHAREPOINT_WORKSHEETS`

List worksheets in an Excel workbook stored in SharePoint using Microsoft Graph Sites API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) to list worksheets for. |
| `site_id` | string | Yes | The ID of the SharePoint site containing the Excel file. |
| `drive_id` | string | No | The ID of the document library (drive) containing the Excel file. Required if the file is not in the site's default document library. If not provided, the site's default drive is used. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Table Columns

**Slug:** `EXCEL_LIST_TABLE_COLUMNS`

List columns in a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | The ID of the drive containing the item. If not provided, will attempt to use 'me' for delegated auth. |
| `table_id` | string | Yes | The ID of the table to list columns from. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Table Rows

**Slug:** `EXCEL_LIST_TABLE_ROWS`

List rows in a table using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, will attempt to use 'me' for delegated permissions. |
| `table_id` | string | Yes | The name or ID of the table (e.g., 'Table1', 'MyTable'). Note: this must be a valid Excel table name/ID, not a worksheet name. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Tables

**Slug:** `EXCEL_LIST_TABLES`

List tables in a worksheet using Microsoft Graph API. This action retrieves information about all tables present in a specified worksheet of an Excel file. It requires the file ID and worksheet name or ID, and can optionally use a session ID for workbook operations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. |
| `worksheet` | string | Yes | The name or ID of the worksheet (e.g., 'Sheet1', '工作表', or '{00000000-0001-0000-0000-000000000000}'). URL encoding is handled automatically. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Workbook Permissions

**Slug:** `EXCEL_LIST_WORKBOOK_PERMISSIONS`

Tool to list permissions set on the workbook file. Use when you need to see which users or links have access to a specific Excel file by supplying its drive and item IDs. Example: "List permissions for workbook with drive_id 'b!abc123' and item_id '0123456789abcdef'."

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `top` | integer | No | Maximum number of permission objects to return. |
| `skip` | integer | No | Number of permission objects to skip. |
| `expand` | string | No | Comma-separated list of related entities to expand. |
| `select` | string | No | Comma-separated list of permission properties to include in the response. |
| `item_id` | string | Yes | The ID of the DriveItem representing the workbook. |
| `drive_id` | string | Yes | The ID of the drive containing the workbook file. Use 'me' for the current user's default OneDrive.  |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Worksheets

**Slug:** `EXCEL_LIST_WORKSHEETS`

List worksheets in an Excel workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) to list worksheets for. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, will attempt to use 'me' for delegated permissions. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Merge Cells

**Slug:** `EXCEL_MERGE_CELLS`

Merge cells in a worksheet range using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `range` | string | Yes | The A1-style address of the range to merge (e.g., 'A1:B2'). |
| `across` | boolean | No | Optional. Set true to merge cells in each row of the specified range as separate merged cells. The default value is false. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. If not provided, will use 'me' for delegated permissions. Required for application permissions. |
| `worksheet` | string | Yes | The name or ID of the worksheet containing the range to merge. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Protect Worksheet

**Slug:** `EXCEL_PROTECT_WORKSHEET`

Tool to protect a worksheet using optional protection options. Use when you need to prevent editing certain parts of a sheet before sharing. Example: "Protect 'Sheet1' to lock formatting and sorting."

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `options` | object | No | Sheet protection options. If omitted, default protection is applied. |
| `drive_id` | string | No | The ID of the drive containing the Excel file. If not provided, will attempt to use 'me' for delegated permissions. |
| `worksheet` | string | Yes | The name or ID of the worksheet to protect. If using ID, it must be URL-encoded. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Search Drive Files

**Slug:** `EXCEL_SEARCH_FILES`

Tool to search OneDrive drive items by query to discover Excel workbook IDs. Use when you need to find Excel files by name before performing workbook operations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `top` | integer | No | Maximum number of items to return. Uses $top query parameter if supported. |
| `query` | string | Yes | Search query text to find items (e.g., filename like 'roster.xlsx' or partial name). Matches across filename, metadata, and file content. |
| `scope` | string ("drive" | "root") | No | Search scope: 'drive' searches entire drive including items shared with current user; 'root' searches within user's drive hierarchy only. |
| `drive_id` | string | No | ID of the drive to search (use 'me' for the user's default drive in delegated auth, or a specific drive ID). |
| `file_extensions` | array | No | Optional list of file extensions to filter results (e.g., ['.xlsx', '.xlsm']). Applied as client-side filter to results. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Sort Range

**Slug:** `EXCEL_SORT_RANGE`

Sort a range in a worksheet using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `fields` | array | Yes | List of sort fields (e.g., [{ 'key': 0, 'ascending': true }]). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `site_id` | string | No | Optional SharePoint site ID. Required for application-level authentication (s2s_oauth). Format: 'hostname,spSiteId,spWebId'. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth) with OneDrive files. If not provided, falls back to site_id or /me/drive endpoint. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `range_type` | string | Yes | The type of range to sort (e.g., 'usedRange'). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Chart

**Slug:** `EXCEL_UPDATE_CHART`

Update a chart in a worksheet using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `top` | number | No | The new top position for the chart. |
| `left` | number | No | The new left position for the chart. |
| `name` | string | No | The new name for the chart. |
| `width` | number | No | The new width for the chart. |
| `height` | number | No | The new height for the chart. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `chart_id` | string | Yes | The ID of the chart (must be URL-encoded). |
| `drive_id` | string | No | The ID of the drive containing the Excel file. Optional for delegated auth, required for application auth (s2s_oauth). |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Chart Legend

**Slug:** `EXCEL_UPDATE_CHART_LEGEND`

Tool to update formatting or position of a chart legend. Use when adjusting legend settings after confirming chart and worksheet exist.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the workbook. |
| `overlay` | boolean | No | Set to true to make the legend overlap the chart body, or false otherwise. |
| `visible` | boolean | No | Set to true to show the chart legend, or false to hide it. |
| `chart_id` | string | Yes | The name or ID of the chart (must be URL-encoded). |
| `drive_id` | string | No | Optional drive ID. If not provided, will attempt to use /me/drive (requires delegated auth) or auto-detect from item. |
| `position` | string ("Top" | "Bottom" | "Left" | "Right" | "Corner" | "Custom") | No | The position of the legend on the chart. Possible values: Top, Bottom, Left, Right, Corner, Custom. |
| `worksheet` | string | Yes | The name or ID of the worksheet (must be URL-encoded if using ID). |
| `session_id` | string | No | Optional workbook session ID. If provided, will be sent in the 'workbook-session-id' header. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Range

**Slug:** `EXCEL_UPDATE_RANGE`

Update a range in a worksheet using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `values` | array | Yes | The values to update in the range. |
| `address` | string | Yes | The address of the range (e.g., 'A1:B2'). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `drive_id` | string | No | Optional drive ID. If provided, uses /drives/{drive_id}/items/{item_id} endpoint (required for application permissions). If not provided, uses /me/drive/items/{item_id} endpoint (for delegated permissions). |
| `session_id` | string | No | Optional session ID for the workbook, obtained from the createSession API (GET_SESSION action). Must be a valid, active session ID. Leave blank if not using sessions. |
| `worksheet_id` | string | Yes | The ID of the worksheet. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update SharePoint Range

**Slug:** `EXCEL_UPDATE_SHAREPOINT_RANGE`

Update a range in a SharePoint worksheet using Microsoft Graph Sites API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `values` | array | Yes | The values to update in the range. |
| `address` | string | Yes | The address of the range (e.g., 'A1:B2'). |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `site_id` | string | Yes | The ID of the SharePoint site containing the Excel file. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |
| `worksheet_id` | string | Yes | The ID of the worksheet. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Table

**Slug:** `EXCEL_UPDATE_TABLE`

Update a table in a workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The new name for the table. |
| `style` | string | No | The style of the table. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the table. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth). If not provided, uses /me/drive endpoint for delegated auth. |
| `table_id` | string | Yes | The ID of the table to update. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |
| `showTotals` | boolean | No | Whether the table shows totals. |
| `showHeaders` | boolean | No | Whether the table shows headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Worksheet

**Slug:** `EXCEL_UPDATE_WORKSHEET`

Update worksheet properties (name, position) in an Excel workbook using Microsoft Graph API.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | The new name for the worksheet. |
| `item_id` | string | Yes | The ID of the Excel file (drive item) containing the worksheet. |
| `site_id` | string | No | The ID of the SharePoint site containing the Excel file. Required when using application permissions (s2s_oauth). Not needed for delegated authentication. |
| `drive_id` | string | No | Optional drive ID. Required for application-level permissions (s2s_oauth) with OneDrive files. If not provided, falls back to site_id or /me/drive endpoint. Use EXCEL_LIST_FILES or ONE_DRIVE_GET_DRIVE_ROOT to get the drive ID. |
| `position` | integer | No | The new position for the worksheet. |
| `worksheet` | string | Yes | The name or ID of the worksheet to update. If using ID, it must be URL-encoded. |
| `session_id` | string | No | Optional session ID for the workbook. If provided, will be sent in the headers. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Upload Workbook from URL

**Slug:** `EXCEL_UPLOAD_WORKBOOK`

Tool to upload an external Excel file from a URL into OneDrive/SharePoint. Downloads the file server-side and uploads it to the specified drive location, returning the driveItem metadata for subsequent Excel operations.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `drive_id` | string | No | ID of the target drive. Use 'me' for the user's default OneDrive. |
| `source_url` | string | Yes | URL of the Excel file to download and upload. Must be a publicly accessible URL or authenticated URL. |
| `destination_path` | string | No | Full path including folder and filename where the file should be uploaded in OneDrive/SharePoint, e.g., 'Documents/report.xlsx'. If not provided, file will be uploaded to /Uploads/{timestamp}-{filename}. |
| `conflict_behavior` | string ("rename" | "replace" | "fail") | No | What to do if a file already exists at the destination path. 'rename' creates a new file with a number suffix, 'replace' overwrites the existing file, 'fail' returns an error. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
