view_ticket_summary
Retrieve detailed summaries of support tickets from Freshdesk to streamline ticket management and enhance customer support workflows.
Instructions
Get the summary of a ticket in Freshdesk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticket_id | Yes |
Implementation Reference
- src/freshdesk_mcp/server.py:1183-1200 (handler)The main handler function for the 'view_ticket_summary' tool, decorated with @mcp.tool() for registration. It fetches the ticket summary from the Freshdesk API using the provided ticket_id, handles HTTP errors, and returns the JSON response or error message.@mcp.tool() async def view_ticket_summary(ticket_id: int) -> Dict[str, Any]: """Get the summary of a ticket in Freshdesk.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/tickets/{ticket_id}/summary" headers = { "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}", "Content-Type": "application/json" } async with httpx.AsyncClient() as client: try: response = await client.get(url, headers=headers) response.raise_for_status() return response.json() except httpx.HTTPStatusError as e: return {"error": f"Failed to fetch ticket summary: {str(e)}"} except Exception as e: return {"error": f"An unexpected error occurred: {str(e)}"}