search_contacts
Retrieve and filter contacts from Microsoft Outlook using a specific query and account ID, bypassing limitations of unified search. Ideal for targeted contact management.
Instructions
Search contacts. Uses traditional search since unified_search doesn't support contacts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| limit | No | ||
| query | Yes |
Implementation Reference
- src/microsoft_mcp/tools.py:922-939 (handler)The implementation of the search_contacts tool, decorated with @mcp.tool for automatic registration in FastMCP. It performs a search on contacts using the Microsoft Graph API's traditional search endpoint.@mcp.tool def search_contacts( query: str, account_id: str, limit: int = 50, ) -> list[dict[str, Any]]: """Search contacts. Uses traditional search since unified_search doesn't support contacts.""" params = { "$search": f'"{query}"', "$top": min(limit, 100), } contacts = list( graph.request_paginated("/me/contacts", account_id, params=params, limit=limit) ) return contacts