feat: tickets tools — list, get, stats - #149
Open
ar2rsawseen wants to merge 3 commits into
Open
Conversation
Adds the first tickets-plugin tool: tickets_rag_search calls the tickets plugin's GET /v2/tickets/rag/search endpoint to retrieve PII-redacted, permission-scoped transcript snippets for a natural- language query, so MCP clients can ground answers in how similar customer issues were resolved. - optional app_id/app_name scoping (cross-app when omitted), limit - gated as a new 'tickets' category (requiresPlugin: tickets, not available by default), read-only - unit tests for param mapping, scoping, empty results, API errors; also verified live against a dev server with RAG enabled Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tats Complements tickets_rag_search with the structured query side, so MCP clients can answer questions like "who is answering BMW's latest ticket" (requester_name/segments filter + sort + limit=1): - tickets_list: full /v2/tickets filter surface (status, assignee, team, tag, channel, priority, requester, requester_name substring, audience segments, subject/number search, updated_since, sort, paging). Assignee and team ids are resolved to names via /v2/members and /v2/tickets/teams. requester_name is re-applied client-side so older servers without the filter don't silently return everything. - tickets_get: one ticket by (globally unique) number — detail, SLA, CSAT, and optionally the conversation transcript. - tickets_stats: /v2/tickets/stats performance metrics (volume, backlog, FRT/resolution percentiles, SLA attainment, agent leaderboard, CSAT). All read-only in the plugin-gated tickets category. 893 tests passing; verified live against a dev server (names resolve, transcript renders). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines
+12
to
+13
| return String(text || '') | ||
| .replace(/&/g, '&') |
…d plugin Ticket vectorization is no longer owned by the tickets plugin, so the RAG search tool goes with it. The structured tools (tickets_list, tickets_get, tickets_stats) are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the support-tickets tool set to the MCP server: a new plugin-gated
ticketscategory (requiresPlugin: 'tickets', not available by default), all read-only, so MCP clients (Cee, Claude, etc.) can answer structured support questions.tickets_list— fullGET /v2/ticketsfilter surface: status/category, assignee, unassigned, team, tag, channel, priority, exact requester (email/uid/device),requester_namesubstring (e.g. "BMW"), audiencesegments({"custom.organization": "BMW"}), subject/number search,updated_since, sort + paging. Assignee and team ids are resolved to display names via/v2/membersand/v2/tickets/teams, so "who is answering BMW's latest ticket" returns a person, not an ObjectId.requester_nameis also re-applied client-side so older servers that ignore the parameter don't silently return unfiltered results.tickets_get— one ticket by its globally unique number: detail, tags, SLA breach state, CSAT, and optionally the conversation transcript.tickets_stats—/v2/tickets/stats: volume + daily series, backlog, first-response/resolution p50/p90, SLA attainment, agent leaderboard, busiest hours, CSAT.The
requester_nameserver-side filter ships in countly-platform#874.Validation
tickets_list {requester_name: "jane", sort: "created_at", direction: "desc", limit: 1}→ "assignee: Arturs Sosins";tickets_getrenders the conversation;tickets_statsreturns the metrics blob.🤖 Generated with Claude Code