Skip to main content

Use Case

File management & Organization

Difficulty

Medium

Build Time

10 – 15 minutes

Integrations

OneDrive SharePoint

What does this Agent do?

Use this template when you want an agent that can help users manage files and folders, track changes, and access SharePoint or OneDrive content via Microsoft Graph. This agent can perform real actions inside your Microsoft 365 environment to streamline document access and organization. Here’s what this agent can do:
  • List document libraries and drives for users, groups, or SharePoint sites
  • Retrieve files and folders by ID or path
  • List folder contents and navigate hierarchical structures
  • Resolve shared links to actual drive items
  • Present all relevant Technical IDs for downstream operations

Example Conversations

Try asking your agent:
  • “Show me all files in the ‘Shared Documents’ library on the Finance site.”
  • “Get the details for file ID 01ABCDE2FGHIJKL.”
  • “List all document libraries in my OneDrive.”

Setup

1

Customize prompt

This agent uses the Microsoft Graph Agent prompt template.
Go to Prompts → Templates → Add Template to select it.
Replace all variables—shown in curly brackets—to match your environment.
2

Configure integrations

Add the OneDrive and SharePoint integrations.
Go to Integrations → Add New and connect using your required Microsoft 365 credentials.
3

Build agent

Go to the Agent tab and click Add New.
Enter your agent’s name and description.
Add your prompt and integration.
Select gpt-4.1 as your model, then click Save.
4

Use agent

Open the Chat panel and select your new agent from the dropdown.
Start using it to list libraries, retrieve files, or manage folders.
Adjust the prompt if you want to change tone, behavior, or actions the agent takes in OneDrive or SharePoint.