Skip to main content

Overview

SharePoint tools let you list sites, inspect site metadata, browse document libraries, upload files, and download files through Microsoft Graph. They support both SharePoint site drives and the user’s OneDrive.

Key Features

  • SHAREPOINT_LIST_SITES
    • Search and list SharePoint sites.
  • SHAREPOINT_GET_SITE_INFORMATION
    • Get site metadata (id, name, URL) from a SharePoint site URL.
  • SHAREPOINT_LIST_DOCUMENTS
    • List files and folders from SharePoint document libraries or OneDrive.
  • SHAREPOINT_UPLOAD_FILE
    • Upload files to SharePoint or OneDrive (simple upload, up to 4MB).
  • SHAREPOINT_DOWNLOAD_FILE
    • Download a file from SharePoint or OneDrive. Returns a pre-authenticated download URL or base64-encoded content (max 4 MB).

Authentication

These tools require a Microsoft Graph OAuth token. Go to the Jinba secrets dashboard and connect a Microsoft account for SharePoint/OneDrive. Use the generated token in the tool config.

Example: List Sites and Upload a File

- id: list_sites
  name: list_sites
  tool: SHAREPOINT_LIST_SITES
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    - name: search
      value: "engineering"

- id: get_site
  name: get_site
  tool: SHAREPOINT_GET_SITE_INFORMATION
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    - name: site_url
      value: "https://contoso.sharepoint.com/sites/Engineering"

- id: list_documents
  name: list_documents
  tool: SHAREPOINT_LIST_DOCUMENTS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # If you omit drive_id, the tool lists the user's OneDrive (me/drive)
    # For SharePoint document libraries, set drive_id to the library's drive ID.
    - name: top
      value: 10

- id: list_sharepoint_documents
  name: list_sharepoint_documents
  tool: SHAREPOINT_LIST_DOCUMENTS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    - name: drive_id
      value: "YOUR_SHAREPOINT_DRIVE_ID"
    - name: top
      value: 10

- id: upload_file
  name: upload_file
  tool: SHAREPOINT_UPLOAD_FILE
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # Omit drive_id to upload to OneDrive (me/drive)
    - name: filename
      value: "report.txt"
    - name: content
      value: "{{steps.generate_report.result.base64}}"
    - name: conflict_behavior
      value: "rename"

- id: download_file
  name: download_file
  tool: SHAREPOINT_DOWNLOAD_FILE
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_SHAREPOINT.access_token}}"
  input:
    # item_id is retrieved from SHAREPOINT_LIST_DOCUMENTS results
    - name: item_id
      value: "{{steps.list_documents.result.items[0].id}}"
    # "url" (default) returns a pre-authenticated download URL
    # "base64" returns file content as base64 (max 4 MB)
    - name: output_format
      value: "url"