Skip to content

Search tickets by company and limitations#37

Open
ktsaou wants to merge 5 commits intoeffytech:mainfrom
ktsaou:main
Open

Search tickets by company and limitations#37
ktsaou wants to merge 5 commits intoeffytech:mainfrom
ktsaou:main

Conversation

@ktsaou
Copy link

@ktsaou ktsaou commented Jan 16, 2026

This PR:

  1. Supports searching for tickets by company id
  2. Provides instructions to the model about freshdesk API limitations
  3. The instructions/descriptions of several tools have been updated to reflect freshdesk API

- Add company_id, requester_id, email, updated_since, filter, order_by, order_type parameters
- Document search_tickets limitations (company_id not supported in search API)
- Guide users to use get_tickets for company-based filtering
Major improvements:
- get_tickets: Added 30-day limit warning, include param, company_id, updated_since, filter params
- get_ticket: Added include param for embedded data (stats, conversations, requester, company)
- search_tickets: Documented all supported/unsupported fields and query syntax
- list_contacts: Added filtering by email, mobile, phone, company_id, state, updated_since
- get_agents: Added filtering by email, mobile, phone, state
- All tools: Added proper Args/Returns docstrings

Added FRESHDESK_API_REFERENCE.md with comprehensive API documentation.

Key limitations now documented:
- 30-day default ticket limit (CRITICAL)
- 512 char query limit for search endpoints
- Max 300 results (10 pages) for search/filter APIs
- include param costs +1 API credit each
- description requires include param for newer accounts
…desk API

The Freshdesk search API requires the query parameter to be wrapped in
double quotes (e.g., query="status:2 AND priority:3").

This fix:
- Automatically wraps the query in double quotes
- Strips existing quotes to avoid double-wrapping
- Updates docstring to clarify date format requirements (YYYY-MM-DD)
The Freshdesk Filter Tickets API (/api/v2/search/tickets) does NOT
support requester_id as a query field. Using it returns 400
"Validation failed".

Updated docstring to:
- Remove requester_id from supported fields list
- Add it to the NOT supported section with redirect to get_tickets
- Add agent_id and fr_due_by which are actually supported
- Clarify error message is "Validation failed"

For filtering by requester, use get_tickets(requester_id=X) instead.
…tions

- get_ticket(include=conversations) only returns oldest 10 - added warning
- get_ticket_conversation() now loops through all pages (per_page=100)
- Updated all retrieval method docstrings with pagination/limit info
- Added complete Freshdesk API documentation (FRESHDESK_API_DOCS.txt)
- Documented autocomplete API limitations vs list APIs
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.

1 participant