> This page is for Agent Handler.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# SharePoint

**Authentication:** OAuth or access token. See [Magic Link](/merge-agent-handler/features/magic-link) for the runtime auth flow, or [Application credentials](/merge-agent-handler/admin-setup/add-oauth-credentials) to bring your own OAuth app.

## Sample use cases

* Find files in the `Sales / Proposals` library modified in the last 7 days.
* Share the `Q2 Onboarding` site with view-only access to [onboarding@acme.com](mailto:onboarding@acme.com).
* List documents on the `Engineering` site last edited over 90 days ago.

## Available Tools

#### files\_list\_drive\_items

List all files and folders in a SharePoint document library folder. Requires driveId (from sites\_list\_drives). Defaults to root folder. Supports OData filter, orderby, and pagination via top/skip

#### files\_get\_drive\_item

Get detailed information about a specific file or folder. Requires driveId (from sites\_list\_drives) and itemId

#### files\_create\_folder

Create a new folder in a SharePoint document library. Requires driveId (from sites\_list\_drives) and parentId

#### files\_upload\_item

Upload a new file to a SharePoint document library. Requires drive\_id (from sites\_list\_drives) and a filename. Provide content inline or a file\_reference for larger files

#### files\_update\_item

Update file or folder name or description. Requires driveId (from sites\_list\_drives) and itemId

#### files\_delete\_item

Delete a file or folder from a SharePoint document library. Requires driveId (from sites\_list\_drives) and itemId

#### files\_search\_drive\_items

Search for files and folders in a SharePoint document library by query text. Requires driveId (from sites\_list\_drives) and query

#### files\_search\_all

Search for files across ALL SharePoint sites and OneDrive.

#### list\_items\_get\_all

Get all items from a SharePoint list. Requires siteId and listId. Use sites\_list\_lists to find list IDs. Supports OData filter, expand, orderby, and pagination via top/skip

#### list\_items\_get\_by\_id

Get a specific SharePoint list item by ID. Requires siteId, listId (from sites\_list\_lists), and itemId

#### list\_items\_create

Create a new item in a SharePoint list. Requires siteId, listId (from sites\_list\_lists), and fields object. Use list\_get\_columns to discover available fields

#### list\_items\_update

Update an existing SharePoint list item. Requires siteId, listId (from sites\_list\_lists), itemId, and fields to update

#### list\_items\_delete

Delete a SharePoint list item. Requires siteId, listId (from sites\_list\_lists), and itemId

#### list\_get\_columns

Get all columns/fields for a SharePoint list. Requires siteId and listId (from sites\_list\_lists). Use before list\_items\_create to discover available fields

#### sites\_create\_list

Create a new SharePoint list. Requires siteId (from sites\_get\_root or sites\_get\_by\_hostname). Optionally provide columns and list template

#### lists\_get\_by\_id

Get a SharePoint list by ID. Requires siteId and listId (from sites\_list\_lists)

#### lists\_get\_by\_title

Get a SharePoint list by its display title. Requires siteId and listTitle

#### lists\_update

Update a SharePoint list's display name or description. Requires siteId and listId (from sites\_list\_lists)

#### lists\_delete

Delete a SharePoint list and all its items. Requires siteId and listId (from sites\_list\_lists)

#### lists\_list\_columns

List all columns in a SharePoint list. Requires siteId and listId (from sites\_list\_lists). Use to discover field names before creating items

#### lists\_create\_column

Create a new column in a SharePoint list. Requires siteId, listId (from sites\_list\_lists), column name, and column\_type

#### lists\_update\_column

Update a column's display name, description, or required flag. Requires siteId, listId, and columnId (from lists\_list\_columns)

#### lists\_delete\_column

Delete a column from a SharePoint list. Requires siteId, listId, and columnId (from lists\_list\_columns)

#### sites\_get\_root

Get the organization's default SharePoint root site. Returns siteId needed by other tools. Call this first to discover available sites

#### sites\_get\_by\_id

Get a specific SharePoint site by ID. Requires siteId (from sites\_get\_root or sites\_get\_by\_hostname)

#### sites\_get\_by\_hostname

Get a SharePoint site by hostname (e.g. contoso.sharepoint.com). Returns siteId needed by other tools

#### sites\_get\_by\_path

Get a SharePoint site by hostname and server-relative path. Returns siteId needed by other tools

#### sites\_get\_group\_root

Get a Microsoft 365 group's team site. Requires groupId. Returns siteId needed by other tools

#### sites\_update

Update a SharePoint site's display name or description. Requires siteId (from sites\_get\_root or sites\_get\_by\_hostname)

#### sites\_list\_drives

List all document libraries (drives) for a SharePoint site. Requires siteId. Returns driveId values needed by files\_\* tools

#### sites\_list\_lists

List all lists in a SharePoint site. Requires siteId. Returns listId values needed by list\_items\_\* and list\_get\_columns tools

#### sites\_list\_columns

List site-level columns for a SharePoint site. Requires siteId (from sites\_get\_root or sites\_get\_by\_hostname)