list_groups
Retrieve all groups from Freshdesk using pagination, enabling efficient management and organization of support team structures.
Instructions
List all groups in Freshdesk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| per_page | No |
Implementation Reference
- src/freshdesk_mcp/server.py:827-840 (handler)The primary handler function for the 'list_groups' tool. It fetches groups from the Freshdesk API with optional pagination parameters (page and per_page). The @mcp.tool() decorator registers it with the MCP server. The function signature provides the implicit input schema.async def list_groups(page: Optional[int] = 1, per_page: Optional[int] = 30)-> list[Dict[str, Any]]: """List all groups in Freshdesk.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/groups" 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()