search_contacts
Retrieve contacts from Freshdesk by entering a search query to locate specific customer details for support operations.
Instructions
Search for contacts in Freshdesk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Input Schema (JSON Schema)
{
"properties": {
"query": {
"title": "Query",
"type": "string"
}
},
"required": [
"query"
],
"title": "search_contactsArguments",
"type": "object"
}
Implementation Reference
- src/freshdesk_mcp/server.py:499-509 (handler)The main handler function for the 'search_contacts' MCP tool. It performs an autocomplete search on Freshdesk contacts API using the provided query term. Registered via the @mcp.tool() decorator.@mcp.tool() async def search_contacts(query: str)-> list[Dict[str, Any]]: """Search for contacts in Freshdesk.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/contacts/autocomplete" headers = { "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}" } params = {"term": query} async with httpx.AsyncClient() as client: response = await client.get(url, headers=headers, params=params) return response.json()