search_tickets
Search for support tickets in Freshdesk using specific queries to streamline ticket management and enhance customer support operations.
Instructions
Search for tickets in Freshdesk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Input Schema (JSON Schema)
{
"properties": {
"query": {
"title": "Query",
"type": "string"
}
},
"required": [
"query"
],
"title": "search_ticketsArguments",
"type": "object"
}
Implementation Reference
- src/freshdesk_mcp/server.py:383-394 (handler)The handler function for the 'search_tickets' tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function takes a query string and performs a search on the Freshdesk API's /search/tickets endpoint, returning the JSON response.@mcp.tool() async def search_tickets(query: str) -> Dict[str, Any]: """Search for tickets in Freshdesk.""" url = f"https://{FRESHDESK_DOMAIN}/api/v2/search/tickets" headers = { "Authorization": f"Basic {base64.b64encode(f'{FRESHDESK_API_KEY}:X'.encode()).decode()}" } params = {"query": query} async with httpx.AsyncClient() as client: response = await client.get(url, headers=headers, params=params) return response.json()