Microsoft Outlook Email ACTION
List Folders
Retrieves mail folders for the authenticated user. Returns
{ count, folders } where folders contains each folder's id, displayName, parentFolderId, childFolderCount, totalItemCount, and unreadItemCount. The count field reflects the true API total when Microsoft Graph returns @odata.count (supported for top-level mailFolders queries); when Include Subfolders is true or Graph does not return @odata.count for the requested filter, count equals the number of folders actually retrieved. Use this action to resolve a folder display name to its ID — set Display Name to filter by exact name. Use Get Folder instead when you already have the folder ID. See the documentation- Action
- Read only
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Microsoft Outlook Email account once, then configure and run List Folders from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "microsoft_outlook-list-folders",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
microsoft_outlook: { authProvisionId: "apn_xxxxxxx" },
displayName: "Display Name",
maxResults: 10,
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "microsoft_outlook-list-folders",
"configured_props": {
"microsoft_outlook": { "authProvisionId": "apn_xxxxxxx" },
"displayName": "Display Name",
"maxResults": 10
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "microsoft_outlook",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "microsoft_outlook-list-folders",
arguments: {
displayName: "Display Name",
maxResults: 10,
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
displayName Display Name | string | Filter to folders whose display name exactly matches this value. Use this to resolve a known folder name to its ID. Applied server-side when Include Subfolders is false; applied client-side when true. Optional |
maxResults Max Results | integer | Maximum number of folders to return (default: 100). Min 1, max 1000. For name-based lookups when the total folder count is unknown, raise this value or set Include Subfolders to true. Graph API maximum is 999 per page. Optional |
includeSubfolders Include Subfolders | boolean | If true, recursively includes all subfolders at every nesting level. Set to true when searching for a folder by display name if you don't know whether it is a top-level folder. Default is false, which returns only top-level folders. Note: count falls back to the number of folders retrieved in this mode. Optional |
includeHiddenFolders Include Hidden Folders | boolean | If true, includes hidden system folders (e.g. AllItems, RecoverableItemsDeletions, SearchFolders, Clutter). Set to true only when specifically looking for a system or hidden folder. Default is false. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- microsoft_outlook-list-folders
- Version
- 1.0.2
- App
- Microsoft Outlook Email
- Authentication
- OAuth
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗