Skip to main content
Excel The Excel connector exposes Microsoft Excel workbooks through the Microsoft Graph API. It can be consumed two ways: as a remote MCP server that Agent Factory agents call as tools, or as a Builder app whose instructions you call directly from DSUL. It runs in the installing workspace’s own app-instance context and resolves its Microsoft credential server-side — either Azure AD client credentials (a service-account app accessing files across the tenant) or delegated OAuth (acting as a signed-in user). Agents read, write, and manipulate cells, ranges, tables, charts, named items, and pivot tables in spreadsheets hosted on OneDrive or SharePoint.

Read & write cells

Read and write cell values, formulas, and ranges with full formatting control, plus insert, clear, sort, and merge operations.

Tables, charts & pivots

Create and manipulate Excel tables, charts, named ranges, and pivot tables — including exporting a chart as an image.

Functions & recalculation

Run Excel worksheet functions and force a full workbook recalculation from an agent or automation.

Who is this for?

This connector is used by three different roles. Jump to the section that matches yours — each one is self-contained.

Agent builder

You build agents in Agent Factory and want them to work with Excel workbooks. → Agent builder tab.

Platform admin

You run the platform and want to know what one-time setup Excel needs. → Platform admin setup accordion below.

Workspace builder

You write Builder automations (DSUL) that call Excel instructions directly. → Workspace builder tab.

Prerequisites

  • A Microsoft 365 / Azure AD tenant with the workbooks you want to reach stored in OneDrive or SharePoint (.xlsx files only — legacy .xls is not supported).
  • An Azure AD application registered in that tenant (Azure portal > App registrations), with a client secret generated for it.
  • Microsoft Graph permissions granted to the app, with admin consent:
    • Files.Read.All — read-only access to files.
    • Files.ReadWrite.All — read/write access to files.
    • Sites.Read.All or Sites.ReadWrite.All — for SharePoint-hosted files.
  • For delegated OAuth mode, the same app must have a redirect URI configured and the corresponding delegated permissions consented; for client-credentials mode, the matching application permissions are used.
  • Note the Application (client) ID, the client secret value, and the Directory (tenant) ID — these are pasted into the app configuration. For SharePoint files, also note the site ID.
No platform-level credential. Excel follows the static-credential model: each workspace pastes its own Azure AD credentials into the app configuration, and the connector resolves them server-side. There is nothing to register centrally — no shared key, no Governance OAuth auth-config JSON.
Optionally, to let agent builders pick Excel from the capability catalog instead of pasting an MCP endpoint URL, declare it once as a named capability:
1

Open AI Governance > Capabilities

Create (or edit) an Excel capability.
2

Point it at the MCP endpoint

Set the capability’s MCP server URL to the connector’s MCP Endpoint (from the Excel app instance in the providing workspace), and set its Scope to:
context_id,agent_id,user_id
The agent_id in the scope is what lets the connector identify the calling agent.
3

Make it available to agent builders

Once created, the capability appears in the capability picker for agent builders in your organization. Access to the catalog follows your organization’s existing roles; there is no per-capability role grant for this connector.
Declaring the capability makes the connector available in the picker; it does not grant any Microsoft access by itself. The actual file access is governed by the Azure AD credentials and Graph permissions configured in the workspace that runs the Excel app.

Agent builder

Goal: let an agent you build in Agent Factory read and write Excel workbooks through Excel MCP tools.
Before an agent can call the connector, a Workspace builder must have installed and configured the Excel app with Azure AD credentials (see the Workspace builder tab). A Platform admin may also have published an Excel capability in the catalog (see the Platform admin setup accordion above).
The connector resolves its Microsoft credential server-side — it is never exposed to the agent. Your agent is identified by the agent_id that Agent Factory injects through the capability Scope.
1

Get the MCP endpoint

From the workspace that runs the Excel app, copy the app instance’s MCP Endpoint URL (or use the published Excel capability if a Platform admin declared one).
2

Add the capability to your agent

In your agent in Agent Factory, add a capability pointing at the MCP Endpoint URL, and set its Scope to:
context_id,agent_id,user_id
The agent_id is what lets the connector identify the calling agent.
3

Use it

Ask the agent to work with a workbook (e.g. “read A1:C10 from this sheet” or “add a row to the Sales table”). It calls the matching Excel tool, passing the file’s itemId and — for SharePoint — its siteId.

Brief the agent in its system prompt

Wiring the capability is not enough — the agent must know the tools exist and how to address a file. Copy-pasteable starter:
You have access to the Excel MCP server (Microsoft Graph). Use it to read, write, and reshape Excel workbooks stored in OneDrive or SharePoint.
Always address a workbook by its `itemId` (the Graph drive item id). For SharePoint-hosted files, also pass `siteId` (and `driveId` if you know the specific document library). Use A1 notation for ranges (e.g. "A1:C10").
Read with getRange / getUsedRange before writing. Write values with updateRange. Use the table tools (createTable, addTableRow, applyTableFilter) for structured data, and executeExcelFunction to evaluate formulas. Recalculate with calculateWorkbook after bulk edits.
Legacy AI Knowledge agents (no native MCP picker): add the connector under Advanced > Tools > MCP and paste the MCP Endpoint URL.

Available Tools

All instructions listed in the Workspace builder tab are exposed as MCP tools with the same names and parameters. They are grouped below.

Workbook

ToolDescription
createWorkbookCreate a new Excel workbook.
calculateWorkbookRecalculate all formulas in the workbook.

Worksheets

ToolDescription
listWorksheetsList all worksheets in the workbook.
getWorksheetGet worksheet details.
addWorksheetCreate a new worksheet.
updateWorksheetRename or reposition a worksheet.
deleteWorksheetDelete a worksheet.
getUsedRangeGet the data-containing range of a worksheet.

Ranges

ToolDescription
getRangeRead cell values, formulas, and formatting from a range.
updateRangeWrite values to cells in a range.
getCellRead a single cell by row/column.
clearRangeClear contents and/or formatting of a range.
insertRangeInsert cells with a shift direction.
deleteRangeDelete cells with a shift direction.
sortRangeSort range data.
mergeRangeMerge cells in a range.
unmergeRangeUnmerge cells in a range.

Formatting

ToolDescription
updateFormatSet alignment and text wrapping.
updateFontSet font properties.
updateFillSet background color.
updateBorderSet border styles.
autofitColumnsAuto-fit column widths.
autofitRowsAuto-fit row heights.

Tables

ToolDescription
listTablesList tables in the workbook.
getTableGet table details.
createTableCreate a table from a range.
updateTableUpdate table properties.
deleteTableDelete a table.
addTableRowAdd a row to a table.
updateTableRowUpdate row values.
deleteTableRowDelete a row.
addTableColumnAdd a column.
deleteTableColumnDelete a column.
applyTableSortSort a table.
applyTableFilterFilter a table.
clearTableFilterClear table filters.
convertTableToRangeConvert a table to a normal range.

Charts

ToolDescription
listChartsList charts in a worksheet.
getChartGet chart details.
addChartCreate a chart.
updateChartUpdate chart properties.
deleteChartDelete a chart.
setChartDataChange a chart’s data source.
setChartPositionPosition a chart.
getChartImageExport a chart as an image.
updateChartTitleSet a chart title.
updateChartLegendConfigure a chart legend.

Named Items & Pivot Tables

ToolDescription
listNamedItemsList named ranges.
getNamedItemGet a named item’s value.
addNamedItemCreate a named range.
updateNamedItemUpdate a named item.
listPivotTablesList pivot tables.
getPivotTableGet pivot table details.
refreshPivotTableRefresh a pivot table.
refreshAllPivotTablesRefresh all pivot tables.

Functions

ToolDescription
executeExcelFunctionExecute an Excel worksheet function and return its result.

Output Formats

Tools accept an outputFormat argument that controls the MCP response shape:
  • verbose (default) — a human-readable text view of the operation, optimized for LLM consumption.
  • structured — machine-readable JSON in structuredContent.
  • both — the structured payload, with its JSON also rendered as text.

Tool Details

getRange

{
  "name": "getRange",
  "arguments": {
    "itemId": "01ABCDEF...",
    "worksheetId": "Sheet1",
    "address": "A1:C10"
  }
}
ParameterRequiredDescription
itemIdYesGraph drive item id of the workbook.
worksheetIdYesWorksheet name or id.
addressYesRange in A1 notation (e.g. A1:C10).
siteIdNoSharePoint site id (for SharePoint-hosted files).
driveIdNoSpecific document library / drive id.

updateRange

{
  "name": "updateRange",
  "arguments": {
    "itemId": "01ABCDEF...",
    "worksheetId": "Sheet1",
    "address": "A1:C2",
    "values": [
      ["Name", "Age", "City"],
      ["John", 30, "New York"]
    ]
  }
}
ParameterRequiredDescription
itemIdYesGraph drive item id of the workbook.
worksheetIdYesWorksheet name or id.
addressYesTarget range in A1 notation; must match the values dimensions.
valuesYes2D array of cell values to write.
siteId / driveIdNoSharePoint targeting.

createTable

{
  "name": "createTable",
  "arguments": {
    "itemId": "01ABCDEF...",
    "worksheetId": "Sheet1",
    "address": "A1:C10",
    "hasHeaders": true
  }
}
ParameterRequiredDescription
itemIdYesGraph drive item id of the workbook.
worksheetIdYesWorksheet name or id.
addressYesSource range for the table in A1 notation.
hasHeadersNoWhether the first row contains column headers.

addChart

{
  "name": "addChart",
  "arguments": {
    "itemId": "01ABCDEF...",
    "worksheetId": "Sheet1",
    "type": "ColumnClustered",
    "sourceData": "A1:C10",
    "seriesBy": "Auto"
  }
}
ParameterRequiredDescription
itemIdYesGraph drive item id of the workbook.
worksheetIdYesWorksheet name or id.
typeYesChart type (e.g. ColumnClustered, Line, Pie).
sourceDataYesRange that supplies the chart data, in A1 notation.
seriesByNoHow series are grouped: Auto, Columns, or Rows.

executeExcelFunction

{
  "name": "executeExcelFunction",
  "arguments": {
    "itemId": "01ABCDEF...",
    "functionName": "VLOOKUP",
    "values": ["lookupValue", "A1:C10", 2, false]
  }
}
ParameterRequiredDescription
itemIdYesGraph drive item id of the workbook.
functionNameYesExcel worksheet function name (e.g. VLOOKUP, SUM).
valuesYesOrdered argument list passed to the function.

Error Handling

HTTP StatusErrorSolution
401UnauthorizedAzure credentials are missing, invalid, or expired — reconfigure the app and re-check the client secret.
403ForbiddenThe Azure AD app lacks the required Microsoft Graph permissions, or admin consent was not granted.
404Not FoundVerify the itemId (and siteId/driveId for SharePoint) — the workbook, worksheet, or range does not exist.
423LockedThe file is open in a desktop Office app; close it or wait for auto-save.
429Rate LimitedMicrosoft Graph throttled the request — back off and retry, honoring the Retry-After header.
500 / 503Service errorTransient Microsoft Graph error — retry shortly.

Common Issues

“Missing Azure credentials” — The app configuration has no clientId / clientSecret / tenant. Open the Excel app instance and paste your Azure AD application credentials, then re-run. “OAuth authentication required. Please connect your Microsoft account first” — Authentication Mode is set to oauth but no delegated token exists yet for the user. Complete the Microsoft connect flow before calling Excel tools, or switch the mode to clientCredentials. “Client credentials auth failed” — Azure AD rejected the client-credentials token request (wrong tenant id, expired or wrong client secret, or the app lacks application permissions). Re-check the credential values and the granted Graph permissions. “File is locked” — The workbook is open in the desktop Excel application. Close it or wait for auto-save to release the lock. “Invalid range address” — Use A1 notation (e.g. A1:C10), not numeric row/column indices. “.xls not supported” — Only .xlsx workbooks are supported by the Graph workbook API. Convert legacy .xls files to .xlsx first.
Microsoft Graph caps workbook requests at roughly 5 million cells per call and a 25 MB file size; split very large ranges into smaller calls to avoid 429/oversize errors.

External Resources

Microsoft Graph Excel API

Official reference for the Microsoft Graph workbook (Excel) API.

Excel API best practices

Performance and session guidance for the Graph workbook API.

Graph Explorer

Test Microsoft Graph calls interactively against your tenant.

Tool Agents

Learn how Agent Factory agents consume MCP tools in Prisme.ai.