# List Events — Microsoft Outlook Calendar

> Get a list of event objects in the user's mailbox. See the documentation

- Key: `microsoft_outlook_calendar-list-events`
- Type: Action (Read-only)
- Version: 0.1.2
- App: Microsoft Outlook Calendar (`microsoft_outlook_calendar`) — https://pipedream.com/apps/microsoft-outlook-calendar.md
- This page (HTML): https://pipedream.com/apps/microsoft-outlook-calendar/actions/list-events
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_outlook_calendar/actions/list-events/list-events.mjs

## Description

Get a list of event objects in the user's mailbox. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-events)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filter` | `string` | No | Filters results using OData syntax. For example, contains(subject, 'meet for lunch?') will include events whose title contains 'meet for lunch?'. See documentation for the full list of operations. Note: filtering on the recurrence property is not supported by the API. |
| `orderBy` | `string` | No | Orders results. For example, displayName desc will sort the results by Display Name in decending order. |
| `maxResults` | `integer` | No | The maximum number of results to return |
| `includeRecurring` | `boolean` | No | When true, uses the calendar view endpoint which expands each occurrence of a recurring event into its own individual result. Requires Start Date Time and End Date Time. When false or unset, the events endpoint is used instead, which returns recurring series as a single master entry — these are excluded from the results. Start Date Time and End Date Time can still be used to filter by date range. |
| `startDateTime` | `string` | No | Filter events that start at or after this date and time, in ISO 8601 format (e.g. 2019-11-08T19:00:00-08:00). Required when Include Recurring is true. When Include Recurring is false or unset, this adds a start/dateTime ge filter to the events endpoint. |
| `endDateTime` | `string` | No | Filter events that end at or before this date and time, in ISO 8601 format (e.g. 2019-11-08T20:00:00-08:00). Required when Include Recurring is true. When Include Recurring is false or unset, this adds an end/dateTime le filter to the events endpoint. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_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_calendar",
      },
    },
  },
)

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_calendar-list-events",
  arguments: {
    filter: "Filter",
    orderBy: "Order By",
  },
})
```

**TypeScript**

```ts
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_calendar-list-events",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_outlook_calendar: { authProvisionId: "apn_xxxxxxx" },
    filter: "Filter",
    orderBy: "Order By",
  },
})

console.log(result)
```

**cURL**

```bash
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_calendar-list-events",
    "configured_props": {
      "microsoft_outlook_calendar": { "authProvisionId": "apn_xxxxxxx" },
      "filter": "Filter",
      "orderBy": "Order By"
    }
  }'
```

---

- App: https://pipedream.com/apps/microsoft-outlook-calendar.md · All apps: https://pipedream.com/apps
