Microsoft OneDrive & SharePoint Tool
Browse OneDrive and SharePoint sites, document libraries, folders and file metadata. For finding a document, auditing what is in a library, or checking file sizes and modification dates.
Tool ID
msgraph-files
Credential Required
Yes — the shared msgraph credential, owned by the msgraph connector. Configure the tenant
once and all nine tools use it; rotating the client secret is one edit rather than nine.
It is a server-managed OAuth credential: InTouch mints and refreshes the access token itself and
the connector never sees the secret. For unattended work set grant_type to client_credentials
(the app-only grant) — an app-only token belongs to the application, so a 06:00 schedule does not
run as a person, see only what that person can see, and stop working the day they leave.
Credential Properties
| Property | Type | Default | Description |
|---|---|---|---|
client_id |
string | — | Required. The Entra app registration's Application (client) ID. |
client_secret |
string | — | Required for app-only. The secret's Value, not its Secret ID. |
token_url |
string | — | Required. https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token |
grant_type |
string | (blank) | client_credentials for unattended app-only use. Blank means the user-delegated refresh-token flow. |
scope |
string | — | https://graph.microsoft.com/.default — resolves to whatever application permissions an admin has consented to. |
access_token |
string | — | Machine-managed. Leave empty; the server mints and persists it. |
refresh_token |
string | — | Delegated credentials only. Not used by the app-only grant. |
expires_at |
string | 0 |
Machine-managed expiry, epoch seconds. |
Entra setup
- https://entra.microsoft.com → App registrations → your app → API permissions.
- Add a permission → Microsoft Graph → Application permissions — not Delegated. Picking Delegated is the most common failure: it consents cleanly and then 403s at runtime.
- Tick the permissions listed under Permissions below, then Grant admin consent. The Status column must read Granted.
- Permissions live in the token, not the portal. A token minted before the grant carries the old
claims for about an hour — blank
access_tokento force a fresh mint.
Permissions
Files.Read.All and Sites.Read.All.
Operations
1. get_user_drive — Get a user's OneDrive
One person's OneDrive, and its driveId. Calls GET /users/{id}/drive.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. get_user_drive |
id |
string | — | Required. User id or userPrincipalName (e.g. [email protected]). Required by get_user_drive. |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
2. list_sites — List SharePoint sites
Sites matching a search term. Requires {"search": "*"} or a name fragment in query. Calls GET /sites.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. list_sites |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
3. get_site — Get one site
One SharePoint site by id. Calls GET /sites/{siteId}.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. get_site |
siteId |
string | — | Required. SharePoint site id, or the hostname,siteCollectionId,siteId triple Graph returns. Required by get_site and list_site_drives. |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
4. list_site_drives — List a site's libraries
The document libraries on a site, each with its driveId. Calls GET /sites/{siteId}/drives.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. list_site_drives |
siteId |
string | — | Required. SharePoint site id, or the hostname,siteCollectionId,siteId triple Graph returns. Required by get_site and list_site_drives. |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
5. list_root_children — List a drive's root
The top-level items in a drive. Calls GET /drives/{driveId}/root/children.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. list_root_children |
driveId |
string | — | Required. Drive id, from get_user_drive or list_site_drives. Required by list_root_children, list_item_children and get_drive_item. |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
6. list_item_children — List a folder's contents
The items inside a folder. Calls GET /drives/{driveId}/items/{itemId}/children.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. list_item_children |
driveId |
string | — | Required. Drive id, from get_user_drive or list_site_drives. Required by list_root_children, list_item_children and get_drive_item. |
itemId |
string | — | Required. Drive item (file or folder) id. Required by list_item_children and get_drive_item. |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
7. get_drive_item — Get one file or folder
One item's metadata, including @microsoft.graph.downloadUrl. Calls GET /drives/{driveId}/items/{itemId}.
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
operation |
string | — | Required. get_drive_item |
driveId |
string | — | Required. Drive id, from get_user_drive or list_site_drives. Required by list_root_children, list_item_children and get_drive_item. |
itemId |
string | — | Required. Drive item (file or folder) id. Required by list_item_children and get_drive_item. |
query |
string | — | Optional. OData query params as a JSON object string. list_sites needs one: {"search": "*"} lists sites, {"search": "finance"} narrows them. Elsewhere: {"$select": "name,size,lastModifiedDateTime,webUrl"}. |
Published Outputs:
- result — the JSON response body
- status — HTTP status code
Paging
Graph answers a collection with 100 rows and an @odata.nextLink, so a naive listing returns a
fraction of a large tenant with HTTP 200 and no sign anything is missing. This connector follows
the continuation link until the collection is exhausted. If it stops at the page cap it says so —
the result carries complete: false with a warning, and the step returns WARNING rather than
SUCCESS. A page cap must never look like the end of the data.
Notes
This connector returns metadata, not bytes — deliberately. Graph answers /content with a
redirect to a storage host and then a raw stream. A spreadsheet is not JSON, and a connector whose
contract is "return the JSON response body" would hand back a mangled string or exhaust memory on a
large file. Fetching a file is two steps:
get_drive_item→ take@microsoft.graph.downloadUrloff the response.- Fetch that URL with the http or file tool.
That URL is pre-authenticated — it carries its own token, so the fetch must not add an
Authorization header — and it expires in about an hour, so fetch it now rather than storing it in
a job definition.
A drive is not a site. OneDrive gives each user a drive (get_user_drive); a SharePoint site
has one drive per document library (list_site_drives). "The team's files" is almost always a site
drive, and looking under someone's personal drive finds nothing while returning 200.
list_sites needs a search term. Pass {"search": "*"} to enumerate, or a fragment of the
name to narrow.
Self-Contained JAR
The jar bundles all runtime dependencies; only intouch-tool-api is provided by the server.
Publishes
The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.
completeoperationresultstatuswarning