list_contacts
Retrieve and manage all Freshdesk contacts with pagination support for efficient customer relationship management. Automate support operations and enhance ticket handling.
Instructions
List all contacts in Freshdesk with pagination support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| per_page | No |
Input Schema (JSON Schema)
{
"properties": {
"page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 1,
"title": "Page"
},
"per_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 30,
"title": "Per Page"
}
},
"title": "list_contactsArguments",
"type": "object"
}
Implementation Reference
- src/freshdesk_mcp/server.py:473-487 (handler)The main handler function for the 'list_contacts' tool. It is registered via the @mcp.tool() decorator, which also serves as the registration. The function fetches a paginated list of contacts from the Freshdesk API and returns the JSON response. Input schema is inferred from type hints: optional page and per_page parameters.@mcp.tool() async def list_contacts(page: Optional[int] = 1, per_page: Optional[int] = 30)-> list[Dict[str, Any]]: """List all contacts in Freshdesk with pagination support.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/contacts" headers = { "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}" } params = { "page": page, "per_page": per_page } async with httpx.AsyncClient() as client: response = await client.get(url, headers=headers, params=params) return response.json()