Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(conversations): add MCP tools to create and edit saved ticket views (#80427)

Christiaan Hendriksen509c240ab590
diff --git a/products/conversations/backend/api/ticket_filters.py b/products/conversations/backend/api/ticket_filters.py
index dae5b08cca9e..4159c220db20 100644
--- a/products/conversations/backend/api/ticket_filters.py
+++ b/products/conversations/backend/api/ticket_filters.py
@@ -187,8 +187,9 @@ class TicketViewFiltersSerializer(serializers.Serializer):
assignee = TicketViewAssigneeFilterField(
required=False,
help_text="Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), "
- "or an object with type ('user' or 'role') and id. The legacy single-value shape is accepted "
- "and normalized to a list.",
+ "or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a "
+ "single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace "
+ "'all' with an empty list to apply no assignee filter.",
)
tags = serializers.ListField(
child=serializers.CharField(),
diff --git a/products/conversations/backend/api/ticket_views.py b/products/conversations/backend/api/ticket_views.py
index 9b886143cdbb..91e34dcf6c2c 100644
--- a/products/conversations/backend/api/ticket_views.py
+++ b/products/conversations/backend/api/ticket_views.py
@@ -36,7 +36,11 @@ class TicketViewFiltersField(serializers.JSONField):
class TicketViewSerializer(serializers.ModelSerializer):
- created_by = UserBasicSerializer(read_only=True)
+ created_by = UserBasicSerializer(read_only=True, help_text="The user who created this view.")
+ name = serializers.CharField(
+ max_length=400,
+ help_text="Display name of the view, as it appears in the ticket views list.",
+ )
filters = TicketViewFiltersField(
required=False,
default=dict,
@@ -65,6 +69,14 @@ class TicketViewSerializer(serializers.ModelSerializer):
"created_at",
"created_by",
]
+ extra_kwargs = {
+ "id": {"help_text": "Internal UUID of the view."},
+ "short_id": {
+ "help_text": "Stable short identifier for the view. Use it to address the view in this API, to open "
+ "it at /support/tickets?view=<short_id>, and as the `view` parameter when listing tickets."
+ },
+ "created_at": {"help_text": "When the view was created."},
+ }
def _set_favorited(self, instance: TicketView, favorited: bool) -> None:
user = self.context["request"].user
diff --git a/products/conversations/frontend/generated/api.schemas.ts b/products/conversations/frontend/generated/api.schemas.ts
index 358579ef37b0..0480110204e5 100644
--- a/products/conversations/frontend/generated/api.schemas.ts
+++ b/products/conversations/frontend/generated/api.schemas.ts
@@ -695,7 +695,7 @@ export interface TicketViewFiltersApi {
sla?: TicketSlaFilterEnumApi
/** AI triage outcomes to include. 'in_progress' matches tickets still being triaged. */
aiTriageResult?: AiTriageResultEnumApi[]
- /** Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. The legacy single-value shape is accepted and normalized to a list. */
+ /** Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter. */
assignee?: TicketViewFiltersApiAssigneeItem[]
/** Tag names to match, combined according to tagsMatch. */
tags?: string[]
@@ -777,13 +777,20 @@ export interface UserBasicApi {
}
export interface TicketViewApi {
+ /** Internal UUID of the view. */
readonly id: string
+ /** Stable short identifier for the view. Use it to address the view in this API, to open it at /support/tickets?view=<short_id>, and as the `view` parameter when listing tickets. */
readonly short_id: string
- /** @maxLength 400 */
+ /**
+ * Display name of the view, as it appears in the ticket views list.
+ * @maxLength 400
+ */
name: string
/** Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search. */
filters?: TicketViewFiltersApi
+ /** When the view was created. */
readonly created_at: string
+ /** The user who created this view. */
readonly created_by: UserBasicApi
/** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
is_favorited?: boolean
@@ -799,13 +806,20 @@ export interface PaginatedTicketViewListApi {
}
export interface PatchedTicketViewApi {
+ /** Internal UUID of the view. */
readonly id?: string
+ /** Stable short identifier for the view. Use it to address the view in this API, to open it at /support/tickets?view=<short_id>, and as the `view` parameter when listing tickets. */
readonly short_id?: string
- /** @maxLength 400 */
+ /**
+ * Display name of the view, as it appears in the ticket views list.
+ * @maxLength 400
+ */
name?: string
/** Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search. */
filters?: TicketViewFiltersApi
+ /** When the view was created. */
readonly created_at?: string
+ /** The user who created this view. */
readonly created_by?: UserBasicApi
/** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
is_favorited?: boolean
diff --git a/products/conversations/frontend/generated/api.zod.ts b/products/conversations/frontend/generated/api.zod.ts
index da47b2bea901..cb7473576d40 100644
--- a/products/conversations/frontend/generated/api.zod.ts
+++ b/products/conversations/frontend/generated/api.zod.ts
@@ -303,7 +303,10 @@ export const conversationsViewsCreateBodyNameMax = 400
export const conversationsViewsCreateBodyFiltersOneSearchMax = 200
export const ConversationsViewsCreateBody = /* @__PURE__ */ zod.object({
- name: zod.string().max(conversationsViewsCreateBodyNameMax),
+ name: zod
+ .string()
+ .max(conversationsViewsCreateBodyNameMax)
+ .describe('Display name of the view, as it appears in the ticket views list.'),
filters: zod
.object({
status: zod
@@ -370,7 +373,7 @@ export const ConversationsViewsCreateBody = /* @__PURE__ */ zod.object({
)
.optional()
.describe(
- "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. The legacy single-value shape is accepted and normalized to a list."
+ "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter."
),
tags: zod.array(zod.string()).optional().describe('Tag names to match, combined according to tagsMatch.'),
tagsMatch: zod
@@ -439,7 +442,11 @@ export const conversationsViewsPartialUpdateBodyNameMax = 400
export const conversationsViewsPartialUpdateBodyFiltersOneSearchMax = 200
export const ConversationsViewsPartialUpdateBody = /* @__PURE__ */ zod.object({
- name: zod.string().max(conversationsViewsPartialUpdateBodyNameMax).optional(),
+ name: zod
+ .string()
+ .max(conversationsViewsPartialUpdateBodyNameMax)
+ .optional()
+ .describe('Display name of the view, as it appears in the ticket views list.'),
filters: zod
.object({
status: zod
@@ -506,7 +513,7 @@ export const ConversationsViewsPartialUpdateBody = /* @__PURE__ */ zod.object({
)
.optional()
.describe(
- "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. The legacy single-value shape is accepted and normalized to a list."
+ "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter."
),
tags: zod.array(zod.string()).optional().describe('Tag names to match, combined according to tagsMatch.'),
tagsMatch: zod
diff --git a/products/conversations/mcp/tools.yaml b/products/conversations/mcp/tools.yaml
index 17327077a722..5888016b8c67 100644
--- a/products/conversations/mcp/tools.yaml
+++ b/products/conversations/mcp/tools.yaml
@@ -193,7 +193,28 @@ tools:
- escalation_reason
conversations-views-create:
operation: conversations_views_create
- enabled: false
+ enabled: true
+ scopes:
+ - ticket:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: false
+ enrich_url: ?view={short_id}
+ title: Create saved ticket view
+ description: >
+ Create a saved ticket view: a named, reusable set of ticket filters. `filters` accepts status, priority,
+ channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search,
+ and an empty object saves a view over all tickets. Set is_favorited to pin the view to the top of the list
+ for the calling user only. The response includes the short_id needed to open the view or to pass as the
+ `view` parameter of conversations-tickets-list.
+ response:
+ include:
+ - short_id
+ - name
+ - filters
+ - is_favorited
+ - created_at
conversations-views-destroy:
operation: conversations_views_destroy
enabled: false
@@ -212,17 +233,66 @@ tools:
List the saved ticket views in the project. Each view is a named, saved set of ticket filters — for example
the per-team views named "Team <name>". Returns each view's short_id and name; a view opens in the app at
/support/tickets?view=<short_id>. To get the tickets a view contains, pass its short_id as the `view`
- parameter of conversations-tickets-list.
+ parameter of conversations-tickets-list. Saved filters are omitted here; read them for a single view with
+ conversations-views-retrieve.
response:
include:
- short_id
- name
- conversations-views-partial-update:
- operation: conversations_views_partial_update
- enabled: false
conversations-views-retrieve:
operation: conversations_views_retrieve
- enabled: false
+ enabled: true
+ scopes:
+ - ticket:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ enrich_url: ?view={short_id}
+ title: Get saved ticket view
+ description: >
+ Get a saved ticket view by its short_id, including the full `filters` object that conversations-views-list
+ omits. Read the view here first when editing it, because conversations-views-update replaces `filters`
+ wholesale rather than merging into it.
+ param_overrides:
+ short_id:
+ description: Short identifier of the view, as returned by conversations-views-list.
+ response:
+ include:
+ - short_id
+ - name
+ - filters
+ - is_favorited
+ - created_at
+ - created_by
+ conversations-views-update:
+ operation: conversations_views_partial_update
+ enabled: true
+ scopes:
+ - ticket:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: true
+ enrich_url: ?view={short_id}
+ title: Update saved ticket view
+ description: >
+ Update a saved ticket view by its short_id. Can change the name, the saved `filters`, and is_favorited.
+ Sending `filters` replaces the whole object rather than merging into it, so read the current filters with
+ conversations-views-retrieve first and send them back with your edits applied. Omit `filters` entirely to
+ leave the saved criteria untouched. If a value read back from the view is rejected, convert it to the shape
+ its field describes and send it again. Do not drop the field, because that widens the view for everyone on
+ the team. is_favorited only affects the calling user.
+ param_overrides:
+ short_id:
+ description: Short identifier of the view, as returned by conversations-views-list.
+ response:
+ include:
+ - short_id
+ - name
+ - filters
+ - is_favorited
+ - created_at
conversations-zendesk-imports-create:
operation: conversations_zendesk_imports_create
enabled: false
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index d81e67b815f8..837e3be8821f 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -2055,8 +2055,22 @@
"readOnlyHint": false
}
},
+ "conversations-views-create": {
+ "description": "Create a saved ticket view: a named, reusable set of ticket filters. `filters` accepts status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search, and an empty object saves a view over all tickets. Set is_favorited to pin the view to the top of the list for the calling user only. The response includes the short_id needed to open the view or to pass as the `view` parameter of conversations-tickets-list.",
+ "category": "Conversations",
+ "feature": "conversations",
+ "summary": "Create saved ticket view",
+ "title": "Create saved ticket view",
+ "required_scopes": ["ticket:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"conversations-views-list": {
- "description": "List the saved ticket views in the project. Each view is a named, saved set of ticket filters — for example the per-team views named \"Team <name>\". Returns each view's short_id and name; a view opens in the app at /support/tickets?view=<short_id>. To get the tickets a view contains, pass its short_id as the `view` parameter of conversations-tickets-list.",
+ "description": "List the saved ticket views in the project. Each view is a named, saved set of ticket filters — for example the per-team views named \"Team <name>\". Returns each view's short_id and name; a view opens in the app at /support/tickets?view=<short_id>. To get the tickets a view contains, pass its short_id as the `view` parameter of conversations-tickets-list. Saved filters are omitted here; read them for a single view with conversations-views-retrieve.",
"category": "Conversations",
"feature": "conversations",
"summary": "List saved ticket views",
@@ -2069,6 +2083,34 @@
"readOnlyHint": true
}
},
+ "conversations-views-retrieve": {
+ "description": "Get a saved ticket view by its short_id, including the full `filters` object that conversations-views-list omits. Read the view here first when editing it, because conversations-views-update replaces `filters` wholesale rather than merging into it.",
+ "category": "Conversations",
+ "feature": "conversations",
+ "summary": "Get saved ticket view",
+ "title": "Get saved ticket view",
+ "required_scopes": ["ticket:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ }
+ },
+ "conversations-views-update": {
+ "description": "Update a saved ticket view by its short_id. Can change the name, the saved `filters`, and is_favorited. Sending `filters` replaces the whole object rather than merging into it, so read the current filters with conversations-views-retrieve first and send them back with your edits applied. Omit `filters` entirely to leave the saved criteria untouched. If a value read back from the view is rejected, convert it to the shape its field describes and send it again. Do not drop the field, because that widens the view for everyone on the team. is_favorited only affects the calling user.",
+ "category": "Conversations",
+ "feature": "conversations",
+ "summary": "Update saved ticket view",
+ "title": "Update saved ticket view",
+ "required_scopes": ["ticket:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"create-feature-flag": {
"description": "Create a feature flag in the current project. Call when the user asks to add a flag, gate a feature behind a flag, set up a percentage rollout, or deliver a remote config value. If this flag is for a new version of a page or flow, or for a pricing or onboarding change, an experiment may be in order. Ask the user if they want to run an experiment, and if so create the experiment with `experiment-create`, which will manage its own flag. Release conditions, rollout percentages, multivariate variants, and payloads all go in the structured `filters` param (`filters.groups` for release conditions, `filters.multivariate.variants` for variants, `filters.payloads` for JSON-encoded payloads). Use `update-feature-flag` to change an existing flag, and `feature-flag-get-all` first to check whether the key is already taken.",
"category": "Feature flags",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index ac914f68b114..efa77c549a4c 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -2070,8 +2070,22 @@
"readOnlyHint": false
}
},
+ "conversations-views-create": {
+ "description": "Create a saved ticket view: a named, reusable set of ticket filters. `filters` accepts status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search, and an empty object saves a view over all tickets. Set is_favorited to pin the view to the top of the list for the calling user only. The response includes the short_id needed to open the view or to pass as the `view` parameter of conversations-tickets-list.",
+ "category": "Conversations",
+ "feature": "conversations",
+ "summary": "Create saved ticket view",
+ "title": "Create saved ticket view",
+ "required_scopes": ["ticket:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": false,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"conversations-views-list": {
- "description": "List the saved ticket views in the project. Each view is a named, saved set of ticket filters — for example the per-team views named \"Team <name>\". Returns each view's short_id and name; a view opens in the app at /support/tickets?view=<short_id>. To get the tickets a view contains, pass its short_id as the `view` parameter of conversations-tickets-list.",
+ "description": "List the saved ticket views in the project. Each view is a named, saved set of ticket filters — for example the per-team views named \"Team <name>\". Returns each view's short_id and name; a view opens in the app at /support/tickets?view=<short_id>. To get the tickets a view contains, pass its short_id as the `view` parameter of conversations-tickets-list. Saved filters are omitted here; read them for a single view with conversations-views-retrieve.",
"category": "Conversations",
"feature": "conversations",
"summary": "List saved ticket views",
@@ -2084,6 +2098,34 @@
"readOnlyHint": true
}
},
+ "conversations-views-retrieve": {
+ "description": "Get a saved ticket view by its short_id, including the full `filters` object that conversations-views-list omits. Read the view here first when editing it, because conversations-views-update replaces `filters` wholesale rather than merging into it.",
+ "category": "Conversations",
+ "feature": "conversations",
+ "summary": "Get saved ticket view",
+ "title": "Get saved ticket view",
+ "required_scopes": ["ticket:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ }
+ },
+ "conversations-views-update": {
+ "description": "Update a saved ticket view by its short_id. Can change the name, the saved `filters`, and is_favorited. Sending `filters` replaces the whole object rather than merging into it, so read the current filters with conversations-views-retrieve first and send them back with your edits applied. Omit `filters` entirely to leave the saved criteria untouched. If a value read back from the view is rejected, convert it to the shape its field describes and send it again. Do not drop the field, because that widens the view for everyone on the team. is_favorited only affects the calling user.",
+ "category": "Conversations",
+ "feature": "conversations",
+ "summary": "Update saved ticket view",
+ "title": "Update saved ticket view",
+ "required_scopes": ["ticket:write"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"create-feature-flag": {
"description": "Create a feature flag in the current project. Call when the user asks to add a flag, gate a feature behind a flag, set up a percentage rollout, or deliver a remote config value. If this flag is for a new version of a page or flow, or for a pricing or onboarding change, an experiment may be in order. Ask the user if they want to run an experiment, and if so create the experiment with `experiment-create`, which will manage its own flag. Release conditions, rollout percentages, multivariate variants, and payloads all go in the structured `filters` param (`filters.groups` for release conditions, `filters.multivariate.variants` for variants, `filters.payloads` for JSON-encoded payloads). Use `update-feature-flag` to change an existing flag, and `feature-flag-get-all` first to check whether the key is already taken.",
"category": "Feature flags",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index d8759786e422..965b3a411327 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -60029,7 +60029,7 @@ export namespace Schemas {
sla?: TicketSlaFilterEnum;
/** AI triage outcomes to include. 'in_progress' matches tickets still being triaged. */
aiTriageResult?: AiTriageResultEnum[];
- /** Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. The legacy single-value shape is accepted and normalized to a list. */
+ /** Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter. */
assignee?: TicketViewFiltersAssigneeItem[];
/** Tag names to match, combined according to tagsMatch. */
tags?: string[];
@@ -60060,13 +60060,20 @@ export namespace Schemas {
}
export interface TicketView {
+ /** Internal UUID of the view. */
readonly id: string;
+ /** Stable short identifier for the view. Use it to address the view in this API, to open it at /support/tickets?view=<short_id>, and as the `view` parameter when listing tickets. */
readonly short_id: string;
- /** @maxLength 400 */
+ /**
+ * Display name of the view, as it appears in the ticket views list.
+ * @maxLength 400
+ */
name: string;
/** Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search. */
filters?: TicketViewFilters;
+ /** When the view was created. */
readonly created_at: string;
+ /** The user who created this view. */
readonly created_by: UserBasic;
/** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
is_favorited?: boolean;
@@ -69102,13 +69109,20 @@ export namespace Schemas {
}
export interface PatchedTicketView {
+ /** Internal UUID of the view. */
readonly id?: string;
+ /** Stable short identifier for the view. Use it to address the view in this API, to open it at /support/tickets?view=<short_id>, and as the `view` parameter when listing tickets. */
readonly short_id?: string;
- /** @maxLength 400 */
+ /**
+ * Display name of the view, as it appears in the ticket views list.
+ * @maxLength 400
+ */
name?: string;
/** Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search. */
filters?: TicketViewFilters;
+ /** When the view was created. */
readonly created_at?: string;
+ /** The user who created this view. */
readonly created_by?: UserBasic;
/** Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user. */
is_favorited?: boolean;
diff --git a/services/mcp/src/generated/conversations/api.ts b/services/mcp/src/generated/conversations/api.ts
index dfdc6a620d2a..c2948887974a 100644
--- a/services/mcp/src/generated/conversations/api.ts
+++ b/services/mcp/src/generated/conversations/api.ts
@@ -3,7 +3,7 @@
* MCP service uses these Zod schemas for generated tool handlers.
* To regenerate: hogli build:openapi
*
- * PostHog API - MCP 8 enabled ops
+ * PostHog API - MCP 11 enabled ops
* OpenAPI spec version: 1.0.0
*/
import * as zod from 'zod'
@@ -314,3 +314,308 @@ export const ConversationsViewsListQueryParams = () => zod.object({
limit: zod.number().optional().describe('Number of results to return per page.'),
offset: zod.number().optional().describe('The initial index from which to return the results.'),
})
+
+export const ConversationsViewsCreateParams = () => zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
+ ),
+})
+
+export const conversationsViewsCreateBodyNameMax = 400
+
+export const conversationsViewsCreateBodyFiltersOneSearchMax = 200
+
+export const ConversationsViewsCreateBody = () => zod.object({
+ name: zod
+ .string()
+ .max(conversationsViewsCreateBodyNameMax)
+ .describe('Display name of the view, as it appears in the ticket views list.'),
+ filters: zod
+ .object({
+ status: zod
+ .array(
+ zod
+ .enum(['new', 'open', 'pending', 'on_hold', 'resolved'])
+ .describe(
+ '\* `new` - New\n\* `open` - Open\n\* `pending` - Pending\n\* `on_hold` - On hold\n\* `resolved` - Resolved'
+ )
+ )
+ .optional()
+ .describe('Ticket statuses to include. Empty or omitted means all statuses.'),
+ priority: zod
+ .array(
+ zod
+ .enum(['low', 'medium', 'high', 'critical'])
+ .describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical')
+ )
+ .optional()
+ .describe('Ticket priorities to include. Empty or omitted means all priorities.'),
+ channel: zod
+ .enum(['widget', 'email', 'slack', 'teams', 'github', 'all'])
+ .describe(
+ '\* `widget` - widget\n\* `email` - email\n\* `slack` - slack\n\* `teams` - teams\n\* `github` - github\n\* `all` - all'
+ )
+ .optional()
+ .describe(
+ "Channel the ticket originated from. 'all' disables the filter.\n\n\* `widget` - widget\n\* `email` - email\n\* `slack` - slack\n\* `teams` - teams\n\* `github` - github\n\* `all` - all"
+ ),
+ sla: zod
+ .enum(['breached', 'at-risk', 'on-track', 'all'])
+ .describe('\* `breached` - breached\n\* `at-risk` - at-risk\n\* `on-track` - on-track\n\* `all` - all')
+ .optional()
+ .describe(
+ "SLA state: 'breached' is past due, 'at-risk' is due within the next hour, 'on-track' has more than an hour remaining. 'all' disables the filter.\n\n\* `breached` - breached\n\* `at-risk` - at-risk\n\* `on-track` - on-track\n\* `all` - all"
+ ),
+ aiTriageResult: zod
+ .array(
+ zod
+ .enum([
+ 'persisted',
+ 'escalated_with_best',
+ 'escalated_no_reply',
+ 'skipped_unactionable',
+ 'blocked_unsafe',
+ 'blocked_unsafe_reply',
+ 'in_progress',
+ ])
+ .describe(
+ '\* `persisted` - persisted\n\* `escalated_with_best` - escalated_with_best\n\* `escalated_no_reply` - escalated_no_reply\n\* `skipped_unactionable` - skipped_unactionable\n\* `blocked_unsafe` - blocked_unsafe\n\* `blocked_unsafe_reply` - blocked_unsafe_reply\n\* `in_progress` - in_progress'
+ )
+ )
+ .optional()
+ .describe("AI triage outcomes to include. 'in_progress' matches tickets still being triaged."),
+ assignee: zod
+ .array(
+ zod.union([
+ zod.enum(['me', 'unassigned']),
+ zod.object({
+ type: zod.enum(['user', 'role']),
+ id: zod.union([zod.string(), zod.number()]),
+ }),
+ ])
+ )
+ .optional()
+ .describe(
+ "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter."
+ ),
+ tags: zod.array(zod.string()).optional().describe('Tag names to match, combined according to tagsMatch.'),
+ tagsMatch: zod
+ .enum(['any', 'all'])
+ .describe('\* `any` - any\n\* `all` - all')
+ .optional()
+ .describe(
+ "'any' returns tickets with at least one of tags (OR); 'all' requires every tag (AND).\n\n\* `any` - any\n\* `all` - all"
+ ),
+ tagsExclude: zod
+ .array(zod.string())
+ .optional()
+ .describe('Tickets carrying any of these tags are excluded.'),
+ dateFrom: zod
+ .string()
+ .nullish()
+ .describe(
+ "Only include tickets updated on or after this date. Accepts absolute dates (2026-01-01) or relative ones (-7d). 'all' or null disables the bound."
+ ),
+ dateTo: zod
+ .string()
+ .nullish()
+ .describe('Only include tickets updated on or before this date. Same format as dateFrom.'),
+ sorting: zod
+ .union([
+ zod.object({
+ columnKey: zod
+ .string()
+ .describe(
+ 'Ticket column to sort by (updated_at, sla_due_at, snoozed_until, created_at, ticket_number). Unknown columns fall back to updated_at.'
+ ),
+ order: zod
+ .union([zod.literal(1), zod.literal(-1)])
+ .describe('\* `1` - 1\n\* `-1` - -1')
+ .describe('1 for ascending, -1 for descending.\n\n\* `1` - 1\n\* `-1` - -1'),
+ }),
+ zod.null(),
+ ])
+ .optional()
+ .describe('Sort order for the ticket list.'),
+ search: zod
+ .string()
+ .max(conversationsViewsCreateBodyFiltersOneSearchMax)
+ .optional()
+ .describe(
+ "Free-text search. A numeric value matches a ticket number exactly; otherwise matches the customer's name or email, the email subject, or message content."
+ ),
+ })
+ .describe(
+ "Canonical shape of a saved ticket view's filters. Every field is optional; an omitted\nfield (or an 'all' sentinel) leaves that dimension unfiltered."
+ )
+ .optional()
+ .describe(
+ 'Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search.'
+ ),
+ is_favorited: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.'
+ ),
+})
+
+export const ConversationsViewsRetrieveParams = () => zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
+ ),
+ short_id: zod.string(),
+})
+
+export const ConversationsViewsPartialUpdateParams = () => zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
+ ),
+ short_id: zod.string(),
+})
+
+export const conversationsViewsPartialUpdateBodyNameMax = 400
+
+export const conversationsViewsPartialUpdateBodyFiltersOneSearchMax = 200
+
+export const ConversationsViewsPartialUpdateBody = () => zod.object({
+ name: zod
+ .string()
+ .max(conversationsViewsPartialUpdateBodyNameMax)
+ .optional()
+ .describe('Display name of the view, as it appears in the ticket views list.'),
+ filters: zod
+ .object({
+ status: zod
+ .array(
+ zod
+ .enum(['new', 'open', 'pending', 'on_hold', 'resolved'])
+ .describe(
+ '\* `new` - New\n\* `open` - Open\n\* `pending` - Pending\n\* `on_hold` - On hold\n\* `resolved` - Resolved'
+ )
+ )
+ .optional()
+ .describe('Ticket statuses to include. Empty or omitted means all statuses.'),
+ priority: zod
+ .array(
+ zod
+ .enum(['low', 'medium', 'high', 'critical'])
+ .describe('\* `low` - Low\n\* `medium` - Medium\n\* `high` - High\n\* `critical` - Critical')
+ )
+ .optional()
+ .describe('Ticket priorities to include. Empty or omitted means all priorities.'),
+ channel: zod
+ .enum(['widget', 'email', 'slack', 'teams', 'github', 'all'])
+ .describe(
+ '\* `widget` - widget\n\* `email` - email\n\* `slack` - slack\n\* `teams` - teams\n\* `github` - github\n\* `all` - all'
+ )
+ .optional()
+ .describe(
+ "Channel the ticket originated from. 'all' disables the filter.\n\n\* `widget` - widget\n\* `email` - email\n\* `slack` - slack\n\* `teams` - teams\n\* `github` - github\n\* `all` - all"
+ ),
+ sla: zod
+ .enum(['breached', 'at-risk', 'on-track', 'all'])
+ .describe('\* `breached` - breached\n\* `at-risk` - at-risk\n\* `on-track` - on-track\n\* `all` - all')
+ .optional()
+ .describe(
+ "SLA state: 'breached' is past due, 'at-risk' is due within the next hour, 'on-track' has more than an hour remaining. 'all' disables the filter.\n\n\* `breached` - breached\n\* `at-risk` - at-risk\n\* `on-track` - on-track\n\* `all` - all"
+ ),
+ aiTriageResult: zod
+ .array(
+ zod
+ .enum([
+ 'persisted',
+ 'escalated_with_best',
+ 'escalated_no_reply',
+ 'skipped_unactionable',
+ 'blocked_unsafe',
+ 'blocked_unsafe_reply',
+ 'in_progress',
+ ])
+ .describe(
+ '\* `persisted` - persisted\n\* `escalated_with_best` - escalated_with_best\n\* `escalated_no_reply` - escalated_no_reply\n\* `skipped_unactionable` - skipped_unactionable\n\* `blocked_unsafe` - blocked_unsafe\n\* `blocked_unsafe_reply` - blocked_unsafe_reply\n\* `in_progress` - in_progress'
+ )
+ )
+ .optional()
+ .describe("AI triage outcomes to include. 'in_progress' matches tickets still being triaged."),
+ assignee: zod
+ .array(
+ zod.union([
+ zod.enum(['me', 'unassigned']),
+ zod.object({
+ type: zod.enum(['user', 'role']),
+ id: zod.union([zod.string(), zod.number()]),
+ }),
+ ])
+ )
+ .optional()
+ .describe(
+ "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter."
+ ),
+ tags: zod.array(zod.string()).optional().describe('Tag names to match, combined according to tagsMatch.'),
+ tagsMatch: zod
+ .enum(['any', 'all'])
+ .describe('\* `any` - any\n\* `all` - all')
+ .optional()
+ .describe(
+ "'any' returns tickets with at least one of tags (OR); 'all' requires every tag (AND).\n\n\* `any` - any\n\* `all` - all"
+ ),
+ tagsExclude: zod
+ .array(zod.string())
+ .optional()
+ .describe('Tickets carrying any of these tags are excluded.'),
+ dateFrom: zod
+ .string()
+ .nullish()
+ .describe(
+ "Only include tickets updated on or after this date. Accepts absolute dates (2026-01-01) or relative ones (-7d). 'all' or null disables the bound."
+ ),
+ dateTo: zod
+ .string()
+ .nullish()
+ .describe('Only include tickets updated on or before this date. Same format as dateFrom.'),
+ sorting: zod
+ .union([
+ zod.object({
+ columnKey: zod
+ .string()
+ .describe(
+ 'Ticket column to sort by (updated_at, sla_due_at, snoozed_until, created_at, ticket_number). Unknown columns fall back to updated_at.'
+ ),
+ order: zod
+ .union([zod.literal(1), zod.literal(-1)])
+ .describe('\* `1` - 1\n\* `-1` - -1')
+ .describe('1 for ascending, -1 for descending.\n\n\* `1` - 1\n\* `-1` - -1'),
+ }),
+ zod.null(),
+ ])
+ .optional()
+ .describe('Sort order for the ticket list.'),
+ search: zod
+ .string()
+ .max(conversationsViewsPartialUpdateBodyFiltersOneSearchMax)
+ .optional()
+ .describe(
+ "Free-text search. A numeric value matches a ticket number exactly; otherwise matches the customer's name or email, the email subject, or message content."
+ ),
+ })
+ .describe(
+ "Canonical shape of a saved ticket view's filters. Every field is optional; an omitted\nfield (or an 'all' sentinel) leaves that dimension unfiltered."
+ )
+ .optional()
+ .describe(
+ 'Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search.'
+ ),
+ is_favorited: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.'
+ ),
+})
diff --git a/services/mcp/src/tools/generated/conversations.ts b/services/mcp/src/tools/generated/conversations.ts
index 6ca20f6f5649..0b077456b78e 100644
--- a/services/mcp/src/tools/generated/conversations.ts
+++ b/services/mcp/src/tools/generated/conversations.ts
@@ -287,6 +287,45 @@ const conversationsTicketsUpdate = (): ToolBase<
},
})
+const ConversationsViewsCreateSchema = () => {
+ const ConversationsViewsCreateBody = orvalSchemas.ConversationsViewsCreateBody()
+ return ConversationsViewsCreateBody
+}
+
+const conversationsViewsCreate = (): ToolBase<
+ ReturnType<typeof ConversationsViewsCreateSchema>,
+ WithPostHogUrl<Schemas.TicketView>
+> => ({
+ name: 'conversations-views-create',
+ schema: ConversationsViewsCreateSchema(),
+ handler: async (context: Context, params: z.infer<ReturnType<typeof ConversationsViewsCreateSchema>>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.name !== undefined) {
+ body['name'] = params.name
+ }
+ if (params.filters !== undefined) {
+ body['filters'] = params.filters
+ }
+ if (params.is_favorited !== undefined) {
+ body['is_favorited'] = params.is_favorited
+ }
+ const result = await context.api.request<Schemas.TicketView>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/conversations/views/`,
+ body,
+ })
+ const filtered = pickResponseFields(result, [
+ 'short_id',
+ 'name',
+ 'filters',
+ 'is_favorited',
+ 'created_at',
+ ]) as typeof result
+ return await withPostHogUrl(context, filtered, `/support/tickets?view=${filtered.short_id}`)
+ },
+})
+
const ConversationsViewsListSchema = () => {
const ConversationsViewsListQueryParams = orvalSchemas.ConversationsViewsListQueryParams()
return ConversationsViewsListQueryParams
@@ -316,6 +355,85 @@ const conversationsViewsList = (): ToolBase<
},
})
+const ConversationsViewsRetrieveSchema = () => {
+ const ConversationsViewsRetrieveParams = orvalSchemas.ConversationsViewsRetrieveParams()
+ return ConversationsViewsRetrieveParams.omit({ project_id: true }).extend({
+ short_id: ConversationsViewsRetrieveParams.shape['short_id'].describe(
+ 'Short identifier of the view, as returned by conversations-views-list.'
+ ),
+ })
+}
+
+const conversationsViewsRetrieve = (): ToolBase<
+ ReturnType<typeof ConversationsViewsRetrieveSchema>,
+ WithPostHogUrl<Schemas.TicketView>
+> => ({
+ name: 'conversations-views-retrieve',
+ schema: ConversationsViewsRetrieveSchema(),
+ handler: async (context: Context, params: z.infer<ReturnType<typeof ConversationsViewsRetrieveSchema>>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.TicketView>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/conversations/views/${encodeURIComponent(String(params.short_id))}/`,
+ })
+ const filtered = pickResponseFields(result, [
+ 'short_id',
+ 'name',
+ 'filters',
+ 'is_favorited',
+ 'created_at',
+ 'created_by',
+ ]) as typeof result
+ return await withPostHogUrl(context, filtered, `/support/tickets?view=${filtered.short_id}`)
+ },
+})
+
+const ConversationsViewsUpdateSchema = () => {
+ const ConversationsViewsPartialUpdateBody = orvalSchemas.ConversationsViewsPartialUpdateBody()
+ const ConversationsViewsPartialUpdateParams = orvalSchemas.ConversationsViewsPartialUpdateParams()
+ return ConversationsViewsPartialUpdateParams.omit({ project_id: true })
+ .extend(ConversationsViewsPartialUpdateBody.shape)
+ .extend({
+ short_id: ConversationsViewsPartialUpdateParams.shape['short_id'].describe(
+ 'Short identifier of the view, as returned by conversations-views-list.'
+ ),
+ })
+}
+
+const conversationsViewsUpdate = (): ToolBase<
+ ReturnType<typeof ConversationsViewsUpdateSchema>,
+ WithPostHogUrl<Schemas.TicketView>
+> => ({
+ name: 'conversations-views-update',
+ schema: ConversationsViewsUpdateSchema(),
+ handler: async (context: Context, params: z.infer<ReturnType<typeof ConversationsViewsUpdateSchema>>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.name !== undefined) {
+ body['name'] = params.name
+ }
+ if (params.filters !== undefined) {
+ body['filters'] = params.filters
+ }
+ if (params.is_favorited !== undefined) {
+ body['is_favorited'] = params.is_favorited
+ }
+ const result = await context.api.request<Schemas.TicketView>({
+ method: 'PATCH',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/conversations/views/${encodeURIComponent(String(params.short_id))}/`,
+ body,
+ })
+ const filtered = pickResponseFields(result, [
+ 'short_id',
+ 'name',
+ 'filters',
+ 'is_favorited',
+ 'created_at',
+ ]) as typeof result
+ return await withPostHogUrl(context, filtered, `/support/tickets?view=${filtered.short_id}`)
+ },
+})
+
export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'conversations-tickets-list': conversationsTicketsList,
'conversations-tickets-messages-retrieve': conversationsTicketsMessagesRetrieve,
@@ -324,5 +442,8 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'conversations-tickets-reply-create': conversationsTicketsReplyCreate,
'conversations-tickets-retrieve': conversationsTicketsRetrieve,
'conversations-tickets-update': conversationsTicketsUpdate,
+ 'conversations-views-create': conversationsViewsCreate,
'conversations-views-list': conversationsViewsList,
+ 'conversations-views-retrieve': conversationsViewsRetrieve,
+ 'conversations-views-update': conversationsViewsUpdate,
}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-create.json
new file mode 100644
index 000000000000..a6027bde637e
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-create.json
@@ -0,0 +1,176 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "filters": {
+ "description": "Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search.",
+ "properties": {
+ "aiTriageResult": {
+ "description": "AI triage outcomes to include. 'in_progress' matches tickets still being triaged.",
+ "items": {
+ "description": "* `persisted` - persisted\n* `escalated_with_best` - escalated_with_best\n* `escalated_no_reply` - escalated_no_reply\n* `skipped_unactionable` - skipped_unactionable\n* `blocked_unsafe` - blocked_unsafe\n* `blocked_unsafe_reply` - blocked_unsafe_reply\n* `in_progress` - in_progress",
+ "enum": [
+ "persisted",
+ "escalated_with_best",
+ "escalated_no_reply",
+ "skipped_unactionable",
+ "blocked_unsafe",
+ "blocked_unsafe_reply",
+ "in_progress"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "assignee": {
+ "description": "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter.",
+ "items": {
+ "anyOf": [
+ {
+ "enum": ["me", "unassigned"],
+ "type": "string"
+ },
+ {
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ "type": {
+ "enum": ["user", "role"],
+ "type": "string"
+ }
+ },
+ "required": ["type", "id"],
+ "type": "object"
+ }
+ ]
+ },
+ "type": "array"
+ },
+ "channel": {
+ "description": "Channel the ticket originated from. 'all' disables the filter.\n\n* `widget` - widget\n* `email` - email\n* `slack` - slack\n* `teams` - teams\n* `github` - github\n* `all` - all",
+ "enum": ["widget", "email", "slack", "teams", "github", "all"],
+ "type": "string"
+ },
+ "dateFrom": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Only include tickets updated on or after this date. Accepts absolute dates (2026-01-01) or relative ones (-7d). 'all' or null disables the bound."
+ },
+ "dateTo": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Only include tickets updated on or before this date. Same format as dateFrom."
+ },
+ "priority": {
+ "description": "Ticket priorities to include. Empty or omitted means all priorities.",
+ "items": {
+ "description": "* `low` - Low\n* `medium` - Medium\n* `high` - High\n* `critical` - Critical",
+ "enum": ["low", "medium", "high", "critical"],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "search": {
+ "description": "Free-text search. A numeric value matches a ticket number exactly; otherwise matches the customer's name or email, the email subject, or message content.",
+ "maxLength": 200,
+ "type": "string"
+ },
+ "sla": {
+ "description": "SLA state: 'breached' is past due, 'at-risk' is due within the next hour, 'on-track' has more than an hour remaining. 'all' disables the filter.\n\n* `breached` - breached\n* `at-risk` - at-risk\n* `on-track` - on-track\n* `all` - all",
+ "enum": ["breached", "at-risk", "on-track", "all"],
+ "type": "string"
+ },
+ "sorting": {
+ "anyOf": [
+ {
+ "properties": {
+ "columnKey": {
+ "description": "Ticket column to sort by (updated_at, sla_due_at, snoozed_until, created_at, ticket_number). Unknown columns fall back to updated_at.",
+ "type": "string"
+ },
+ "order": {
+ "anyOf": [
+ {
+ "const": 1,
+ "type": "number"
+ },
+ {
+ "const": -1,
+ "type": "number"
+ }
+ ],
+ "description": "1 for ascending, -1 for descending.\n\n* `1` - 1\n* `-1` - -1"
+ }
+ },
+ "required": ["columnKey", "order"],
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Sort order for the ticket list."
+ },
+ "status": {
+ "description": "Ticket statuses to include. Empty or omitted means all statuses.",
+ "items": {
+ "description": "* `new` - New\n* `open` - Open\n* `pending` - Pending\n* `on_hold` - On hold\n* `resolved` - Resolved",
+ "enum": ["new", "open", "pending", "on_hold", "resolved"],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "tags": {
+ "description": "Tag names to match, combined according to tagsMatch.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "tagsExclude": {
+ "description": "Tickets carrying any of these tags are excluded.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "tagsMatch": {
+ "description": "'any' returns tickets with at least one of tags (OR); 'all' requires every tag (AND).\n\n* `any` - any\n* `all` - all",
+ "enum": ["any", "all"],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "is_favorited": {
+ "description": "Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.",
+ "type": "boolean"
+ },
+ "name": {
+ "description": "Display name of the view, as it appears in the ticket views list.",
+ "maxLength": 400,
+ "type": "string"
+ }
+ },
+ "required": ["name"],
+ "type": "object"
+}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-retrieve.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-retrieve.json
new file mode 100644
index 000000000000..d5002b487cb8
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-retrieve.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "short_id": {
+ "description": "Short identifier of the view, as returned by conversations-views-list.",
+ "type": "string"
+ }
+ },
+ "required": ["short_id"],
+ "type": "object"
+}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-update.json
new file mode 100644
index 000000000000..bb4bc730f384
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/conversations-views-update.json
@@ -0,0 +1,180 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "filters": {
+ "description": "Saved ticket filter criteria: status, priority, channel, sla, aiTriageResult, assignee, tags, tagsMatch, tagsExclude, dateFrom, dateTo, sorting, and search.",
+ "properties": {
+ "aiTriageResult": {
+ "description": "AI triage outcomes to include. 'in_progress' matches tickets still being triaged.",
+ "items": {
+ "description": "* `persisted` - persisted\n* `escalated_with_best` - escalated_with_best\n* `escalated_no_reply` - escalated_no_reply\n* `skipped_unactionable` - skipped_unactionable\n* `blocked_unsafe` - blocked_unsafe\n* `blocked_unsafe_reply` - blocked_unsafe_reply\n* `in_progress` - in_progress",
+ "enum": [
+ "persisted",
+ "escalated_with_best",
+ "escalated_no_reply",
+ "skipped_unactionable",
+ "blocked_unsafe",
+ "blocked_unsafe_reply",
+ "in_progress"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "assignee": {
+ "description": "Assignees to match (any of): 'unassigned', 'me' (resolved to the requesting user), or an object with type ('user' or 'role') and id. Send a list. Views saved earlier can hold a single value instead of a list, or the value 'all'. Wrap a single value in a list, and replace 'all' with an empty list to apply no assignee filter.",
+ "items": {
+ "anyOf": [
+ {
+ "enum": ["me", "unassigned"],
+ "type": "string"
+ },
+ {
+ "properties": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ "type": {
+ "enum": ["user", "role"],
+ "type": "string"
+ }
+ },
+ "required": ["type", "id"],
+ "type": "object"
+ }
+ ]
+ },
+ "type": "array"
+ },
+ "channel": {
+ "description": "Channel the ticket originated from. 'all' disables the filter.\n\n* `widget` - widget\n* `email` - email\n* `slack` - slack\n* `teams` - teams\n* `github` - github\n* `all` - all",
+ "enum": ["widget", "email", "slack", "teams", "github", "all"],
+ "type": "string"
+ },
+ "dateFrom": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Only include tickets updated on or after this date. Accepts absolute dates (2026-01-01) or relative ones (-7d). 'all' or null disables the bound."
+ },
+ "dateTo": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Only include tickets updated on or before this date. Same format as dateFrom."
+ },
+ "priority": {
+ "description": "Ticket priorities to include. Empty or omitted means all priorities.",
+ "items": {
+ "description": "* `low` - Low\n* `medium` - Medium\n* `high` - High\n* `critical` - Critical",
+ "enum": ["low", "medium", "high", "critical"],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "search": {
+ "description": "Free-text search. A numeric value matches a ticket number exactly; otherwise matches the customer's name or email, the email subject, or message content.",
+ "maxLength": 200,
+ "type": "string"
+ },
+ "sla": {
+ "description": "SLA state: 'breached' is past due, 'at-risk' is due within the next hour, 'on-track' has more than an hour remaining. 'all' disables the filter.\n\n* `breached` - breached\n* `at-risk` - at-risk\n* `on-track` - on-track\n* `all` - all",
+ "enum": ["breached", "at-risk", "on-track", "all"],
+ "type": "string"
+ },
+ "sorting": {
+ "anyOf": [
+ {
+ "properties": {
+ "columnKey": {
+ "description": "Ticket column to sort by (updated_at, sla_due_at, snoozed_until, created_at, ticket_number). Unknown columns fall back to updated_at.",
+ "type": "string"
+ },
+ "order": {
+ "anyOf": [
+ {
+ "const": 1,
+ "type": "number"
+ },
+ {
+ "const": -1,
+ "type": "number"
+ }
+ ],
+ "description": "1 for ascending, -1 for descending.\n\n* `1` - 1\n* `-1` - -1"
+ }
+ },
+ "required": ["columnKey", "order"],
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Sort order for the ticket list."
+ },
+ "status": {
+ "description": "Ticket statuses to include. Empty or omitted means all statuses.",
+ "items": {
+ "description": "* `new` - New\n* `open` - Open\n* `pending` - Pending\n* `on_hold` - On hold\n* `resolved` - Resolved",
+ "enum": ["new", "open", "pending", "on_hold", "resolved"],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "tags": {
+ "description": "Tag names to match, combined according to tagsMatch.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "tagsExclude": {
+ "description": "Tickets carrying any of these tags are excluded.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "tagsMatch": {
+ "description": "'any' returns tickets with at least one of tags (OR); 'all' requires every tag (AND).\n\n* `any` - any\n* `all` - all",
+ "enum": ["any", "all"],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "is_favorited": {
+ "description": "Whether the current user has favorited this view. Favorited views sort to the top of the list. Favorites are personal to each user.",
+ "type": "boolean"
+ },
+ "name": {
+ "description": "Display name of the view, as it appears in the ticket views list.",
+ "maxLength": 400,
+ "type": "string"
+ },
+ "short_id": {
+ "description": "Short identifier of the view, as returned by conversations-views-list.",
+ "type": "string"
+ }
+ },
+ "required": ["short_id"],
+ "type": "object"
+}