Skip to content

feat: add filtering, sorting, and pagination support - #46

Open
awhiskin-enrolhq wants to merge 3 commits into
effytech:mainfrom
awhiskin-enrolhq:enhance-ticket-filtering
Open

awhiskin-enrolhq wants to merge 3 commits into
effytech:mainfrom
awhiskin-enrolhq:enhance-ticket-filtering

Conversation

@awhiskin-enrolhq

@awhiskin-enrolhq awhiskin-enrolhq commented May 3, 2026

Copy link
Copy Markdown

Adds missing Freshdesk API parameters to several tools:

get_tickets

  • filter (new_and_my_open, watching, spam, deleted)
  • requester_id, email, company_id, updated_since
  • order_by, order_type
  • include (stats, requester, description, company)
  • agent_id: filter by assigned agent, server-side. Freshdesk's list endpoint doesn't support agent filtering, so when agent_id is set the tool transparently routes to /api/v2/search/tickets and normalizes the response to the same {tickets, pagination} shape (plus a total count). Params the search endpoint can't honor (filter, requester_id, email, company_id, updated_since, order_by, order_type, include, per_page ≠ 30, page > 10) fail fast with a clear error instead of returning silently wrong results.

get_ticket_fields

  • Fixed return type: Freshdesk returns a list but the type hint says Dict, causing Pydantic validation errors. Now wraps the list in a dict.

get_ticket_conversation

  • Added page and per_page params for pagination support.

search_tickets

  • Added page param for pagination.
  • Added proper error handling.

All changes are backwards-compatible.

awhiskin-enrolhq and others added 3 commits May 4, 2026 09:48
- get_tickets: add filter, requester_id, email, company_id,
  updated_since, order_by, order_type, and include params
- get_ticket_fields: fix return type (wrap list in dict)
- get_ticket_conversation: add page/per_page pagination
- search_tickets: add page pagination and error handling

All changes are backwards-compatible.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Routes to /api/v2/search/tickets when agent_id is set (the only
Freshdesk endpoint supporting agent filtering server-side) and
normalizes the response to the existing {tickets, pagination} shape.
Incompatible params fail fast with a clear error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brtdv

brtdv commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

+1 for the page and per_page params in the get_ticket_conversation call

@Maanaesh Can you review and merge, if possible? This PR has been open for a while?

I'm also happy to open a smaller, subset PR with only the changes to get_ticket_conversation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants