Skip to main content
This tutorial builds one agent with access to the Office files of your SharePoint sites and OneDrive, whatever their format.

What you’ll build

An agent in Agent Creator that:
  • finds files in SharePoint and OneDrive, and quotes their link;
  • answers questions about a Word, Excel, PDF or PowerPoint file;
  • edits Excel workbooks in place, after the user confirms;
  • drafts new documents and presentations in the canvas, ready to export and save to SharePoint.

Watch first: configure the SharePoint connector

This four-minute video shows how to set up the SharePoint connector this tutorial relies on: connecting an account from the chat, adding the capability to an agent, controlling authentication and authorized agents from a Builder workspace, and declaring the platform OAuth client. Use the buttons in the top-right corner of the player to switch the narration language and the subtitles.
For a tour of agent creation itself, see the video in Creating agents.

How the agent handles each format

The agent reads every format through the SharePoint connector, but not the same way: Attaching a file works like a file the user drops in the chat: the agent offers the file, the user clicks Approve, and the platform fetches it from SharePoint server-side and indexes it in the conversation. The agent then searches it for the passages it needs. PDF and PowerPoint files are accepted up to 100 MB, images up to 4 MB. Producing a file goes through the canvas: the agent drafts the document (or, with Deck Designer, the deck), the user reviews it, exports it, and saves it to SharePoint. The connector does not upload file content, so only Excel workbooks are changed in place. Changing an existing Word document means reading it, then drafting the full new version in the canvas: the original styles and images are not carried over.

Prerequisites

  • Who: an agent builder with access to Agent Creator, and a workspace builder (or workspace owner) of the workspace that runs the SharePoint connector.
  • Where: Agent Creator, and the SharePoint connector’s configuration app.
  • Requires: the SharePoint connector installed and configured in a workspace, with an authentication mode and Graph scopes chosen (see SharePoint: Workspace builder). For Excel edits, the scopes must include Sites.ReadWrite.All and Files.ReadWrite.All.
  • Impact: with the per-user OAuth modes, each user only reaches the files they can already open in SharePoint. With clientCredentials, the agent reaches every site the application is allowed to read, whoever talks to it.

Set up the agent

1

Create the agent

In Agent Creator, create an agent with the agent_light profile or higher: Simple makes no tool calls, and Workflow is capped at 10 tool calls. Pick a model that handles tool calls well and is allowed in your organization.
2

Add the SharePoint capability

Open Capabilities and add Sharepoint Next from the catalog, or point a capability at your SharePoint workspace’s MCP endpoint with the scope context_id,agent_id,user_id (see SharePoint: Agent builder).
3

Turn on the canvas

In the agent settings, make sure Canvas enabled is on. Without it, the agent cannot draft documents or decks for export.
4

Raise the token budget

In Settings → General → Advanced, set Message Token Budget to 200,000: the SharePoint tools return large results, and a find → read → draft sequence can exceed the agent_light default (100,000). Leave Max Turns at its default.The tool call budget (15 on agent_light) is not editable in Agent Creator. If a request needs more calls, set tool_call_budget on the agent through the Agent Creator API, or use the agent_full profile.
5

Brief the agent

Add these instructions to the agent’s instructions, and adapt them to your sites:
To build PowerPoint decks, also add Deck Designer and the Slides MCP server: the default canvas has no slide format, so without them the agent can only draft text documents. Deck Designer must first be published in your organization’s catalog.
6

Allowlist the agent in the connector

If the capability points at the SharePoint endpoint of your own workspace, open Authorized agents in the connector’s configuration app, tick your agent (or turn on Allow all agents), and save. Until you do, that endpoint refuses the agent. A capability published from the connector’s own core workspace accepts every agent.
7

Publish the agent

Publish the agent so that users can open it in the chat.

Verify the result

Open the agent in the chat, with a Microsoft account that can open a few test files:
  1. Ask “Find a PDF, a PowerPoint, a Word file and an Excel workbook in SharePoint.” With a per-user OAuth mode, the first request shows a Connect button: sign in, and the request resumes on its own. Confirm that the agent lists files with their location.
  2. Ask the agent to summarize a Word file, then an Excel workbook. Confirm that both answers reflect the files’ content.
  3. Ask it to summarize a PDF. Confirm that an attachment approval appears, and that after Approve the summary reflects the document’s content.
  4. Ask for a one-page summary of the Word file. Confirm that it opens in the canvas and can be exported.
  5. If you added Deck Designer, ask for a three-slide presentation based on the Word file. Confirm that the deck opens in the canvas with PPTX and PDF export options.

Troubleshooting

The agent answers that the file exceeds the attachment limit

Cause: the file is larger than the attachment limit: 100 MB for documents (attachment_direct_max_bytes), 4 MB for images (attachment_fetch_max_bytes). Owner: platform administrator, for the limits. Resolution: share the file’s SharePoint link, or use a smaller version of the file. The limits are platform defaults of the Agent Creator workspace.

This agent is not authorized to use this connector

Cause: the capability points at a workspace’s own SharePoint endpoint, and the agent is not ticked in that connector’s Authorized agents list. Owner: the workspace builder of the SharePoint connector. Resolution: open the configuration app → Authorized agents, tick the agent, save, and ask the question again.

The agent returns unreadable content for a PDF or PowerPoint file

Cause: the agent’s instructions do not route these formats to attachToChat, or the platform version predates attachment offers from getContent. Owner: the agent builder. Resolution: add the format rules of the briefing above to the agent’s instructions, publish the agent, and retry in a new conversation.

Undo the change

Remove the SharePoint capability from the agent, untick the agent in Authorized agents, and publish the agent again. Files attached in past conversations stay in those conversations until their document retention expires.