You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add list_vistas tool for listing DevRev vistas
- Add list_vistas tool definition with comprehensive input schema
- Implement handler with support for all API parameters
- Support filtering by type, flavor, state, created_by, members
- Include pagination support with cursor and mode parameters
- Add limit and sorting capabilities
- Enable default vista filtering and item skipping options
description="List all available vistas (filtered views) from DevRev with optional filtering",
52
+
inputSchema={
53
+
"type": "object",
54
+
"properties": {
55
+
"type": {"type": "array", "items": {"type": "string", "enum": ["curated", "dynamic", "grouped"]}, "description": "Filters for vistas of the specific type"},
56
+
"cursor": {"type": "string", "description": "The cursor to resume iteration from. If not provided, iteration begins from the first page"},
57
+
"created_by": {"type": "array", "items": {"type": "string"}, "description": "Filters for vistas created by any of these users"},
58
+
"flavor": {"type": "array", "items": {"type": "string", "enum": ["nnl", "sprint_board", "support_inbox"]}, "description": "Filters for vistas of specific flavor"},
59
+
"is_default": {"type": "boolean", "description": "Whether the default vistas should be fetched or not"},
60
+
"limit": {"type": "integer", "description": "The maximum number of vistas to return. The default is 50, the maximum is 100"},
61
+
"members": {"type": "array", "items": {"type": "string"}, "description": "Filters for vistas accessible to the input members"},
62
+
"mode": {"type": "string", "enum": ["after", "before"], "description": "The iteration mode to use. If 'after', then entries after the provided cursor will be returned. If 'before', then entries before the provided cursor will be returned"},
63
+
"sort_by": {"type": "array", "items": {"type": "string"}, "description": "Fields to sort the vistas by and the direction to sort them"},
64
+
"state": {"type": "array", "items": {"type": "string", "enum": ["active", "completed", "planned"]}, "description": "Denotes the state of the vista group item"},
65
+
"skip_items": {"type": "boolean", "description": "Denotes whether to skip items of vista_group_item in response"}
66
+
}
67
+
},
68
+
),
49
69
types.Tool(
50
70
name="search",
51
71
description="Search DevRev using the provided query",
@@ -487,6 +507,77 @@ async def handle_call_tool(
487
507
)
488
508
]
489
509
510
+
elifname=="list_vistas":
511
+
ifnotarguments:
512
+
arguments= {}
513
+
514
+
payload= {}
515
+
516
+
# Optional parameters from the API
517
+
vista_type=arguments.get("type")
518
+
ifvista_type:
519
+
payload["type"] =vista_type
520
+
521
+
cursor=arguments.get("cursor")
522
+
ifcursor:
523
+
payload["cursor"] =cursor
524
+
525
+
created_by=arguments.get("created_by")
526
+
ifcreated_by:
527
+
payload["created_by"] =created_by
528
+
529
+
flavor=arguments.get("flavor")
530
+
ifflavor:
531
+
payload["flavor"] =flavor
532
+
533
+
is_default=arguments.get("is_default")
534
+
ifis_defaultisnotNone:
535
+
payload["is_default"] =is_default
536
+
537
+
limit=arguments.get("limit")
538
+
iflimit:
539
+
payload["limit"] =limit
540
+
541
+
members=arguments.get("members")
542
+
ifmembers:
543
+
payload["members"] =members
544
+
545
+
mode=arguments.get("mode")
546
+
ifmode:
547
+
payload["mode"] =mode
548
+
549
+
sort_by=arguments.get("sort_by")
550
+
ifsort_by:
551
+
payload["sort_by"] =sort_by
552
+
553
+
state=arguments.get("state")
554
+
ifstate:
555
+
payload["state"] =state
556
+
557
+
skip_items=arguments.get("skip_items")
558
+
ifskip_itemsisnotNone:
559
+
payload["skip_items"] =skip_items
560
+
561
+
response=make_devrev_request(
562
+
"vistas.list",
563
+
payload
564
+
)
565
+
566
+
ifresponse.status_code!=200:
567
+
error_text=response.text
568
+
return [
569
+
types.TextContent(
570
+
type="text",
571
+
text=f"List vistas failed with status {response.status_code}: {error_text}"
0 commit comments