Microsoft Outlook Email ACTION
Modify Email
Apply one or more state mutations to an email message: mark read/unread, add/remove categories, move to a folder, or change the flag status. All params except
messageId are optional — only the ones you provide are applied. Use Find Email to obtain a message id before modifying. Recipes: Mark read: isRead: true | Mark unread: isRead: false Add category: addCategories: ["Follow Up"] | Remove category: removeCategories: ["Follow Up"] Move to archive: destinationFolderId: "archive" | Move to inbox: destinationFolderId: "inbox" Flag: flagStatus: "flagged" | Unflag: flagStatus: "notFlagged" | Mark complete: flagStatus: "complete" Example: modify-email(messageId="AAMk...", isRead=true) → marks the message as read. Example: modify-email(messageId="AAMk...", addCategories=["Eval-Seinfeld"], destinationFolderId="archive") → adds a category AND moves to archive in a single call. See the documentation- Action
- Writes data
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Microsoft Outlook Email account once, then configure and run Modify Email 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-modify-email",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
microsoft_outlook: { authProvisionId: "apn_xxxxxxx" },
messageId: "Message ID",
isRead: true,
},
})
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-modify-email",
"configured_props": {
"microsoft_outlook": { "authProvisionId": "apn_xxxxxxx" },
"messageId": "Message ID",
"isRead": true
}
}'// 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-modify-email",
arguments: {
messageId: "Message ID",
isRead: true,
},
})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 |
|---|---|---|
messageId Message ID | string | The Microsoft Graph message ID. Obtain from Find Email ( id field in results). Required |
isRead Is Read | boolean | true marks the message as read; false marks it as unread. Omit to leave unchanged. Optional |
addCategories Add Categories | string[] | Category names to add to the message, e.g. ["Follow Up", "Important"]. Existing categories are preserved. Optional |
removeCategories Remove Categories | string[] | Category names to remove from the message. Existing categories not listed here are preserved. Optional |
destinationFolderId Destination Folder ID | string | Move the message to this folder. Use well-known names ( inbox, archive, deleteditems, drafts, junkemail, sentitems) or a folder ID. Omit to leave in current folder. Optional |
flagStatus Flag Status | string | Set the message flag: flagged (flag it), notFlagged (remove flag), or complete (mark flag as done). Optional |
userId User ID | string | The user ID or UPN of a shared mailbox. Omit to use the authenticated user's mailbox. 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-modify-email
- Version
- 0.0.6
- App
- Microsoft Outlook Email
- Authentication
- OAuth
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗