Skip to main content
Glama

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
NameRequiredDescriptionDefault
account_idYes
limitNo
queryYes

Implementation Reference

  • 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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/elyxlz/microsoft-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server