get_agents
Retrieve all agents in Freshdesk with pagination support to manage and organize support team details efficiently.
Instructions
Get all agents in Freshdesk with pagination support.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| per_page | No |
Implementation Reference
- src/freshdesk_mcp/server.py:452-472 (handler)The handler function for the 'get_agents' tool. It fetches a list of agents from the Freshdesk API endpoint /api/v2/agents with optional pagination parameters. Includes input validation for page and per_page.@mcp.tool() async def get_agents(page: Optional[int] = 1, per_page: Optional[int] = 30)-> list[Dict[str, Any]]: """Get all agents in Freshdesk with pagination support.""" # Validate input parameters if page < 1: return {"error": "Page number must be greater than 0"} if per_page < 1 or per_page > 100: return {"error": "Page size must be between 1 and 100"} url = f"https://{FRESHDESK_DOMAIN}/api/v2/agents" 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()