> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/microsoft_excel.md).

# microsoft\_excel

Read, write, and update data

[Microsoft Teams](https://www.microsoft.com/en-us/microsoft-365/excel) is a powerful spreadsheet application that enables data management, analysis, and visualization. Through the Microsoft Excel integration in Agent Forge, you can programmatically read, write, and manipulate spreadsheet data to support your workflow automation needs.

With Microsoft Excel integration, you can:

* **Read Spreadsheet Data**: Access data from specific ranges, sheets, and cells
* **Write and Update Data**: Add new data or modify existing spreadsheet content
* **Manage Tables**: Create and manipulate tabular data structures
* **Handle Multiple Sheets**: Work with multiple worksheets in a workbook
* **Process Data**: Import, export, and transform spreadsheet data

In Agent Forge, the Microsoft Excel integration provides seamless access to spreadsheet functionality through OAuth authentication. You can read data from specific ranges, write new information, update existing cells, and handle various data formats. The integration supports both reading and writing operations with flexible input and output options. This enables you to build workflows that can effectively manage spreadsheet data, whether you're extracting information for analysis, updating records automatically, or maintaining data consistency across your applications.

## Usage Instructions

Integrate Microsoft Excel functionality to manage spreadsheet data. Read data from specific ranges, write new data, update existing cells, and manipulate table data using OAuth authentication. Supports various input and output formats for flexible data handling.

## Tools

### `microsoft_excel_read`

Read data from a Microsoft Excel spreadsheet

#### Input

| Parameter       | Type   | Required | Description                                  |
| --------------- | ------ | -------- | -------------------------------------------- |
| `accessToken`   | string | Yes      | The access token for the Microsoft Excel API |
| `spreadsheetId` | string | Yes      | The ID of the spreadsheet to read from       |
| `range`         | string | No       | The range of cells to read from              |

#### Output

| Parameter        | Type   | Description           |
| ---------------- | ------ | --------------------- |
| `data`           | json   | Sheet data            |
| `metadata`       | json   | Operation metadata    |
| `updatedRange`   | string | Updated range         |
| `updatedRows`    | number | Updated rows count    |
| `updatedColumns` | number | Updated columns count |
| `updatedCells`   | number | Updated cells count   |
| `index`          | number | Row index             |
| `values`         | json   | Table values          |

### `microsoft_excel_write`

Write data to a Microsoft Excel spreadsheet

#### Input

| Parameter                 | Type    | Required | Description                                           |
| ------------------------- | ------- | -------- | ----------------------------------------------------- |
| `accessToken`             | string  | Yes      | The access token for the Microsoft Excel API          |
| `spreadsheetId`           | string  | Yes      | The ID of the spreadsheet to write to                 |
| `range`                   | string  | No       | The range of cells to write to                        |
| `values`                  | array   | Yes      | The data to write to the spreadsheet                  |
| `valueInputOption`        | string  | No       | The format of the data to write                       |
| `includeValuesInResponse` | boolean | No       | Whether to include the written values in the response |

#### Output

| Parameter        | Type   | Description           |
| ---------------- | ------ | --------------------- |
| `data`           | json   | Sheet data            |
| `metadata`       | json   | Operation metadata    |
| `updatedRange`   | string | Updated range         |
| `updatedRows`    | number | Updated rows count    |
| `updatedColumns` | number | Updated columns count |
| `updatedCells`   | number | Updated cells count   |
| `index`          | number | Row index             |
| `values`         | json   | Table values          |

### `microsoft_excel_table_add`

Add new rows to a Microsoft Excel table

#### Input

| Parameter       | Type   | Required | Description                                                        |
| --------------- | ------ | -------- | ------------------------------------------------------------------ |
| `accessToken`   | string | Yes      | The access token for the Microsoft Excel API                       |
| `spreadsheetId` | string | Yes      | The ID of the spreadsheet containing the table                     |
| `tableName`     | string | Yes      | The name of the table to add rows to                               |
| `values`        | array  | Yes      | The data to add to the table (array of arrays or array of objects) |

#### Output

| Parameter        | Type   | Description           |
| ---------------- | ------ | --------------------- |
| `data`           | json   | Sheet data            |
| `metadata`       | json   | Operation metadata    |
| `updatedRange`   | string | Updated range         |
| `updatedRows`    | number | Updated rows count    |
| `updatedColumns` | number | Updated columns count |
| `updatedCells`   | number | Updated cells count   |
| `index`          | number | Row index             |
| `values`         | json   | Table values          |

## Notes

* Category: `tools`
* Type: `microsoft_excel`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/microsoft_excel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
