# Search Contacts — Microsoft Outlook Calendar

> Search for contacts by name from your saved contacts list and retrieve their email addresses. See the documentation

- Key: `microsoft_outlook_calendar-search-contacts`
- Type: Action (Read-only)
- Version: 0.0.7
- 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/search-contacts
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/microsoft_outlook_calendar/actions/search-contacts/search-contacts.mjs

## Description

Search for contacts by name from your saved contacts list and retrieve their email addresses. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-contacts)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `search` | `string` | No | Search for contacts by name (e.g., 'John Doe'). Searches display name, given name, and surname. |
| `filter` | `string` | No | Filter contacts by email address using OData syntax. For example, emailAddresses/any(a:a/address eq 'john@example.com'). Note: $filter only works with the address sub-property of emailAddresses. See the documentation |
| `expand` | `string` | No | Comma-separated list of relationships to expand and include in the response. See the relationships table of the contact object for supported names. |
| `select` | `string` | No | Comma-separated list of properties to include in the response. |
| `maxResults` | `integer` | No | The maximum number of contacts to return |

## 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-search-contacts",
  arguments: {
    search: "Search Query",
    filter: "Filter",
  },
})
```

**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-search-contacts",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_outlook_calendar: { authProvisionId: "apn_xxxxxxx" },
    search: "Search Query",
    filter: "Filter",
  },
})

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-search-contacts",
    "configured_props": {
      "microsoft_outlook_calendar": { "authProvisionId": "apn_xxxxxxx" },
      "search": "Search Query",
      "filter": "Filter"
    }
  }'
```

---

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